Commit Graph

3347 Commits

Author SHA1 Message Date
Loko Kung a9386f3060 Fixes popErrorScope to match the specs.
- Prepares for removal of unnecessary bool return, and just call callbacks appropriately. For now always returns true until all users are updated.
- Removes PushErrorScope from handwritten commands now that we no longer need to do anything special.
- Updates tests to reflect the change and make sure to set EXPECTs before calling functions to make tests easier to follow.

Bug: dawn:1324, dawn:526
Change-Id: I90b09c54f9adbf2d6d50ad20dcedf68b5ed0b1fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83942
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-22 14:45:34 +00:00
Brandon Jones c86f28cb84 De-duplicate ExternalTexture Dummy Textures
Avoid recreating 1x1x1 dummy textures for single-plane external texture
by just caching one and reusing it.

Bug: dawn:1082
Change-Id: Ia1fc3520a1b503d4491a256353277400ba90f344
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80462
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-03-21 19:02:53 +00:00
James Price 3b5415f53a Remove usages of the @stride attribute in tests
Support for @stride is about to removed from Tint.

Bug: tint:1381
Change-Id: I6e30ed67d61ab82fd50843caf14216274b1e05fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83960
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: James Price <jrprice@google.com>
2022-03-21 16:48:23 +00:00
Loko Kung 4d8352542a Adds strformat code-gen for helping auto-generate readable strings for structs.
- Adds generator infra for absl::StrFormat for bind group structs and types.
- Uses absl::ParsedFormat to avoid multiple parsing for format strings.

Bug: dawn:549
Change-Id: Ida4ca65eb85c4474c492161c8ae34f53bd692a3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81944
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-19 00:21:48 +00:00
Brandon Jones 39c2029063 Allow CopyBufferToTexture with Depth16Unorm
Removes the validation logic that was blocking this copy from being
valid and update tests to ensure that it works properly.

Copy logic worked with this format as-is, so no updates were necessary.

Bug: dawn:1251
Change-Id: Id0ca503ed0f82e79e75f63ad6870389f7f647d22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81024
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-18 20:40:08 +00:00
Antonio Maiorano 67efacb67f Fix CMake build
Change-Id: I765fa78a47861cdb4445211a437a34ae2a189bda
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83940
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2022-03-17 15:24:47 +00:00
Loko Kung 2391382b14 Implements a cache key serializer and tests.
- Introduces necessary infra to support cache key serialization templating and extensibility.
- Tests cover basic use cases of the infra.

Bug: dawn:549
Change-Id: Idc0bbcb07a3037e9c59841bb3ad7d1040d7b401f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83121
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-17 00:27:26 +00:00
shrekshao ed840583eb Relax vertex stride requirement
Relax validation of last stride of vertex buffer according to the
updated spec.

Bug: dawn:1287
Change-Id: I7a58401933b48c5cb121ba73c592575ada3e7151
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83203
Auto-Submit: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-11 01:09:02 +00:00
Shrek Shao 5b9b9867cd Rename SurfaceDescriptorFromXlib -> SurfaceDescriptorFromXlibWindow
As suggested by
https://github.com/webgpu-native/webgpu-headers/pull/150#discussion_r822311773

Bug: none
Change-Id: I4f611a1c345eb644168cf923c6c0c1672114b9d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83201
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-09 19:04:21 +00:00
Austin Eng 74d4e53fc6 Make loapOp/storeOp undefined valid
It is valid for depth/stencil attachment if the attachments are
readonly. It is not valid for color attachments. Make the enum valid,
and update validation.

Caught in CTS roll
https://chromium-review.googlesource.com/c/chromium/src/+/3499286

Bug: dawn:1269
Change-Id: Ib849ed757ccca145f85cadea6f92a1f2a5082d49
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82540
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 18:43:51 +00:00
Austin Eng 154bcbbf4d Metal/GL: Make new texture view for non-2D view of single-layer texture
Fixed: dawn:1309
Change-Id: Ide68f6498fc5fe9dd9e06c6c5caf7d3fff74e526
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83060
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 01:07:20 +00:00
Austin Eng 5073fb5685 Fix BindGroupLayoutEntry validation message for no bindings types set
Fixed: dawn:1318
Change-Id: I9c5953d77c9758f0814fa50a98f5f813daf5e705
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83061
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 00:07:31 +00:00
Austin Eng 1a73be4107 Update shader validation message to reflect new @ binding syntax
Fixed: dawn:1317
Change-Id: Ib8eb4068ae9c52513945a51fe0a7a88a6e3fa43e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83062
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 00:06:30 +00:00
Austin Eng 4f1596134e Use GetInternalUsage in vulkan::TextureView::Initialize
We need to consider the real usage the texture was allocated as, not
the public API usage.

