Commit Graph

2229 Commits

Author SHA1 Message Date
Ben Clayton 4c5ab90452 ShaderModule: Refactor ParseWGSL() to take a File*
The tint::ast::Module holds a diagnostic list (tint::diag::List) which references the source tint::Source::File.
If you try to enable any of the more pretty diagnostic printing functionality, and attempt to print these after ParseWGSL() has returned, you'll then dereference a pointer to the now stack unwound `tint::Source::File`.
Promote the file up one callstack level to fix this.

Bug: none. Only exposed when using pretty printing.
Change-Id: I9432dd9d668fd1d92efa228bb5ed31278fd3ddfc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37280
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
2021-01-12 08:50:31 +00:00
Hao Li 9ff83f6c95 Query API: Non-precise occlusion query on D3D12
- Implement begin/endOcclusionQuery on D3D12, the query result is binary
  (0/1), so we don't need compute shader on D3D12.
- Add end2end tests with depth/stencil/scissor tests enable/disable

Bug: dawn:434
Change-Id: I7b58987a9bc3e7f9cbcdee83f630aaa166582f5f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36860
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2021-01-12 01:44:01 +00:00
Carl Woffenden e650b38aa6 Minor fix to build with MSVC: Gets content address instead of iterator
Fixes error C2679: binary '-': no operator found which takes a right-hand operand of type 'std::_Array_iterator<_Ty,23>' (or there is no acceptable conversion)

Change-Id: I566b05032da5f68674156eae2901a3f3e7a8acbb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36082
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-01-11 20:02:21 +00:00
Yunchao He 0325e4503b Add more constants for max texture sizes
Currently we only implemented 2D and 2DArray texture. kMaxTextureSize
is actually for 2D texture only. This patch adds a few more constants
for texture size for 1D and 3D textures, and changes kMaxTextureSize
to kMaxTextureDimension2D.

Bug: dawn:558

Change-Id: I9088dd7c060dc096a65abea37c7fb01f760524e9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36540
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
2021-01-11 18:04:12 +00:00
Stephen White 77fcdf7eaa Add ANGLE to Dawn build.
Bug: dawn:447, dawn:580
Change-Id: I77726651ca00d64768bddc0bb476fd920e11851f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35081
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-01-11 15:52:12 +00:00
Stephan Hartmann 1670c5184b IWYU: add missing include for size_t
Bug: None
Change-Id: Idbb024aa136da5327caae796876ee80222d46a39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37140
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-01-11 08:20:02 +00:00
Hao Li c9a22bcb93 Disable timestamp query extension on Metal
Currently it's not clear how to convert timestamps to nanoseconds on
Metal, disable timestamp query extension on Metal until we know how to
do that. WebGPU issue: https://github.com/gpuweb/gpuweb/issues/1325

Bug: dawn:434
Change-Id: If63bd5fe9dccc1fff16a42cddf63e9d8265e65c5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37020
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-01-08 22:56:05 +00:00
Corentin Wallez a2e02836a2 Suppress EntryPointTests.FragAndVertexSameModule on GL
The test is failing because it seems that SPIRV-Cross is outputing some
of the builtins for the vertex in the fragment shader and vice-versa.

Bug: chromium:1163767
TBR=senorblanco@chromium.org

Change-Id: Iefbc1beb9065a92f1d61776d12c903d4e80648d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37040
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2021-01-08 12:26:05 +00:00
Corentin Wallez 00fcab636a Fix default viewDimension in deprecated BGLEntry path.
The handling of the default view dimension in the deprecated bind group
layout entry path was checking the viewDimension of the new
sub-descriptor instead of the deprecated viewDimension member. This
meant that viewDimension was always defaulted and "2D".

This commit fixes the issue by looking at the correct viewDimension member
and adds a regression deprecation test.

Bug: dawn:620

Change-Id: Icc133b6d80ba3d88bae30dc9138f1d74e14d12c7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36841
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2021-01-07 17:33:44 +00:00
Ben Clayton 3f5c01ae92 Reland "Update PrimitiveTopologyTests to use WGSL"
This reverts commit ad0bec6c96.

Reason for revert: The change was incorrectly blamed for a autoroll failure and reverted unnecessarily.

Original change's description:
> Revert "Update PrimitiveTopologyTests to use WGSL"
>
> This reverts commit b9641b8225.
>
> Reason for revert: Suspect causing Dawn roll to fail
>
> Original change's description:
> > Update PrimitiveTopologyTests to use WGSL
> >
> > A rebased fork of https://dawn-review.googlesource.com/c/dawn/+/33774
> >
> > Bug: dawn:572
> > Change-Id: Icb24ac5b62984e9b093e61077155b9a1eafb344b
> > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35801
> > Commit-Queue: Ben Clayton <bclayton@google.com>
> > Auto-Submit: Ben Clayton <bclayton@google.com>
> > Reviewed-by: Austin Eng <enga@chromium.org>
> > Reviewed-by: Corentin Wallez <cwallez@chromium.org>
>
> TBR=cwallez@chromium.org,enga@chromium.org,bclayton@google.com
>
> Change-Id: Ib6fe527f28cf17f8f8e817c59121e357b9b65cd1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: dawn:572
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36520
> Reviewed-by: Austin Eng <enga@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>