Fixes VVL violation in canvas_composite_alpha_bgra8_unorm_opaque_copy
CTS ref test.

Bug: chromium:1083478
Change-Id: I4461458f98750c1632b823536ff3846a9b31796b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83041
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-09 00:05:40 +00:00
Shrek Shao 1554a7d8f9 Fix dawn.json for upstream webgpu-headers
- Add disabled_tags 'dawn' to webgpu_headers_gen
- Rename WGPUSurfaceDescriptorFromXlib to sync with upstream
- Other sync with upstream: surface wayland and android enums

Bug: dawn:269
Change-Id: I5ca5c5362c54018f9d217af6a6ab4e3e84a5d780
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83000
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-08 20:56:10 +00:00
Jiawei Shao 345bf87c35 Vulkan: Use Zero Initialize Workgroup Memory extension if possible
This patch adds a toggle to enable/disable workgroup memory
initialization with OpConstantNull according to the Vulkan extension
VK_KHR_zero_initialize_workgroup_memory. This toggle is by default
enabled when VK_KHR_zero_initialize_workgroup_memory is supported by
the Vulkan driver.

BUG=dawn:1302
TEST=dawn_end2end_tests

Change-Id: Ie04484c2d0944ead082bd22a436b1c52bc7d93bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82400
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-03-08 02:23:19 +00:00
Austin Eng ea287f5b48 Remove WGSL readonly-storage to storage binding type promotion
Fixed: dawn:1188
Change-Id: Ied8e1fb8a47884456de3d56e049a361fdbcaf640
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82403
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-05 01:37:25 +00:00
Shrek Shao 6d205fcb5d Allow sparse color attachments
Add implementations and related tests reflecting the spec update.

Bug: dawn:1294
Change-Id: I2c20af313259e1d6d6049189cb8adebe4c2436af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81922
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
2022-03-05 01:34:02 +00:00
Li Hao 131c422489 Add timestampWrites on render/compute passes
The timestampWrites in render/compute pass descriptor store the
timestamps at the beginning and end of passes, this requires validating
all timestampWrite members in BeginXxxPass and inserting the
timestampWrite cmd as close as possible to the BeginXxxPass and
EndXxxPass. To do that, we first record only the querySets and
queryIndexes that need to be used in BeginXxxPassCmd and EndXxxPassCmd,
then insert timestampWrite cmd after the native BeginXxxPass and before
the native EndXxxPass in backends.

This CL adds timestampWrites in render/compute pass descriptor
including the validation and tests first.

Implement timestampWrites in backends in following CL.

Bug: dawn:1250

Change-Id: I39b50975aa03cc1afe7a736c3b39df284f54d163
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82100
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2022-03-05 01:22:52 +00:00
Ben Clayton db8666fa71 Roll WebGPU IDL, update dawn/node bindings.
Bug: dawn:1123
Bug: dawn:1286
Change-Id: I3ffeea82fda381905ee8f02f9f2768c81c7e6d6d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79761
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
2022-03-03 21:13:51 +00:00
Loko Kung ba70fac14d Extends current CachedObject interface to allow setting and getting cache keys.
Bug: dawn:549
Change-Id: I52d9321207d67b0214a52acc75456ee8d7943e8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81943
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-03 20:08:22 +00:00
Austin Eng cab7419338 Vulkan: Skip newLayout transition on import if not specified
Fixes vulkan validation layer assertions on Linux in CTS reftests:
 canvas_complex_bgra8unorm_copy.https.html
 canvas_size_different_with_back_buffer_size.https.html

Bug: chromium:1083478
Change-Id: I36580184d15fe36423e5f759eaf959191c6b571c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82480
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-03-02 23:28:17 +00:00
Shaobo a24acf2fbc Validate destination texture states for CopyTextureForBrowser
Current implmentation of ValidateCopyTextureForBrowser has a bug
to verify destination texture states.
This CL fix the simple bug and add noop copy in unittest to catch this
issue.

Bug: dawn:1306
Change-Id: I193105ced89db5092873d604c7dbf43d7ea4fba0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/82101
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-03-02 02:44:01 +00:00
Loko Kung 44f039d3c2 Adds new chained struct for device creation to specify cache options.
- Adds isolation key option, DawnNative support, and relevant unit tests.

Bug: dawn:549
Change-Id: I16344581c7956ce8576c0a4c14655fbdb4e15a54
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81920
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
2022-03-01 22:59:40 +00:00
Yang Gu 6a9f9bd1ff Skip the check of maxFragmentCombinedOutputResources for Mesa llvmpipe driver
The Mesa Gallium llvmpipe driver is a software rasterizer that uses LLVM
to do runtime code generation. It seems to put incorrect value for
maxFragmentCombinedOutputResources, like we see on desktop GPUs.

Some relative values are as below.
vkLimits.maxFragmentCombinedOutputResources: 8
kMaxColorAttachments: 8
baseLimits.v1.maxStorageTexturesPerShaderStage: 4
baseLimits.v1.maxStorageBuffersPerShaderStage: 8

This CL will skip the check of this limit on llvmpipe, like we did for
desktop GPUs.

BUG=dawn:1311
Change-Id: I1698f6e26dd62b56f3819980fa2dcc986c9c5ba3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81941
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-25 18:30:47 +00:00
Jiawei Shao ec3e4b0510 Fix use-after-free issue in Create*PipelineAsyncTasks::Run()
This patch fixes a use-after-free issue in Create*PipelineAsyncTasks
that when pipeline->Initialize() returns error, the pipeline object
will be deleted, while we still attempt to call its member function
after it is deleted.

BUG=dawn:1310
TEST=dawn_unittests

Change-Id: I57d5ca98d6c97b14df1d7c3bf2941c9cc87adeff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81800
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-25 16:28:39 +00:00
Jiawei Shao a84791a955 Ensure non-renderable formats don't support multisampling
This patch removes the support of multisampling on the below 4
formats as they are not renderable according to the discussions at
https://github.com/gpuweb/gpuweb/issues/2465.
- R8Snorm
- RG8Snorm
- RGBA8Snorm
- RG11B10Ufloat

BUG=chromium:1299154, dawn:1244
TEST=dawn_unittests

Change-Id: I3837f2aee322a71c90772322dc01fae410f03e57
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81801
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-24 17:46:46 +00:00
Shaobo 6084407b21 Change texture state validation in CopyTextureForBrowser() to report meaningful errors
CopyTextureForBrowser() will support all uploading paths for WebGPU
CopyExternalImageToTexture(). The validation checks for texture states
should report accurate errors to meet CopyExternalImageToTexture() validate
rules.

Bug: dawn:1306
Change-Id: Ie3b25ec82246d53e6c82968b5dc2f8a253c560c1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81240
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
2022-02-24 02:26:26 +00:00
Li Hao 7abcadfce6 Add toggle to disable the tick->ns conversion of timestamp query
Although the error rate of timestamp tick->ns conversion is very small
(3e-5), some profiling scenarios, such as CPU/GPU timestamp calibration
on Windows, require absolutely accurate timestamps.

Add new toggle to resolve timestamps to ticks for those cases where zero
error is required.

Add an end2end test for GPU timestamp calibration on D3D12 backend.

Disable timestamp period calculation on Device when the
DisableTimestampQueryConversion is enabled.

Bug: dawn:1305
Change-Id: I31ee6b4c1686d5dd2ac29ccb0bd398e650481c26
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81023
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-23 17:50:35 +00:00
Ryan Harrison b3e6d37055 tint->dawn: Shuffle tint repo layout
BUG=tint:1418

Change-Id: Iee47f1846be63bbd829067b3d818d2603647d4e6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80481
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
2022-02-21 17:56:32 +00:00
Jiawei Shao 68d44a7006 Add validations on the format of a resolve target
This patch adds the validations on the format of a resolve target
according to the latest updates in WebGPU SPEC. WebGPU SPEC only
supports the below texture formats being used as the resolve target
of a render pass encoder:
- R8Unorm
- RG8Unorm
- RGBA8Unorm
- RGBA8UnormSrgb
- BGRA8Unorm
- BGRA8UnormSrgb
- R16Float
- RG16Float
- RGBA16Float
- RGB10A2Unorm