TBR=cwallez@chromium.org,enga@chromium.org,bclayton@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: dawn:572
Change-Id: I2e8859c9b9f12c005bef1309c7bad98f61af2ac7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36842
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2021-01-07 16:04:24 +00:00
Ryan Harrison fac169113d Remove HLSL & MSL SPIRV-Cross Fuzzers
The plan of record is to use Tint for back end generation on these
platforms for launch, so there is no need to fuzz SPIRV-Cross on them.

The GLSL fuzzer will remain for now, since the PoR has native support
for GLSL using SPRIV-Cross.

Change-Id: I8d6bf76b2b81e9bbc158fa8c5a63b119060abbe5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36701
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
2021-01-07 01:36:11 +00:00
Jiawei Shao a84acc4fcc Enable CompressedTextureZeroInitTest on Win/Intel/Vulkan
This patch enables all the tests in CompressedTextureZeroInitTest
on Windows/Intel/Vulkan after the upgrade of Dawn try bots.

BUG=dawn:601
TEST=dawn_end2end_tests

Change-Id: Ida4278ae50ef45b2347462be986e5490a921f988
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36560
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2021-01-06 02:30:09 +00:00
Austin Eng ad0bec6c96 Revert "Update PrimitiveTopologyTests to use WGSL"
This reverts commit b9641b8225.

Reason for revert: Suspect causing Dawn roll to fail

Original change's description:
> Update PrimitiveTopologyTests to use WGSL
>
> A rebased fork of https://dawn-review.googlesource.com/c/dawn/+/33774
>
> Bug: dawn:572
> Change-Id: Icb24ac5b62984e9b093e61077155b9a1eafb344b
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35801
> Commit-Queue: Ben Clayton <bclayton@google.com>
> Auto-Submit: Ben Clayton <bclayton@google.com>
> Reviewed-by: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>

TBR=cwallez@chromium.org,enga@chromium.org,bclayton@google.com

Change-Id: Ib6fe527f28cf17f8f8e817c59121e357b9b65cd1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:572
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36520
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-01-06 00:07:21 +00:00
Austin Eng b9641b8225 Update PrimitiveTopologyTests to use WGSL
A rebased fork of https://dawn-review.googlesource.com/c/dawn/+/33774

Bug: dawn:572
Change-Id: Icb24ac5b62984e9b093e61077155b9a1eafb344b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35801
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-01-05 15:24:29 +00:00
Austin Eng 200941c797 dawn_wire: Return early in callbacks after the server is destroyed
After the server is destroyed, the server's can't do anything like
forward callbacks to the client. Track this with a weak_ptr and
return early if it has expired.

It also updates device destruction in dawn_native so the lost
callback is always called, even on graceful destruction. This
is consistent with the rest of WebGPU where all callbacks are
guaranteed to be called in finite time.

Bug: chromium:1147416, chromium:1161943
Change-Id: Ib80dea36517401a2b8eafb01ded255ebbe757aef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35840
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
2021-01-05 08:37:08 +00:00
Austin Eng e3fd026108 Use a common helper for std::nothrow
It's come up multiple times that ASAN doesn't support
std::nothrow which leads to OOM bugs filed by the fuzzers.
Use a common helper to avoid this and return nullptr for large
allocations when ASAN is enabled.

Bug: none
Change-Id: I492b4ff4e498cf82d4ca08ba849671d3d16b9cfb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36280
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2021-01-05 07:40:48 +00:00
Hao Li c120b02dbe Remove internal resolve buffer from Timestamp compute shader
In timestamp compute shader, we will create an internal buffer for
resolving QuerySet and use it as input buffer in compute shader,
the user-provided resolve buffer is used as output buffer.

This will cause the buffer zero initialization to be called twice,
one is the internal buffer is zero initialized in ResolveQuerySet,
antoher is the user-provided buffer is tracked as pass resource
and need to be initialized. But for ResolveQuerySet(), we expect
there is only once.

We have no special requirements to have an internal buffer. It is
possible to directly use the user-provided buffer for read and
write becuase it will get STORAGE_INTERNAL usage.

Bug: dawn:434
Change-Id: Ia8c8ac6e9ba23fea31468a6d9b4580eece189be2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36201
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2021-01-05 04:49:08 +00:00
Hao Li cdbd295cc6 Get timestamp period from device
- Get timestamp period on each backend
  D3D12: Get GPU frequency(HZ) from queue and calculate the period in ns
  Vulkan: Get timestampPeriod from device properties
  Metal and others: don't need the period

Bug: dawn:434
Change-Id: Ia5588a3dccadfe92d7384b9fdf1e6848c6e5c6e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2021-01-05 02:39:18 +00:00
Jiawei Shao 4110684aa0 Vulkan: Fix a bug in the impl of T2T copy with 2D array textures
This patch fixes a bug in the implementation of the toggle
UseTemporaryBufferInCompressedTextureToTextureCopy on Vulkan backend.
The previous implementation only considered the T2T one-layer copies,
which will cause the validation error by Vulkan validation layer. This
patch fixes this issue by adding the missing support of multi-layer
copies.

This patch also fixes the failures in the WebGPU CTS tests
color_textures,compressed,array,* on the Linux/Vulkan backends with
Vulkan validation layer enabled.