BUG=dawn:1244
TEST=dawn_unittests

Change-Id: I16f9c3984f4ffb4641f4f43ecdb3cc76be6a562a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/81080
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-02-19 02:53:32 +00:00
Brandon Jones 6e8c473fa5 Updating names of attachment clear values
Renames multiple attachment clear values to match their new names in the
spec, deprecating the old ones.
 - GPURenderPassColorAttachment.clearColor -> clearValue
 - GPURenderPassDepthStencilAttachment.clearDepth -> depthClearValue
 - GPURenderPassDepthStencilAttachment.clearStencil -> stencilClearValue

Additionally, the old names are marked as deprecated with appropriate
warnings if they are used during the deprecation period.

Bug: dawn:1269
Change-Id: I6649184d65578118942c1f51a41f350719665272
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80941
Reviewed-by: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-02-19 00:44:12 +00:00
Yan,Shaobo 893889b0bb CopyTextureForBrowser(): Validate src/dst texture state
The validation of CopyTextureForBrwoser() fails to valid src and dst
texture state. And a bug has been caught by cts
webgpu:api,validation,queue,copyToTexture,CopyExternalImageToTexture:destination_texture,state:*
after changing CopyExternalImageToTexture() to use CopyTextureForBroswer()
to upload CPU resource.

The CL fix this.

Bug: dawn:1306
Change-Id: Ie4cfd174dc9f54f6cf2099226c4e1cc00ed1d446
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80900
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-02-18 06:26:11 +00:00
Brandon Jones df70004c52 Add Validation For External Texture Bind Group Layout Mismatch
Adds validation to ensure that external texture binding entries match
the bind group layout. This should fix an issue found by the fuzzer.

Bug: dawn:1082
Bug: chromium:1296935
Change-Id: I1cc542ed9105dbe29d775e01e52475a7d6c8d393
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80460
Reviewed-by: Loko Kung <lokokung@google.com>
Auto-Submit: Brandon1 Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-17 19:20:31 +00:00
Li Hao a73050795e Fix QueryInternalShaderTests
1. The left cases will be not checked if the first value is 0 in Check
function.
2. All timestamps are the same value at initialization.
3. Update 83.33 to 83.333 which is closer to the actual period on Intel.

Bug: dawn:1250
Change-Id: I7378cf45453682a3d364b6930072ccc229085f0c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80901
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-17 16:12:41 +00:00
Jiawei Shao ab1a2b7407 Add validation on format when creating a multisampled texture
This patch adds the validation on the texture format when we create
a texture with sample count > 1 according to the latest updates in
WebGPU SPEC.

Below formats can't be used to create a multisampled texture:
- R32Uint, R32Sint, RG32Uint, RG32Sint, RG32Float, RGBA32Uint,
  RGBA32Uint, RGBA32Sint, RGBA32Float
- All compressed formats
- RGB9E5UFloat

BUG=dawn:1244
TEST=dawn_unittests

Change-Id: I71743281ce12158be4b1904732934fad95f39cee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80240
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-02-17 00:48:26 +00:00
Christopher Cameron be72f76c23 Expand GetFormatEquivalentToIOSurfaceFormat
Add support for IOSurface formats for:
- RGBA16Float
- RG16Float
- R16Float
- RGB10A2Unorm

Bug: chromium:1241369
Change-Id: I8d3ed2c7575fe651406cb470383f3d4d23fb7aeb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80820
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: ccameron chromium <ccameron@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
2022-02-16 20:38:50 +00:00
Austin Eng 15bc24eeb8 Don't try to load libvulkan on Mac
Only SwiftShader would be available on Mac.

Bug: chromium:1297154
Change-Id: I943a39dfdde4215ba0ea880bf08294f37f08ee42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80720
Reviewed-by: Shrek Shao <shrekshao@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-16 17:32:20 +00:00
James Price 0fe8d27903 Roll Tint and update WGSL syntax for overrides
The syntax for pipeline-overridable constants has changed in
WGSL. Since this feature is still hidden behind the
disallow-unsafe-APIs flag in Dawn, we removed support for the old
syntax in Tint. This commit rolls Tint forward to get that change, and
updates the WGSL syntax in affected tests at the same time.