BUG=dawn:42, chromium:1161355
TEST=dawn_end2end_tests

Change-Id: Ic437919a843b8439d267b8d75b27ade3a9e7bcae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36260
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2021-01-05 00:40:30 +00:00
Corentin Wallez da2d927bb1 Add TypeTraits.h for Dawn's additional type traits.
Adds the first type trait that checks that the equality operator is
defined for two types.

Bug: dawn:441
Change-Id: Ied80c5d876739272c07d513727a3ee709a721eab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35522
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-01-04 15:05:29 +00:00
Carl Woffenden 9f0b827df1 Minor fix to build with MSVC: Removes constructor ambiguity
Fixes error C2440: 'return': cannot convert from 'dawn_native::Aspect' to 'Result<dawn_native::Aspect,dawn_native::ErrorData>'

Change-Id: Ia63ced7fe9582c88a4173db008226733bdd06cac
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36080
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Carl Woffenden <cwoffenden@gmail.com>
2021-01-04 13:28:29 +00:00
shrekshao 86980018b3 Invalidate sampler with maxAnisotropy = 0
Bug: dawn:568
Change-Id: Ic0eee693a91153e2447c8f9830919f74c08fde48
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2020-12-30 19:47:33 +00:00
Austin Eng 9a38e5b60d Make HLSL cache key guard comment ASSERT more specific
SPIRV-Cross still emits some comments, so for now, just check that
the specific guard comments Dawn uses are not contained in the HLSL
output.

Bug: dawn:549
Change-Id: Ia6d32befa5ef983e56494542d46e9c3592b6480a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36300
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-29 22:22:22 +00:00
Jiawei Shao 0eb61724c8 Enable CompressedTextureFormatTests on Win/Intel/Vulkan
This patch enables CompressedTextureFormatTests on Win/Intel/Vulkan
after the upgrade of Windows try bots.

BUG=dawn:42

Change-Id: Ifad6634973ef30af7f416798973325a5fa7cbe67
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35920
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-28 18:31:10 +00:00
Stephan Hartmann c8d5277e86 IWYU: add missing include for ceil
Bug: None
Change-Id: I345750e63c1d81d85c722055e193abe4625a2603
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36083
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2020-12-24 03:20:37 +00:00
shrekshao f8c5e4ab74 Add maxAnisotropy to GPUSamplerDescriptor
Adds some maxAnisotropy implementation.
Adds an end2end test, drawing a slanted plane with a texture of which each mipmap has a different color, with different maxAnisotropy values.
You can get an idea of what it does at https://jsfiddle.net/t64kpu81/85/
Needs further CTS.

Bug: dawn:568
Change-Id: I89ac56d8cf0fbb655358bf6effa016ddc1f8426f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35143
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2020-12-24 03:11:17 +00:00
Hao Li c08276644f Add maximum limitation for query count in CreateQuerySet
- Limit the maximum query count to 8192 to fit Metal restriction.
- Add unittest tests of query count and remove the test of buffer
size overflow validation on 32-bits.

Bug: dawn:434
Change-Id: Ie573b715cc3f67ec158996119a8b4a49e493680a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36021
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-12-24 02:57:07 +00:00
Austin Eng 700809a7f7 Update BindGroupTests to use WGSL
Bug: dawn:572
Change-Id: I1e7cd05ff184f7d26a75006d10b216aea28abb04
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32513
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-23 19:54:30 +00:00
Austin Eng b3ab21e1e2 Update GpuMemorySynchronizationTests to use WGSL
Bug: dawn:572
Change-Id: Ie16558bc104557603df99c9976b744a685592247
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33765
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-23 19:42:00 +00:00
Jiawei Shao a4fb42ac92 Enable two dawn_end2end_tests on Win/Intel/Vulkan after bot upgrades
BUG=dawn:491

Change-Id: I94aef91200ad1a9f96abd19b00a04000b0595e2d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36240
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-23 19:07:30 +00:00
Austin Eng 33bf309c1d Update OpArrayLengthTests to use WGSL
Bug: dawn:572
Change-Id: Iba92adda4758fc91294f7c6d8b0be3065c786f71
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33773
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-22 20:11:48 +00:00
Austin Eng 04e3078a64 Update DepthStencilSamplingTests to use WGSL
Bug: dawn:572
Change-Id: I8e90175e2201250ca7e67ec955226871bdb70a97
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32514
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-22 20:03:48 +00:00
Austin Eng 600798bdb1 Update BufferZeroInitTests to use WGSL
Bug: dawn:572
Change-Id: Id194127831e54623df135b415ec2619016c6c6cb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32512
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-22 19:56:49 +00:00
Austin Eng 84997c5ee9 Update ViewportOrientationTests to use WGSL
Bug: dawn:572
Change-Id: Ifef4f75dcfd0077e3361ea0854cddf3e78e84a02
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33887
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-22 19:56:48 +00:00
Austin Eng 65ae78ef52 Update ViewportTests to use WGSL
Bug: dawn:572
Change-Id: I08672a402205d4bcac278a1bdcf5d1befa46015c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33771
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-22 19:50:18 +00:00
Austin Eng 6442400bdd Update CreateReadyPipelineTests to use WGSL
Bug: dawn:572
Change-Id: If9c35023a62a1506fe968b30d822ced86c8a1465
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32507
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-22 19:49:48 +00:00
Austin Eng 241cd0cd8e Update PrimitiveTopologyTests to use WGSL
Bug: dawn:572
Change-Id: I9275ad78e6222b33372f5640b07801b815670fa6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33774
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-22 19:24:28 +00:00
Ben Clayton 58ce2745cd dawn_native/vulkan: Use EmitVertexPointSize transform
Fixes validation errors when drawing with point topologies, and without explicitly writing to the PointSize builtin.