Bug: tint:1403
Change-Id: I1d081d9dea0c1de9def5cd123020700df3419f35
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80500
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
2022-02-15 18:36:10 +00:00
Austin Eng 7a8006033a Add additional guards in counter set feature checks
- Don't use for..in since some crashes show that NSFastEnumeration
   in those loops is doing something wrong.
 - Check that the receiver actually supports the selector before
   calling it. Crashes indicate an unrecognized selector is being
   used.
 - Add a ref to MTLCounterSet to be sure it is not somehow freed
   between when it is stored, and when we use it as the receiver for
   [MTLCounterSet counters].

Bug: dawn:1102
Change-Id: I882045ba09547df62a98a862e6e64c5a7d656e80
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80461
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-15 18:18:26 +00:00
Li Hao 3a60f96079 Reset root descriptor table for samplers when descriptor heaps are changed
When shader-visible heap switch happens, we re-populate all bindgroups
and change the descriptor heaps, which need to reset root descriptor
tables, but for the samplers which are cached in
mBoundRootSamplerTables and not changed, they won't be reset, which make
shaders cannot access the sampler heaps.

Bug: dawn:1255

Change-Id: Icc142206121af9daf8b9352b4c639f7d7ef8f1d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/76780
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
2022-02-15 02:05:06 +00:00
Brandon Jones fe994f74ff More verbose BindGroupLayout error messages
Begins including the expected BindGroupLayout in validation messages
where a BindGroup descriptor does not match the BindGroupLayout. This
is especially helpful in cases where the BindGroupLayout was implicitly
created by the pipeline.

Bug: dawn:1258
Change-Id: Icbf27b4a2ac9b4dc1716feed47e3e63cf99929a7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80380
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
2022-02-14 19:06:55 +00:00
Stephen White a52abab38c Nuke SPIRV-Cross.
Change-Id: I1fc58d50ba3999e3a9b6f4e30a0799be301893de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79481
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-11 00:45:51 +00:00
Stephen White 96b72c262c OpenGL: use Tint for GLSL generation.
Change-Id: Ibced679fa6568f1eb33707f0157d03505e6f8a1c
Bug: dawn:1263
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67540
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-10 22:17:41 +00:00
Brandon Jones 31f60e3a40 Remove accidental unused Transform Manager
Removes an unused tint::Transform::Manager that was accidentally merged
as part of commit "Integrate Multiplanar External Texture Transform".

Bug: dawn:1082
Change-Id: I55b5eec8b17f27df22658a90912dec4d6d583cbb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80100
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-02-10 21:56:51 +00:00
Austin Eng e710706858 Remove old src/tests/BUILD.gn
Bug: dawn:1275
Change-Id: I1da086fb291551b0a437411b13285a097557e7de
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/80060
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
2022-02-10 19:41:24 +00:00
Brandon Jones cff04b4d3f Integrate Multiplanar External Texture Transform
Introduces the majority of the logic associated with enabling
multiplanar external textures. Removes most backend logic associated
with external textures in favor of expanding them into their components
in the frontend. Includes a basic e2e test demonstrating multiplanar
YUV-to-RGB conversion.

Bug: dawn:1082
Change-Id: Ib5c042e5639b1a8efe2954680abc346c8c6c76d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/78248
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon1 Jones <brandon1.jones@intel.com>
2022-02-10 19:31:13 +00:00
Jiawei Shao 47f051984b D3D12: Only set root parameters for dynamic storage buffers when needed
This patch skips setting the items for dynamic storage buffer lengths
in root signatures when there is no dynamic storage buffer in the
pipeline layout so that we can avoid adding a root constant with
Num32BitValues == 0 in the root signature.

BUG=dawn:1262

Change-Id: I7d698425c94092299aefaf8cb6ef465745c8d194
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79742
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
2022-02-10 00:05:01 +00:00
Corentin Wallez 82ca6096ac Mark 1D textures as safe.
Fixed: dawn:814
Change-Id: I216ebdb68cfb1634cfad8b44de998c2f1a87edaf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79320
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
2022-02-09 18:40:51 +00:00
Corentin Wallez 9fc28cf3b6 Metal: Fix leak of MTLVertexDescriptor when using vertex pulling
Bug: dawn:1175
Change-Id: I1fd833fef830de4165a397e07c3ddaae0d7bdca8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79762
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
2022-02-09 15:56:32 +00:00