Fixed: tint:321
Change-Id: I3c00c5ee56966a82d9e3024cb277eae8921a9af2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35800
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-22 18:10:58 +00:00
Jiawei Shao 03d0309255 Vulkan: Fix a typo in SwapChainVk.cpp
BUG=dawn:269

Change-Id: Iacda4d222a81a4ed9e4c623a73e59019cfd6a2c2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36180
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-12-22 17:35:18 +00:00
Hao Li afcef3ee90 Query API: Test the accuracy of timestamp compute shader
Because the uint64 is not supported on all GPU drivers, we use uint32
and float to simulate the multiplication of uint64, but there is
accuracy loss between the results and the expected results computed by
uint64. This test checks that the accuracy loss is less than 0.2%.

Bug: dawn:434
Change-Id: I6f5c842b6915f101441886bdfa4f9feb2827d174
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34120
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-22 06:55:36 +00:00
Jiawei Shao 3272f9da37 GLES: Fix a bug in the impl of CopyBufferToTexture() with compressed formats
In OpenGL ES glPixelStorei() doesn't affect the execution of
glCompressedTexSubImage*D(), and GL_UNPACK_COMPRESSED_BLOCK_* is not
defined in OpenGL ES, so on the OpenGL ES backends, to implement
CopyBufferToTexture() with compressed texture formats, we can only copy
the compressed texture data once per compressed block row.

With this patch CompressedTextureBCFormatTest/* can pass on Intel Mesa
OpenGL ES driver.

BUG=dawn:42, dawn:580
TEST=dawn_end2end_tests

Change-Id: Ied84a187beaf9105d3664c4e874b3b7ddda4e4b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36020
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2020-12-22 00:38:56 +00:00
Brandon Jones 3af532b8a8 Update BindingInfo to reflect new BindGroupLayoutEntry structure
Changes the internal BindingInfo structure and any references to it. The
BindGroupLayoutEntry information is normalized when converting it into
the internal representation, but still accepted as either the old or
new layout. A "bindingType" member is added to the BindingInfo that's
not present in the BindGroupLayoutEntry itself to indicate which of
buffer, sampler, texture, or storageTexture is populated. This proves
useful for a myriad of switch statements in the various backends.

Bug: dawn:527
Change-Id: I6ae65adae61d0005fc50ed6d1bc2ec9b2a1295ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35862
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
2020-12-21 20:14:26 +00:00
Jiawei Shao ec56b90cea Skip all the dawn_end2end_tests using glTextureView() on GLES
This patch skips all the dawn_end2end_tests using glTextureView() on the
OpenGL ES backend as glTextureView() is not available in OpenGL ES.

With this patch all the dawn_end2end_tests will be able to run on Intel
Mesa OpenGL ES drivers with no crash.

BUG=dawn:580

Change-Id: I420eebfd699edf745bd08cb941f3143aad2fbd06
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36040
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-12-21 18:36:16 +00:00
Austin Eng 64c5d601f8 Update ComputeStorageBufferBarrierTests to use WGSL
Bug: dawn:572
Change-Id: I42e971b843807602ba91f5df0aa692569ec31521
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32511
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-17 19:44:07 +00:00
Austin Eng d10774c42f Update DynamicBufferOffsetTests to use WGSL
Bug: dawn:572
Change-Id: I73d987e8ab09120014d2d5c802bd08f08c33bdbd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33775
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-17 19:41:57 +00:00
Austin Eng ee977a0df8 Update MultisampledSamplingTests to use WGSL
Bug: dawn:572
Change-Id: Id488b3e08c57036508f4f0a5120d6bf020b4a782
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33884
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-17 19:23:27 +00:00
Austin Eng 02436022ae Update DepthStencilCopyTests to use WGSL - FragDepth
Bug: dawn:572
Change-Id: If21d9b7d85394d56f38b079370d9333d342c0b44
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33885
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-17 19:20:27 +00:00
Austin Eng 8d38c0164c Autogenerate all of the wire callback mocks
This makes it less manual code and less error prone to
add new callbacks to the wire.

Bug: dawn:384
Change-Id: I8547af2dba8289d1badd41e53dd732c776fb5d06
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35600
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-17 17:59:37 +00:00
Corentin Wallez 5ca12a825c Introduce SubresourceStorage (3/N): Inline data
This CL changes SubresourceStorage to have an inline storage for the
per-aspect compressed data and allocate the storage for decompressed
data lazily. This will avoid the large performance cost of allocations
in the happy case.

Bug: dawn:441

Change-Id: Iae1cab87b699cb0e60031abe7306cdff92fbd049
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35521
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2020-12-17 15:56:27 +00:00
Brandon Jones b31cd871ad Update majority of tests to use new BindGroupLayoutEntry format
Converts most of the tests to use the new layout, with the exception
of a few that are dependent on additional Dawn changes before the
conversion can happen. The deprecation warning is not enabled yet
due to these remaining changes.

Bug: dawn:527
Change-Id: Idcfd9fc873756f5a9f88de2ce9ab65c66b79bf39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35582
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-17 00:19:34 +00:00
Ben Clayton 307ece1630 end2end: Enable textureLoad() tint tests
These are fixed by:
https://dawn-review.googlesource.com/c/tint/+/35423

Fixed: tint:399
Change-Id: I81d6e88083afa07b31d4b4b750a221d2be31d942
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35722
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
2020-12-16 18:37:10 +00:00
Kai Ninomiya cf820d79ef Rename STRIDE_UNDEFINED to COPY_STRIDE_UNDEFINED
Per https://github.com/webgpu-native/webgpu-headers/pull/71

Keeps but deprecates WGPU_STRIDE_UNDEFINED/wgpu::kStrideUndefined.

Bug: dawn:520
Change-Id: Ied162ec39454fac3d16a3782c9ed6d2f68c1d41d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34926
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Kai Ninomiya <kainino@chromium.org>
2020-12-16 07:53:30 +00:00
Ryan Harrison fea4c14580 Fix missing include that causes Skia builds to fail
One of the issues blocking Dawn->Skia rolls

Change-Id: Ia3c68edd2c2745586dfb6a778e3a493df20aa66d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35820
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-15 19:59:59 +00:00
Brandon Jones b35ae00239 Fix erroneous validation logic for BindGroupLayoutEntry
https://dawn-review.googlesource.com/c/dawn/+/34921 introduced a couple
of bugs. This CL fixes them and tests to ensure that the new validation
logic is working correctly.

BUG=dawn:527

Change-Id: Ief01dfda0b97a202bf12ff6aeb0e7a3b84b4b81c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35700
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-12-15 17:32:59 +00:00
Corentin Wallez e0a4d8f209 Fix comment that says "control case" when it isn't.
Bug:
Change-Id: I414bdabeeb12ed53c0620ead80d54a1448bb95bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35720
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-12-15 16:49:29 +00:00
Ben Clayton 56996023fe end2end: Enable DepthReplacing tint tests
These are fixed by:
https://dawn-review.googlesource.com/c/tint/+/35500

Fixed: tint:329
Change-Id: I33105e392c6dfbe75a4d716fe98805dbe696c2ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35721
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@google.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
2020-12-15 16:33:19 +00:00
Corentin Wallez 0faa66ab2b Introduce SubresourceStorage (2/N): Merge
This CL adds the Merge() operation to SubresourceStorage() that allows
modifying the content of a storage with another storage.

Bug: dawn:441

Change-Id: I28e3cd7bc967056eda2c387b2b6e164eb370a241
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35520
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-12-15 13:10:08 +00:00
Ryan Harrison 43c39a1ba4 Re-enable disabled unit tests
The issues causing these tests to fail with the Inspector enabled have
been resolved.

BUG=dawn:578

Change-Id: Ie0b7b4d6b2d1a3b432f4eed7542c64e31bf44fdb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35680
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-12-14 20:45:08 +00:00
Brandon Jones 9c52c2997c Updating BindGroupLayoutEntry interface to match latest spec
Updates BindGroupLayoutEntry to allow for the newly split-up descriptors
that define each binding type in it's own member (buffer, texture, etc.)
The previous style of descriptor is still supported but is deprecated.

For the sake of keeping the scope reasonable, this change does not alter
the BindingInfo structure that's used internally by the various
backends. That will come as a followup.

Bug: dawn:527
Change-Id: I2f301f5f36fa2ce7ff15126ac90dc4c19d5e32ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34921
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-12 02:09:56 +00:00
Corentin Wallez 9229175811 Introduce SubresourceStorage (1/N)
This CL adds the start of the implementation of a SubresourceStorage<T>
container class that stores per-subresource state in a compressed
fashion. Only the getter methods and Update() modifying methods are
added because they are the first step necessary to test the behavior of
SubresourceStorage.

Subsequent CLs will:
 - add the Merge() operation
 - move the per-aspect storage to be inlined and avoid allocation of
mData and mLayerCompressed if possible
 - use the container where applicable in dawn_native
 - (maybe) move clear-state tracking in the backends as part of barrier
tracking

Bug: dawn:441

Change-Id: Ic93e5af16dd705b260424f05e4dc3e0c9f6fbd0a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34464
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
2020-12-09 15:38:27 +00:00
Austin Eng 30805557e6 Enable use_tint_generator w/ test suppressions for SPIR-V based backends
This runs dawn_end2end_tests both with/without use_tint_generator on
Vulkan, OpenGL, and OpenGL ES backends. This is a temporary solution
until we add an dawn_end2end_use_tint_generator_tests suite in the
bot configuration after all backends can support use_tint_generator or
have the appropriate test suppressions.

Bug: dawn:571
Change-Id: I44ab0ba7261160e34dbad512d98602427dc7e966
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35044
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-12-08 16:49:34 +00:00
Ryan Harrison 0824188672 Fix issues with roll into Skia
Specifically there are build failures due to size_t not being defined
in CachedObject.h, as well as unused functions in ShaderModule.cpp

Change-Id: Ie9bd903660e3563fdf797e716bf55f6fa8627e84
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35103
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-08 16:32:34 +00:00
Corentin Wallez 2093157afe Rename TryConvertAspect to better reflect what it does.
Bug: dawn:441
Change-Id: I51d28102926fb00a7c6225bc3b84324fe8f1f6fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34902
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-08 15:56:44 +00:00
Stephan Hartmann 0b0e6e0579 use cstring instead of string.h
dawn codebase uses c-prefixed headers.
Follow up for https://dawn-review.googlesource.com/c/dawn/+/35001

Bug: None
Change-Id: I65b18f3ec8b2222f9a683c2cf81b710435dcf55c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35017
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-08 14:14:53 +00:00
Stephan Hartmann 36cd254bbd GCC: fix template specialization in ObjectContentHasher
GCC complains that explicit specialization in non-namespace scope
is happening for ObjectContentHasher.

In file included from
../../third_party/dawn/src/dawn_native/ShaderModule.cpp:19:
../../third_party/dawn/src/dawn_native/ObjectContentHasher.h:56:19:
error: explicit specialization in non-namespace scope 'class
dawn_native::ObjectContentHasher'
   56 |         template <>
      |                   ^

Additionally make RecordIterable constexpr, because it is called
from constexpr methods. GCC complains about this as well:

../../third_party/dawn/src/dawn_native/ObjectContentHasher.h:76:50:

error: call to non-'constexpr' function 'void
dawn_native::ObjectContentHasher::RecordIterable(const IteratorT&) [with
IteratorT = std::__cxx11::basic_string<char>]'
   76 |             recorder->RecordIterable<std::string>(str);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

Bug: None
Change-Id: I535f5f5e0beded09f105f9871759b617c7384ae0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35003
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
2020-12-08 13:52:03 +00:00
Corentin Wallez 61355d416d Change SubresourceRange to be hierarchical.
Initializing SubresourceRange with {x, y, z} type of constructor
was error prone because it was going from the smallest concept
to the larger one instead of being hierarchical.

This CL changes the order of the structure and more importantly
adds a constructor that's in hierarchical order and groups related
members together. For example:

  SubresourceRange range(Aspect::Color, {layerStart, layerCount}, {0, mipCount});

It also adds a rename of SingleMipAndLayer in hierarchical order as
SubresourceRange::Single and a helper that gives a full range as
SubresourceRange::Full (it will be used in follow-up CLs).

Bug: dawn:441

Change-Id: I8e71bae1129a96222f7779014575b24b31f5ef7a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-12-08 12:39:03 +00:00
Austin Eng 8a73e1876d Add MSL support for UseTintGenerator toggle
Turns on Tint generation of MSL if UseTintGenerator is on

Bug: dawn:571
Change-Id: Icfa523c36a509baf5da3b2a54152a7fb462c86f4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32303
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-12-07 22:04:23 +00:00
Stephen White 042184128e Widen color state support on ES.
Indexed draw buffer (color state) support on ES is not core until 3.2.
Previously, we were failing (asserting) if color state was changed for
a non-zero attachment. This CL compares the state, and only asserts if the
color state actually differs per-attachment.

It also implements a disable_indexed_draw_buffers toggle, which allows a
test to check for the functionality in a platform-independent manner.

BUG=dawn:580, dawn:582

Change-Id: I11c67b0dd72f73e7302c06cad24e8a268fb37a76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34981
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-07 19:31:03 +00:00
Austin Eng 1ae024ce56 Add SPIR-V support for UseTintGenerator toggle
Turns on Tint generation of SPIR-V if UseTintGenerator is on.
This affects SPIR-V generation for Vulkan, and SPIR-V passed
into SPIRV-Cross to produce GLSL.

It enables DrawTests use_tint_generator for Vulkan/GL where it
should have at least basic support.

Bug: dawn:571
Change-Id: I5df1435bee17572259f5aa3605c4bf19c0136cbc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32302
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-12-07 19:05:33 +00:00
Austin Eng 0d948f7752 Produce tint::ast::Module in the frontend if UseTintGenerator
This factors code to move parsing of tint::ast::Module to the
frontend. All backends will use this code path when
UseTintGenerator is enabled for both SPIR-V and WGSL ingestion.

To avoid too much code explosion, parsing and validating the
shader is moved into ValidateShaderModuleDescriptor which
returns a result struct that gets passed into creation.

Bug: dawn:571
Change-Id: I598693ef36954fd0056a0744a2a0ebd7cc7d40a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32301
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
2020-12-07 18:12:13 +00:00
Brandon Jones 224a3a4ab5 Fix Emulated OOB Index In Primitive Restart Tests
Recognizes an OOB vertex index to show consistent behavior when trying
to emulate an OOB index across backends.

Bug: dawn:575
Change-Id: Ie06d6706614843c75c217f7b3b144dc25996cd0b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34924
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
2020-12-07 17:29:43 +00:00
Stephan Hartmann d63d562d1b IWYU: include string.h for memcpy
Bug: None
Change-Id: I978f49febf7e9e9e961957f62efd3ff9a166b81b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35001
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-12-05 20:37:01 +00:00
Natasha Lee c532048062 Add testing and implementation for lazy init compressed textures
Bug: dawn:145
Change-Id: I176ac2fb4c7db708bb147e2ad0118538907b43d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33040
Commit-Queue: Natasha Lee <natlee@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-12-04 19:31:40 +00:00
Stephen White 8c813311f0 Fix base vertex toggle.
Use the correct toggle when checking for support.

Also disable a test which tests it unconditionally.

Change-Id: I5f98004865df5e1f4dd6cf6eaa4769444b90e9c2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34980
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-12-04 19:24:00 +00:00
Stephen White f31b78e90e Enable all remaining end2end tests on OpenGL ES backend.
This enables all the tests which pass on ES 3.2.

BUG=dawn:580

Change-Id: I56fde768a917d74f24e53cd2f7367aa165c4ac4f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34720
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-04 15:59:29 +00:00
Ben Clayton 5816894706 Remove legacy tint::transform API codepaths
https://dawn-review.googlesource.com/c/tint/+/34800 has been merged, and rolled into Dawn and Chromium.

Bug: tint:390
Bug: tint:389
Change-Id: Ibbbb7f664b2c0e132c5ac25f24bc8f7cb24fc460
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2020-12-04 12:55:09 +00:00
Austin Eng f731a81c74 Fix DawnTest HasToggleEnabled referencing the wrong device
It should reference the backendDevice as the |device| points to
the wire client device when the wire is used.

Bug: none
Change-Id: Iac6399df96ea0226d8b9ba8f6196185e43c41adb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34923
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-04 02:07:20 +00:00
Brandon Jones 3a915a67f5 Set D3D12 IBStripCutValue
Sets IBStripCutValue on the D3D12 render pipeline to the appropriate
value when an index buffer is used. Revises primitive restart tests to
catch when IBStripCutValue is not set.

Bug: dawn:575
Change-Id: I77058d8fe62a52c09641b82d3383a404b7ac6d4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34340
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-03 21:45:09 +00:00
Ben Clayton 80baa39ffc Add codepaths for new tint::transform API
These are guarded by `#if DAWN_USE_NEW_TINT_TRANSFORM_API` preprocessor conditionals, this define will be added to the tint `transform.h` file, atomically switching code paths when the new API lands.

See https://dawn-review.googlesource.com/c/tint/+/34800 for the tint change.

Bug: tint:390
Bug: tint:389
Change-Id: I0f397550f921a46c5bb29b1e71aacfee19ec5dd3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34880
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
2020-12-03 21:25:59 +00:00
Stephen White 00cda4f719 OpenGL ES: enable StorageTextureTests.
Disable 32-bit-per-component RG* format tests, since those formats are
unsupported on OpenGL ES.

BUG=dawn:580, dawn:595

Change-Id: I0bc3b03c65bbf15c7c38937ed84629c61201ff76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34780
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-12-03 19:07:33 +00:00
Austin Eng 1229110f9c Update TextureFormatTests to use WGSL
Bug: dawn:572
Change-Id: I104465bfaf3056e0546cdf08b0aebfb43d84b488
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33886
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-03 18:51:53 +00:00
Bryan Bernhart 24bf7a4fbb Pipeline caching: refactor object hashing
Dawn's object-based cache creates keys from memory
addresses. These keys cannot be used in a persistent
cache. This change modifies the keys to only
use hashes so they can be re-used for caching
pipelines.

BUG=dawn:549

Change-Id: Ica64d58ae6a3c6266435cfc3f776c820190f7895
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30740
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
2020-12-03 18:42:13 +00:00
Corentin Wallez fe129405cf Move Subresource-related datatypes to their own file.
Aspect and SubresourceRange will be used by the SubresourceStorage
container that will itself be used by TextureBase. Avoid cyclic header
dependencies by moving SubresourceRange and Aspect to their own header.

Also refactors the handling of Aspect to aspect index in preparation for
using it in SubresourceStorage (each Aspect will have a fixed index).

Bug: dawn:441

Change-Id: I66c60f899d236a233ef30a287227610f8b469f88
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34463
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-12-03 17:55:03 +00:00
Stephen White c34bb0c3c4 Enable viewport tests on OpenGL ES.
Also implement a workaround for missing glViewportIndexedf().

BUG=dawn:580,dawn:597

Change-Id: I618161ae9750925c1c892123607db84563f0869c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34721
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-03 17:00:33 +00:00
Austin Eng 600f6f55db Specify mip level and array layer in TextureMTL lazy clear
These were accidentally left out in the original code and fixes
WebGPU CTS zero init tests with renderable formats on Mac.

Bug: dawn:145
Change-Id: Ied886098408a749c094addb2ceaeb7e8c14938d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34726
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-03 16:55:53 +00:00
Ryan Harrison 10cb17e079 Disable unit tests with KI when Tint Inspector is being used
dawn_unittests --enable-toggles=use_tint_inspector now passes.

Bug: tint:578
Change-Id: I1e764fd99a145542fe6b7c6e651b0dec1fb4785f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34722
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
2020-12-03 16:34:27 +00:00
dan sinclair 0d1c17363d Remove tint context.
This CL removes all references to the tint context object which is going
away.

Bug: None
Change-Id: I3b74a8a65b89ba2236cfa71e7551756c8624e2a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34725
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-12-03 15:46:17 +00:00
Corentin Wallez 5d8a071433 Suppress all end2end tests on Intel D3D12 with validation layers
After a driver upgrade a lot of these tests started hanging, to unblock
the CQ and fix various builder, we skip all the tests on this
configuration.

Bug: dawn:598
TBR=enga@chromium.org

Change-Id: Ic5e47bb6e84be1104e8a511c087d3386bf025c90
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34468
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-12-03 11:21:57 +00:00
Bryan Bernhart a0ca2cc7ef Fix WindowsDebugLogger hang on release builds
Removes ASSERT checking the status of the exit
handle so it cannot ever be optimized out.

BUG=dawn:592

Change-Id: Ib88a058abd0597668ba3c272cf0e304f4aa19c4e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34761
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-03 10:53:04 +00:00
Ryan Harrison b17fe99e8b Do not assert in work thread during tests
If there is an issue with the shader, i.e. validation failing, the
former ASSERT_EQs will kill the thread that is running the lambda.

Since the main thread is waiting for a state change, if this assert
kills the thread, the test will hang forever.

This change allows the test to complete and fail correctly in the case
that the test condition fails.

Bug: tint:578
Change-Id: I6f5cc636193bf01c2d5e5d77a883fab7ec591c3e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34700
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-12-02 18:06:30 +00:00
Austin Eng 2395ff5be1 OpenGL: Bind a dummy sampler for OpImageFetch if not present
In WGSL, textureLoad translates to an OpImageFetch without the
combined sampler. In OpenGL, we need to use SPIRV-Cross to insert
a dummy nearest filtering sampler and bind that in the backend.

Bug: dawn:585
Change-Id: I92ae6ad35263d3720e59fa93688ca914a9495a81
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34401
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2020-12-02 16:51:19 +00:00
Corentin Wallez 0bc6128d4b Reenable BufferMappedAtCreationOOM on Windows
It was suppressed because PartitionAlloc didn't support new
(std::nothrow). Reenable the test now that ParitionAlloc
supports it.

Fixed: dawn:579
Change-Id: I4d3879ae78ee869d08bb249857af7782a6f7f443
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34465
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2020-12-02 16:22:29 +00:00
Yan, Shaobo bb913a94da CopyTextureForBrowser: Support flipY option
This CL enable CopyTextureForBrowser to accept options. The first
supported option is flipY, which can be implemented through scale and
offset uniforms.

BUG=dawn:465

Change-Id: Ia90153ee63a50e0e40beb1c13c63764d19a0b809
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34402
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-12-02 08:13:09 +00:00
Stephen White 6f5151f657 Enable D* end-to-end tests on OpenGL ES backend.
This is mostly the set of tests which are enabled on Desktop GL,
with the exception of tests which use glTextureView() (unsupported
on GLES).

BUG=dawn:580

Change-Id: I1dbefa394298f7dd31d65e920f1f4efeaebe90ec
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34520
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
2020-12-01 21:52:37 +00:00
Stephen White 26ea8b728c Disable some further C* end2end tests on GLES.
BUG=dawn:580

Change-Id: Ie5d58ebfa2773899d29ed4279478b9a44d8c266f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34540
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-12-01 20:35:27 +00:00
Stephen White ab59a10f2c Enable most C* end-to-end tests on OpenGL ES.
This enables all the C* tests which are also enabled on desktop GL.

BUG=dawn:580

Change-Id: I71cf500a19fc4f81e0de47483d9b1de49df9bf76
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34500
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-12-01 18:37:19 +00:00
Stephen White f995e4adc1 Enable BufferTests on OpenGL ES.
Skip those which currently do not pass (same as GL backend).

BUG=dawn:580

Change-Id: Id307cfb998c981d65621eb98761c22d73e5b0f81
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34403
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-12-01 18:33:27 +00:00
Stephen White 7bf553c467 Fix SSBO bindings in GLES backend.
OpenGL ES doesn't have the glShaderStorageBlockBinding() call, so we
modify the binding decorations set in the shader instead. This requires
plumbing through some more pipeline state at shader translation time.

BUG=dawn:584
Change-Id: Ib7fdb6a7ad1eff1a99d44d55e9d923214affe702
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2020-12-01 17:42:57 +00:00
Ryan Harrison c3830d436c Add support for using Tint Inspector
Adds in a toggle to control using Tint or SPIRV Cross for reflection.
The current implementation only gets name and stage information via Tint,
backfilling the rest from SPIRV Cross.
Future CLs will fill in the rest of the entry point metadata.

Bug: dawn:578
Change-Id: Iee16b9dbb9a17d4aaa68e5e52e4aa91ee0a62624
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33500
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
2020-12-01 14:53:07 +00:00
Corentin Wallez a92f0d2b61 CommandBufferMTL: Address review comments
Renames indexTypeSize to indexFormatSize. I forgot to add the changes
prior to pushing the commit.

Bug: dawn:502
Change-Id: I38f19edc021141c5a5ab57c6220978b7c88b116e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/33923
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
2020-12-01 14:06:47 +00:00