Bug: dawn:628
Change-Id: Iaaa62507592e12a724673a0226783c0425b04f35
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67601
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
- Ensures that the D3D12 buffer destruction implementation no longer handles unmapping as that is now handled in the frontend.
- Moves around when the frontend buffer state is set to MappedAtCreation so that it only happens when the staging buffer (when necessary) is created successfully. Note that if the staging buffer was not created successfully, we will never return that buffer and would instead return an error buffer anyways. We need the state to be Unmapped though since it needs to be properly destroyed.
Bug: chromium:1265923, dawn:628
Change-Id: I62f98f0f1379a9cf0af565adfb8256ffe592b1ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68880
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
In all three modes, this cancels the current operations as soon as
possible. For tests that hang, this ensures we can Ctrl+C the process
and get the stdout from those tests.
Bug: dawn:1163
Change-Id: Ib3e45b533adaf510e1f9454a59ef1e821fc3eccd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68300
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Same as passing in "--flag=dawn-backend=<name>".
Also, if VK_ICD_FILENAMES env var is set, force backend=vulkan.
Bug: dawn:1163
Change-Id: If2def47e1af2a1eba7fbf897c8ed1ebf92ae4a15
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68183
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
WebGPU community has decided how to handle color space conversion.
This also add more supported dst color format for
copyExternalImageToTexture.
This CL update the supported dst texture formats to align with
WebGPU spec. This is also the preparation for color space conversion.
Bug: dawn:1140
Change-Id: Ibf4386d5cec4acb086e111229dd8bba36a5f6bcd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67620
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
- Updates error message formatting to ensure they end with a newline to
prevent errors from running together.
- Updated all encoder/device context messages to normalize their format
and include more information.
- Update Abseil formatter to make objects indicate if they are an error
object in the formatted string. (ie: [Invalid BindGroup])
- Added fallback code in case a context message doesn't format
correctly to aid in debugging.
Bug: dawn:1154
Change-Id: Id27b11305cf8efcca343597f90489dde5552c775
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68200
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This change also makes sure that all three modes (serial, isolated
parallel, and server) all output stdout of tests only if verbose mode is
enabled.
Bug: dawn:1163
Change-Id: I9e9efcfa4b73571adac15179d2792fb745255fb8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68182
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This change adds a end2end test for readonly depth/stencil
attachment and implements it on D3D12.
This change focuses on depth. If it is OK, I will add test(s) for
stencil.
The key points are:
- Set DEPTH_READ transition barrier to replace DEPTH_WRITE barrier
if it is readonly depth/stencil attachment.
- Set appropriate D3D12_DEPTH_STENCIL_DESC (which is already correct)
and D3D12_DEPTH_STENCIL_VIEW_DESC (which needs some particular
flags). Otherwise, the underlying driver (validation layer) may
think we still need DEPTH_WRITE transition barrier.
Bug: dawn:485
Change-Id: I64d30426ed8042a98b3fef084bb90b125320a6f8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67742
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Instead of using BufferLocation as another layer of indirection,
the indirectBuffer can be set directly on the indirect command.
This makes the indirect validation a bit simpler, but introduces
additional lifetime dependencies in that the indirect draw validation
MUST be encoded while the DrawIndexedIndirectCmds it references
are still valid.
Bug: dawn:809
Change-Id: I1ef084622d8737ad5ec1b0247bf9062712e35008
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67241
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Improves various error messages that have received feeback indicating
that they were too confusing or poorly worded.
Bug: dawn:1152
Bug: dawn:1157
Change-Id: If740300f31278ab04d4493887c03918a09cf0f86
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68100
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
These flags are forwarded to the cts cmdline/server to configure dawn.node.
I also documented this in the README, along with examples.
Bug: dawn:1163
Change-Id: I6e213f1bd64700564c2e54dcd4edcf219ef2e829
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/68060
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This will help with review load and finding an owner once mandatory
owner review is enabled.
Change-Id: I1a90b83fed68f062c1406552aec218bf9c2092ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67821
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch adds trace events on the creation of shader module,
render pipeline and compute pipeline so that we can measure how
expensive these tasks are in chrome://tracing
BUG=dawn:1167
Change-Id: Iffc37adea49d7e04b9f757bc8b3679769085a428
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67880
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
If the texture attachment doesn't have a stencil aspect, we can
set stencilReadOnly flag in RenderPassDepthStencilAttachment as
we want. And it is totally ignored and it doesn't impact whether
the depth/stencil attachment is readonly or not.
That's true for depthReadOnly flag upon a stecil-only format like
stencil8, but we haven't support stencil8 yet.
Bug: dawn:485
Change-Id: If0a21250ce7cc7a1ad9cc17a05ecf64d05342cd0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67962
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
The changes should pass through the destroy changes such that when the device is destroyed, the respective destroy functionality currently existing in the backends should be called.
For buffers, destroy no longer causes validation errors since even error buffers may need to be destroyed in the case of mappedAtCreation.
Bug: dawn:628, dawn:1002
Change-Id: I42a475af5d67cc60f86d95ac53c2b377a9fd2e82
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65863
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Rebuild if the `out-node` directory is missing.
Actually check the server's status code.
Fix error handling for bad statuses.
Change-Id: I2164bba528036d39f10852f4ffd8ace76f145dba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67780
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This is a reland of 9901c710d1
Original change's description:
> Adds destroy handling for simple objects without new backend changes yet.
>
> Simple objects are defined here as objects that do not already have a destroy or destroy-like API available. They include:
> - BindGroups
> - ComputePipelines
> - PipelineLayouts
> - RenderPipelines
> - Samplers
> - ShaderModules
> - SwapChains
>
> Changes include:
> - Adds necessary constructors for testing and caching
> - Adding mock objects, mock constructors, and tests
>
> Bug: dawn:628
> Change-Id: I26a5e37bc5580b9064db299a75ef1243521b266a
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65864
> Commit-Queue: Loko Kung <lokokung@google.com>
> Reviewed-by: Austin Eng <enga@chromium.org>
Bug: dawn:628
Change-Id: I19492ad6b1660e205d123b2d1fdf53c772564cfe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67961
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
This reverts commit 9901c710d1.
Reason for revert: Breaking dawn roll due to include in ShaderMock
Original change's description:
> Adds destroy handling for simple objects without new backend changes yet.
>
> Simple objects are defined here as objects that do not already have a destroy or destroy-like API available. They include:
> - BindGroups
> - ComputePipelines
> - PipelineLayouts
> - RenderPipelines
> - Samplers
> - ShaderModules
> - SwapChains
>
> Changes include:
> - Adds necessary constructors for testing and caching
> - Adding mock objects, mock constructors, and tests
>
> Bug: dawn:628
> Change-Id: I26a5e37bc5580b9064db299a75ef1243521b266a
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65864
> Commit-Queue: Loko Kung <lokokung@google.com>
> Reviewed-by: Austin Eng <enga@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:628
Change-Id: Ic727106f3dc701dc25418adf9824fbc5397aa656
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67960
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
We now always use Tint.
Bug: dawn:571
Change-Id: Ic65669a9e00493292ed60cde00af6fa3f6e55ec2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65665
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This patch implements the template class ConcurrentCache which will
be used to implement all the thread-safe object caches in Dawn (e.g.
PipelineLayout, ComputePipeline and RenderPipeline).
BUG=dawn:529
TEST=dawn_unittests
Change-Id: Ia6f75191110a93285bdb23fdc1d275444d1ee866
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67760
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Simple objects are defined here as objects that do not already have a destroy or destroy-like API available. They include:
- BindGroups
- ComputePipelines
- PipelineLayouts
- RenderPipelines
- Samplers
- ShaderModules
- SwapChains
Changes include:
- Adds necessary constructors for testing and caching
- Adding mock objects, mock constructors, and tests
Bug: dawn:628
Change-Id: I26a5e37bc5580b9064db299a75ef1243521b266a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65864
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
by clamping the binding size for uniform buffers and using
a dynamically sized array for storage buffers
Bug: dawn:685, dawn:1172
Change-Id: I2222b98d7c2a67cdb420441837e2acfaa8185c73
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67566
Auto-Submit: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Improves the validation messages in ComputePassEncoder.cpp,
ProgrammablePassEncoder.cpp, RenderBundleEncoder.cpp, and
EncodingContext.cpp/h to give them more contextual information.
Bug: dawn:563
Change-Id: I3807c30fb0de8e766fbc35b98ef9c059f9d441ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67603
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Now an overridable constant need to be initialized, either via value specified
in shader, or via constant entry from pipeline stage. Otherwise it is invalid.
Together fix the bool 32bit initialize problem on vulkan and re-enable the
overridable constants shader test, and use assigning to _ instead of
ignore() in tests.
Bug: dawn:1041
Change-Id: I49e7885c8d6134647b09926ceb15234ac21ee35d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67560
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Helps to avoid explicitly using reinterpret_cast
Change-Id: I4df0e7094c7d8460385c6f23dac529ace9df9bdc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67605
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This is a reland of 167d299916
It skips MaxLimitTests.MaxBufferBindingSize on 32-bit Windows
until we have a way to test more reliably on that platform, or
until Dawn no longer allocates enormous staging buffers for zero
initialization.
Original change's description:
> Reland "Populate some D3D12 limits from the backend"
>
> This is a reland of aa8fcfc64b
> It changes MaxLimitTests to use at most a 512MB buffer on 32-bit
> platforms.
>
> Original change's description:
> > Populate some D3D12 limits from the backend
> >
> > Also bumps the required D3D feature level to 11.1
> >
> > Bug: dawn:685
> > Change-Id: I40bc3a162e0aee596d61118ba0dfe0bf9cb60d93
> > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65120
> > Commit-Queue: Austin Eng <enga@chromium.org>
> > Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> > Reviewed-by: Corentin Wallez <cwallez@chromium.org>
>
> Bug: dawn:685
> Change-Id: I2e1df5f7ac0c9bbb6476ca2e1964a9af4afd89b6
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67145
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> Commit-Queue: Austin Eng <enga@chromium.org>
Bug: dawn:685
Change-Id: Ie20a58d73ebfcd64a8c5e58d29d7fb35ee9fba0d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67565
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This reverts commit 167d299916.
Reason for revert: Still failing the roll because of OOM on x86.
Original change's description:
> Reland "Populate some D3D12 limits from the backend"
>
> This is a reland of aa8fcfc64b
> It changes MaxLimitTests to use at most a 512MB buffer on 32-bit
> platforms.
>
> Original change's description:
> > Populate some D3D12 limits from the backend
> >
> > Also bumps the required D3D feature level to 11.1
> >
> > Bug: dawn:685
> > Change-Id: I40bc3a162e0aee596d61118ba0dfe0bf9cb60d93
> > Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65120
> > Commit-Queue: Austin Eng <enga@chromium.org>
> > Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> > Reviewed-by: Corentin Wallez <cwallez@chromium.org>
>
> Bug: dawn:685
> Change-Id: I2e1df5f7ac0c9bbb6476ca2e1964a9af4afd89b6
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67145
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> Commit-Queue: Austin Eng <enga@chromium.org>
TBR=cwallez@chromium.org,enga@chromium.org,rafael.cintron@microsoft.com,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: Ibad5ac7f28015da6a7334ba074aa975198591318
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:685
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67564
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This is a reland of aa8fcfc64b
It changes MaxLimitTests to use at most a 512MB buffer on 32-bit
platforms.
Original change's description:
> Populate some D3D12 limits from the backend
>
> Also bumps the required D3D feature level to 11.1
>
> Bug: dawn:685
> Change-Id: I40bc3a162e0aee596d61118ba0dfe0bf9cb60d93
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65120
> Commit-Queue: Austin Eng <enga@chromium.org>
> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Bug: dawn:685
Change-Id: I2e1df5f7ac0c9bbb6476ca2e1964a9af4afd89b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67145
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Commit-Queue: Austin Eng <enga@chromium.org>
dawn:
* Zero-initialize the SpecializationDataEntry. For booleans, the first
byte may be initialized, while the 3 other bytes may contain garbage.
This can cause boolean specializations to be 'true' when 'false' was
specified.
dawn_node:
* Implement conversion of GPUProgrammableStage's constants.
* Fix Napi::Object -> unordered_map conversion.
* Fix member name in error messages generated by
'DictionaryMembersFromJS'
Bug: dawn:1041
Change-Id: I016ec4916fc73226dfe1bd8e7dc52a1e88e46a6b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67383
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Until all backend implementations are done.
Bug: dawn:1169
Change-Id: I16d184bec03bbc9a255ad33cf11aa615b1986389
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67422
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This reverts commit d84d7f1ea3.
Reason for revert: CTS tests for this are now enabled.
Original change's description:
> Disable DrawIndexedIndirect
>
> Not passing CTS yet
>
> Bug: dawn:809
> Change-Id: Ib7c240372a8fdbd45803230292c374e2957c8d15
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65601
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:809
Change-Id: I3018fec67c278343956a6da68041bc6ec24d55f4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67420
Reviewed-by: Ben Clayton <bclayton@google.com>
Auto-Submit: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
A call-statement can now be made on a function that returns a value.
Bug: tint:1256
Change-Id: I9a3cc4e330f7441e09dc408bdc1cfa515adac392
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67382
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The rules have been relaxed about function values always needing to be
consumed, so a bunch of these phony-assignments can be replaced with the
RHS, but this will be done as a follow-up.
Bug: tint:1213
Change-Id: Ie7c4280f87b4ad7e5a429994b0b88ac22c2f3a9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67300
Commit-Queue: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This reverts commit c7e6bb0d8d.
Reason for revert: clusterfuzz identified issue https://bugs.chromium.org/p/chromium/issues/detail?id=1262112
Original change's description:
> Improve validation errors for encoders
>
> Improves the validation messages in ComputePassEncoder.cpp,
> ProgrammablePassEncoder.cpp, RenderBundleEncoder.cpp, and
> EncodingContext.cpp/h to give them more contextual information.
>
> Bug: dawn:563
> Change-Id: I87c46c4bfda1375809fae93239029ea4e3b9c0a2
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67000
> Commit-Queue: Brandon Jones <bajones@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:563
Change-Id: I259ccde1735c4201ff2736562cfe4689e9a22f62
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67321
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Same as Chrome's args, this allows us to set the
DeviceDescriptor::forceEnabledToggles and forceDisabledToggles when
creating the GPUDevice.
Example: node cmdline.ts ... --gpu-provider-flag=enable-dawn-features=dump_shaders ...
Bug: dawn:1163
Change-Id: Ib5db71355f72e5d08f8fe87313c5e3d63ee236c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66963
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Only used on Windows builds for now, this flag adds the input path to
the DLL search paths. The main purpose is to ensure we load the right
version of D3D dlls, such as d3dcompiler_47.dll from the Chrome output
dir, rather than the default one in the Systems directory.
Bug: dawn:1163
Change-Id: I8e696dd877ec715e1e54d8589af8275e62c90937
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66962
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
As an alternative to setting the "DAWNNODE_BACKEND" env var.
Bug: dawn:1163
Change-Id: I33ace14e7603b97caf7286a109a31160853f62e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66961
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This change replaces the ".gpu" export with ".create()" function that
accepts an array of flags. These will be used by cmdline.ts to set flags
such as what dawn backend to use. We currenly environment variables, but
this will be more flexible.
Bug: dawn:1163
Change-Id: If2fb35811cac45e16121fbd828f997ef3d795f36
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66960
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Prevent reusing offsets from a previous direct draw.
Update test to verify that values are updated correctly
for each draw. Add tests for indirect draw offsets.
Bug: dawn:548
Change-Id: Ice8325a8a41b8a4375767156dbaba3ee3d714f3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67121
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Improves the validation messages in ComputePassEncoder.cpp,
ProgrammablePassEncoder.cpp, RenderBundleEncoder.cpp, and
EncodingContext.cpp/h to give them more contextual information.
Bug: dawn:563
Change-Id: I87c46c4bfda1375809fae93239029ea4e3b9c0a2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67000
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch implements [[num_workgroups]] on the API side for
Dispatch() calls by setting num_workgroups.xyz as root constants.
This patch also adds a temporary validation that on D3D12 backend
using a compute pipeline with [[num_workgroups]] in a
DispatchIndirect call is not supported.
BUG=dawn:839
TEST=dawn_end2end_tests
Change-Id: Iaee2ffd162e9420e4e80944fbb222f10a4600c6a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66580
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit also unifies the initialization process for Adapters.
InitializeImpl() initializes the actual backend adapter.
InitializeSupportedFeaturesImpl() checks base WebGPU features and
discovers additional supported features.
InitializeSupportedLimitsImpl() checks base WebGPU limits and
queries the adapter's maximum supported limits.
Some of these limits from the backend are still overriden in the
frontend because they are limited by internal Dawn constants.
Bug: dawn:685
Change-Id: I43efb0b678dd45f8f89cd62d13104dd00b197da1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64980
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
- Moving the call into DeleteThis should make it so that derived classes don't need to explicitly implement a destructor that calls DestroyApiObject.
Bug: dawn:628
Change-Id: I145f42e7e4c144cc0d2d7c7f609744399d514fe1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66840
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This allows tests to be streamed to N node processes, without incurring the cost of re-scanning the test lists for each case.
It also means that there is an increased chance of state leakage. `--isolate` is a new flag that uses the old behavior of running each test in a separate process.
Depends on: https://github.com/gpuweb/cts/pull/789
Change-Id: Ifc92d1cc07a9de3b2751bed0971f3424d0c247ae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66920
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
If we use render bundle, the compability validation between
writeDepth/Stencil in DepthStencilState in render pipeline and
depth/stencilReadOnly in DepthStencilAttachment in render pass
will become two steps:
1. validation between render pipeline and render bundle during
RenderBundleEncoder's SetPipeline().
2. validation between render bundle and render pass during
RenderPassEncoder's ExecuteBundles().
So, render bundle is like a bridge for this compability validation
between pipeline and pass.
The first step has been done in previous patch. The patch does
the second step.
Bug: dawn:485
Change-Id: I1226494e901c07bdb9f565bce7b9073d420f2fe2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66842
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Spinning up new devices for each test can take a long time.
Specifying --j 0 will run a single instance of node, with the given query to run.
Change-Id: I27c161bb76f5deaaa505ab5ae361ea6a0942a130
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66880
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
https://github.com/gpuweb/cts/pull/788 significantly improves the performance of incremental builds, but it can still take around 2 seconds to do that incremental build.
Have the run-cts tool scan the CTS source tree for the most recent modification, and only rebuild if the timestamp is more recent than the last build time.
Significantly reduces startup overhead of the tool.
Change-Id: I7e9227127c02e6d4dc8875a577178956bf5e2481
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66822
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
These should always be resolved or rejected.
The Fatal() call, when a promise is not resolved or rejected, is currently disabled due to https://github.com/gpuweb/cts/issues/784.
Bug: dawn:1123
Change-Id: Ie0e8ac187ad70be0fea41cd66956d0bfd9c53212
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66821
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
The AsyncRunner will enqueue a call to `Device::Tick()` when the runner count moves from 0 async tasks to 1.
It has been observed that some 'async' tasks are actually synchronious, which results in multiple tick callbacks being enqueued before the first has a chance to run.
Fix this by using another boolean to track whether the function has been queued.
Bug: dawn:1127
Change-Id: I7dd81d33d601bf1d3cefb5c4dad6c237883e51ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66820
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Updates all validation messages in BindGroupLayout.cpp and
BindingInfo.cpp to give them better contextual information.
Bug: dawn:563
Change-Id: I7166dce65c93d7c8ac4dd72555fff34c9202e041
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66841
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
tested:
- maxComputeWorkgroupStorageSize
- maxUniformBufferBindingSize
- maxStorageBufferBindingSize
Two of these limits are exposed as configurable to the JS API
so it's important they are tested to work before we expose
them. maxUniformBufferBindingSize came along as well because
the test for storageBufferBindingSize was easy to parameterize.
Bug: dawn:685
Change-Id: I08de6df9d70a22aca0f48ac3fef0038f7aec727b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This change also adds a unittest to validation colorFormatCount in
RenderBundleEncoderDescriptor, and fixes a style issue as well.
Bug: dawn:485
Change-Id: I642f0e250835d76288ac42fa18a8dabf2db30047
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66621
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
For size parameter in mapAsync, use wgpu::kWholeMapSize rather than 0 to
indicate using the default size, i.e. remaining buffer size after
offset. Using size=0 is still available but will cause a deprecation
warning.
Bug: dawn:1159
Change-Id: I474d87ecae4a54ceb28d636f883a6233c91f16fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66284
Auto-Submit: Zhaoming Jiang <zhaoming.jiang@intel.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This change adds two arguments depthReadOnly and stencilReadOnly
into RenderBundleEncoderDescriptor in order to follow WebGPU spec.
It also adds one more validation rule: depthReadOnly must be equal
to stencilReadOnly if depthStencilFormat has both depth and stencil
aspects in RenderBundleEncoderDescriptor. We have already had a
similar validation rule in RenderPassDepthStencilAttachment in
RenderPassDescriptor.
Bug: dawn:485
Change-Id: I32c45b2bd90c7041aa881d8589720a9146d6ac7e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66501
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
If you have a fresh checkout of CTS and miss this step, you get errors
when running the CTS scripts that are hard to figure out.
Change-Id: I12c63455a165d2c37beae75fedd34a4da6c30f28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66640
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
This is a reland of ecbdd8fbe7
It prefixes the DEPS variables with "dawn_". Because they are globals,
they may collide with other variables in other projects.
Original change's description:
> Add deps to enable performing the cmake build of dawn_node on CQ
>
> (and the cmake build of Dawn in general)
>
> Bug: dawn:688
> Change-Id: If7c037a03d237372739aed1f5dc78bffb7975a24
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65603
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
Bug: dawn:688
Change-Id: I81ec3d5298efea54b1417ff58569cf1c615ea372
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66400
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
depthWrite/stencilWrite in DepthStencilState in RenderPipeline
should be compatible with depthReadOnly/stencilReadOnly in
DepthStencilAttachment in RenderPass. Otherwise, you may need
to generate validation errors.
Bug: dawn:485
Change-Id: I7b541056dafc4dee4eb31f4cefbac48c0ffc4b18
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66240
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch fixes a compilation error after the CL "Avoid redundant
creation of ComputePipelineBase in GetCachedComputePipeline" is
landed after "Adds destroy handling for BindGroupLayout without
new backend changes yet" is merged into upstream.
BUG=dawn:529
Change-Id: I5dcb2370093a96703ceb0618f3590364b4eff382
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66283
Reviewed-by: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch removes a redundant creation of ComputePipelineBase object
in GetCachedComputePipeline(). Instead, we directly compute the blueprint
hash from the uninitialized backend compute pipeline object.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I9b982664aa140ab385418a202270b9988cfcb9f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66221
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
- Start tracking BindGroupLayout objects at construction
- Utilizes untrack tag for blueprint layouts for caching purposes
- Adds dawn native test file for testing utilities that require static dawn native lib
- Adds testing macros and mocks for simple sanity unit testing
Bug: dawn:628
Change-Id: Ic85b60e9574e67cc5fc1804cc5300cd1f3a0f6fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65862
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
- Renames some of the Device functions to be consistent with documentation
- Reverts change in https://dawn-review.googlesource.com/c/dawn/+/64820 for overloading mDevice == nullptr to determine if objects are alive because device is needed for error propagation. Instead, use list existence to determine if objects are alive
- Updates destroy api to return bool upwards in case we need to further process the extending objects
- Adds tracking functions in ObjectBase
- Adds final tag to all backend Device implementations
- Adds MoveInto LinkedList support to move list elements in O(1)
Bug: dawn:628
Change-Id: Iff70f4f7d55f46ee52d1bd0e02e3671819f2eed4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65861
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Bug: dawn:628
Change-Id: I1250ffe303155004572c2476ec357daa78b7bb3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65860
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
They were previously disabled due to some new Metal alignement
constraint that has now been upstreamed in WebGPU and implemented in
Dawn. So we can reenable them.
Bug: dawn:940
Change-Id: I96e5ac57342fbc0cab09989fe90a6bc4c8f9f40d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66120
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
The second parameter of NSMakeRange(NSUInteger loc, NSUInteger len) is
length, here we just need to pass queryCount.
Bug: dawn:434
Change-Id: I3dfa82e523310258c81c45c4e1c3af80a3df8704
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
`a && b` only evaluates b if a is true. `a & b` always evaluates
both a and b. If a and b are of type bool, `&&` is usually what you
want, so clang now warns on `&` where both arguments are of type bool.
From what I can tell, in Dawn it wasn't important if we evaluate both
branches or not in the places where this fired, so I went with `&&`
everywhere.
Bug: chromium:1255745
Change-Id: Ifa196a7150d5bdfb8527fe8b6f40d7e2e957d609
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66200
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
BoundArrayAccessors is an alias to Robustness, and removing it from
Tint will make code easier to read and search.
BUG=tint:1212
Change-Id: I31aabfcef396290178eff6ea8db7e5bb70b031ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/66061
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Provides a place to put error messages.
Helps actually figure out when an overload doesn't match, a dictionary is missing a field, etc.
Bug: dawn:1143
Change-Id: Ibca177f9f42676061511d27898a5c522d1e6cd8f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65721
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
If the IDL provides a default value for a interface method parameter, then use that default value if no argument is provided.
Removes a bunch of std::optional<T>'s from the C++ interfaces, and simplifies binding implementations.
Also fix some defaults of buffer size from 0 to kWholeSize. This was partially done in an earlier CL, but it seems I missed a few.
Bug: dawn:1143
Change-Id: Ifc1bb29a5e7ead42dd015d2333c743165f2459a6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65663
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Check the result of std::getenv() before constructing a std::string.
std::string cannot be constructed with nullptr.
Fix ambiguous overload resolution of std::tolower(), by wrapping it in a
lambda that explicitly takes a 'char' argument.
Bug: dawn:1123
Change-Id: I8a44524a6c0e71f7d2a49a5a9f730115c32df577
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65960
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Running with too many threads can cause device initialization failures.
Bug: dawn:1143
Change-Id: Ie8010ab7a95e88f560dc14ed8b96919313218062
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65662
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Makes them appear in Object methods like length().
Fixes a number of webgpu:idl,constants,flags tests.
Bug: dawn:1123
Change-Id: I2f1baf9c3c51915ce0b0a5dc392cf86aac761676
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65661
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Includes info on how to build, known issues, remaining work.
Bug: dawn:1123
Change-Id: I0a1fe827a1aba06eea7e3574de4a7d1e0fd3f0ab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65161
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Updates all validation messages in CommandValidation.cpp to give them
better contextual information.
Bug: dawn:563
Change-Id: I6af5b0a0d99218c09ef564039218b3a7fb6a74db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65607
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This reverts commit ecbdd8fbe7.
Reason for revert: https://ci.chromium.org/ui/p/chrome/builders/official.infra/chrome-branch/977/overview
AssertionError: dep:src/third_party/dawn key:cmake_version value:version:3.13.5 != version:3.16.1
Original change's description:
> Add deps to enable performing the cmake build of dawn_node on CQ
>
> (and the cmake build of Dawn in general)
>
> Bug: dawn:688
> Change-Id: If7c037a03d237372739aed1f5dc78bffb7975a24
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65603
> Reviewed-by: Ben Clayton <bclayton@google.com>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:688, chromium:1255538
Change-Id: I4c44b511c6fc3ff177785adcaad5f01d2857a2c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65822
Reviewed-by: Sven Zheng <svenzheng@chromium.org>
Reviewed-by: Leonard Grey <lgrey@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Updates all validation messages in CommandEncoder.cpp to give them
better contextual information.
Bug: dawn:563
Change-Id: I0aa2063c4805225a5124fdd07e350ee1a74a5f3c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65609
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This is a reland of a57c1db878
in current Dawn implementation RenderPipelineGL and ComputePipelineGL
will be destroyed before calling their initialize() function when we
can find a proper pipeline object in the front-end cache, so mProgram
may not be assigned to a valid GL program ID when the destructor of
PipelineGL is called.
In this CL we always initialize mProgram to 0 in the constructor of
PipelineGL so that it won't be a garbage value in the destructor of
PipelineGL (0 is safe for glDeleteProgram() according to OpenGL SPEC).
Original change's description:
> OpenGL: delete shaders and pipelines when they are not used any longer
>
> Previously on OpenGL backend the GL pipelines and shaders are never
> deleted. With this patch the GL pipelines and shaders will be able to
> be destroyed correctly after they are not needed any longer.
>
> BUG=dawn:529
>
> Change-Id: I4f7f22c7b536825363fe1ecc0f5ffd1bb86fd774
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65140
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Stephen White <senorblanco@chromium.org>
> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Bug: dawn:529
Change-Id: Ie04ab069b9d26658f2b0d1b070d86bb650f3c878
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65486
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This CL renames "extension" to "feature" to follow WebGPU. It still
supports both. A future Chromium CL will pick this change, then all
"extension" occurrences will be removed.
Change-Id: I070e32d7ae042f9b846df01f200b39f6741a0a14
Bug: dawn:1149
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65664
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
It wasn't implemented because Discard wasn't implemented for a long
time.
Bug: dawn:1151
Change-Id: Ie26559dd65a2c97a32df418521ca93c1021dd837
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65720
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Fuzzer discovered that it was possible to send invalid IndexFormats
to SetIndexBuffer and cause IndexFormatSize to hit an UNREACHABLE().
This validates that the passed format is part of the enum before
doing any further operations on it.
Bug: 1254571
Change-Id: I1e4075f8d26afdb8e4bcae3cfc72e6219ff28f78
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65610
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Updates all validation messages in Texture.cpp to give them
better contextual information.
Bug: dawn:563
Change-Id: Ibae48b6842c80253c82b63989d08dac95c4b5759
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65602
Commit-Queue: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This required adding a version of device.ConsumedError that takes a
MaybeError and a formatted string context.
Also removes an unused method.
Bug: dawn:563
Change-Id: I7a2139cc47945d1f29bdfe926db3c932bf17c6d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65564
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@google.com>
Also simplifies the call graph of the validation a bit (some functions
were called to do a single check, some others were doing redundant
checks).
Bug: dawn:563
Change-Id: I0c9c09832139ff33055292e6bfa22b3ef6719819
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65563
Reviewed-by: Brandon Jones <bajones@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
(and the cmake build of Dawn in general)
Bug: dawn:688
Change-Id: If7c037a03d237372739aed1f5dc78bffb7975a24
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65603
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This change refactors dawn-defined buffer and texture usages.
It groups buffer usages together, and groups texture usages
together, in order to avoid values conflict. It also removes
kReadOnlyStorageTexture because its definition has already been
removed.
Bug: dawn:485
Change-Id: I8c772ebadd3d276905fbcdb3283f0d5d89f74dd6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65680
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Also adds a label to ExternalTextureDescriptor to match the pattern of
all other descriptors.
Also adds missing validation that the planes must not be multisampled
(with a test) and fixes the validation unittests to not leak state from
one test to another (so they test exactly what they need to).
Bug: dawn:563
Change-Id: I88a4d7a859e67e5af85efd5ba16572c9014df6ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65562
Reviewed-by: Brandon Jones <bajones@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Used by a number of CTS tests (webgpu:idl,constants,flags:*)
Bug: dawn:1143
Change-Id: Idd76c35a4debf54d5c53df11f59419de90f90162
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65660
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Updates all validation messages in Adapter.cpp to give them better
contextual information.
Bug: dawn:563
Change-Id: I71381f56b51ef69c3064af837fe20d6afa7ce271
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65581
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@google.com>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
If a depth/stencil texture view is used as sampled texture and
read-only render attachment in the same render pass, it should be fine.
Because both usages are readonly. However, Dawn doesn't distinguish
read-only render attachment from writeable render attachment. So, this
situation is thought to be invalid.
This change fixes the issue and allows these read-only usages in one
pass, with a validation test for verification.
Bug: dawn:485
Change-Id: I0df5a4209651cddd6122487d96b1810717e4eb22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65485
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Generate exported node symbols via a generated .lib file, and link against this, so the linker knows these are declared by node.exe.
Bug: dawn:1123
Change-Id: Id8c9c5de6bf5e6b925f26e2a1dbb85dd1e40668c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65565
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Generate exported node symbol stubs with weak linking. This keeps the linker happy, and these are replaced by the real node symbols at runtime.
Fix clang warnings.
Have WGPUBufferMapAsyncStatus_DestroyedBeforeCallback reject the promise with an AbortError.
Bug: dawn:1123
Change-Id: I503f889b027b6cfc0e458abf434d4888990fb67b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65560
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
A silly typo was causing a large number of blending tests to fail.
Bug: dawn:1123
Change-Id: Ib6423ad6c58baab2db15034633f95bab7b0c7912
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65401
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Have UNIMPLEMENTED() take a variadic set of message arguments which are printed with the fatal error message.
Bug: dawn:1123
Change-Id: Idfa7ca71a8c59565434651a310d9e049349bb227
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
In review, the variadic overload of Write() was changed, which adjusted the overload resolution priorities W.R.T the single argument overload:
https://dawn-review.googlesource.com/c/dawn/+/64747/3..7/src/dawn_node/utils/Debug.h#b96
This caused the variadic overload to be picked for the single-argument case, leading to stack overflows when calling Write().
Fixed by using perfect forwarding for the single argument case of Write().
Bug: dawn:1123
Change-Id: I21ab290e9c2e4b92ab472552f809484fb7426a45
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65244
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Updates all validation messages in RenderPipeline.cpp to give them
better contextual information.
Bug: dawn:563
Change-Id: Iccf2714c781c2e1d52eaf00bf81f1d5643635cf7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65484
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This is the node plugin entrypoint
Bug: dawn:1123
Change-Id: I4a48b047482a7c9f1a0f10cc2a5a02721d103b8a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64940
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This patch removes a redundant creation of RenderPipelineBase object
in GetCachedRenderPipeline(). Instead, we directly compute the blueprint
hash from the uninitialized backend render pipeline object.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I3c7a2acfc01ab9e1e631793030ea06c9ae908aa2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65000
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Previously on OpenGL backend the GL pipelines and shaders are never
deleted. With this patch the GL pipelines and shaders will be able to
be destroyed correctly after they are not needed any longer.
BUG=dawn:529
Change-Id: I4f7f22c7b536825363fe1ecc0f5ffd1bb86fd774
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Add vulkan backend implementations and tests.
Disabled some tests that fail due to tint missing
features and issues.
Bug: dawn:1041, tint:1155
Change-Id: Iac161317450cff59627e08b1228bffde4cef71da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64981
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The conversion should only pass if the element type matches.
Bug: dawn:1123
Change-Id: I700a445e8d281afdc36d1b6f9be73767ca89d4ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65240
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Fixes an ASSERT when a render pass is started while another pass is
already current.
Bug: chromium:1253090
Change-Id: I085c1de225f9ba30a7f368fad3b1d8a97ed92c63
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65241
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Adds generated headers in dawn_native for object type tracking similar to that used in dawn_wire. Splits ObjectBase into ObjectBase and ApiObjectBase for clearly differentiation, and adds virtual function to identify the type of ApiObjects. Updates error generation to utilize new object typing for generating messages.
Bug: dawn:628, dawn:840, dawn:563
Change-Id: Ia4f831fcbfb29a70ed5a35d47ed622921e744c84
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64820
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
All UNIMPLEMENTED()s are TODO.
Bug: dawn:1123
Change-Id: Ie51b807d8a2a2ba376416d77de383dd627d04a07
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64908
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Nothing includes these yet.
Bug: dawn:1123
Change-Id: Ia2178d4bc9bf2c8f8f586493568b2864063d3fc7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64906
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Used to poll a wgpu::Device with calls to Tick() while there are asynchronous tasks in flight.
Bug: dawn:1123
Change-Id: Ieee75b983df836a6df09ae4ff81f7382f4be4995
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64905
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Breaking change, but it should only require small changes in any project
that relies on it, so just doing this instead of a two-stage deprecation.
Will require a manual roll into (at least) Chromium.
Bug: dawn:1080, chromium:1253721
Change-Id: I6699e0629c3b2fe63e7f9d5ba0a928f00316a588
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64520
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is enough to compile the interop code. This doesn't do anything as we need to emit the NodeJS module entry point, and actually hook up the interop to the Dawn bindings.
This comes next.
Bug: dawn:1123
Change-Id: I754b4bcb0532c8446031622d8e8e64e2faaff585
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64903
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Templates used to generate the NodeJS interop classes for the WebGPU IDL.
Also includes a stub `Browser.idl` file that provides stub definitions for browser IDL declarations referenced by the WebGPU IDL.
Bug: dawn:1123
Change-Id: I4067cb186f63436a502c3516a879ed1c5cd30731
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64902
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Core hand-written interop classes, which the template-generated code makes heavy use of.
There's currently no build rules for these files.
These will come in a followup change.
Bug: dawn:1123
Change-Id: Id56f96533070acc8ee581d6f44f83b5374662215
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64901
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
For size parameter in setIndexBuffer and setVertexBuffer, use
wgpu::kWholeSize rather than 0 to indicate using the default
size, i.e. remaining buffer size after offset. Using size=0 is still
avaliable but will cause a deprecation warning.
Bug: dawn:1058
Change-Id: I4c4f6ca6fc7346c225815bdcd607fed110ce2b9a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65020
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Multiple groups of limits may be defined via macros.
ApplyLimitTiers degrades the incoming limits such that
each limit value within a group is clamped to the
best possible tier. A device may be in Tier 2 for one
limit group, but Tier 1 for another limit group.
Also adds equality operators to dawn_native generated structs
for comparison of expected limits in the test.
Bug: dawn:685
Change-Id: Ibdf947f2ccd44f70d66f48bed472ff5681230633
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64720
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Contains macros used for logging and marking code as unimplemented.
Bug: dawn:1123
Change-Id: I861348b0cc53eb1dc80ed5b477ab33af45d1acd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64747
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
A go WebIDL parser and template generator tool.
Will be used to generate the NodeJS bindings for Dawn.
We may wish to reimplement this in Python some day. Not today.
Bug: dawn:1123
Change-Id: I31c868efcd8ba00084a6c25a1fc0e3ad774dfa53
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64746
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Since spirv_to_dxil does not generate HLSL, to support pipeline caching,
we need to generate a cache key from the WGSL instead.
A new type, ShaderCompilationRequest, is added to isolate the
compilation inputs to help ensure that the cache key contains all
relevant information.
Bug: dawn:1103
Change-Id: Ic2f09326dc3ac254cecf35098dcfe95aa396796f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61160
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>
This patch implements the asynchronous path of creating render
pipeline on Vulkan backend. This patch also makes the access to
the member mCache of Vulkan::RenderPassCache thread-safe as it
can be accessed in different threads simultaneously.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I74c799935ef46405275585cb5dccfcb552a48aa4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64840
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Begin's using Abseil's string formatting and new error context tracking
to dramatically improve the usefulness of validation messages. In
addition to putting in place several utilities to enable better messages
this change also updates the BindGroup buffers bindings validation
messages as a test for the new mechanisms.
Bug: dawn:563
Change-Id: Ie5bf5ffb24a9013cebd67745dc4172dfbc901e9a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64201
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Change-Id: Ie6be1301c3f2f9877a9dfb04ab5025559b90d926
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64741
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Every render pass which invokes DrawIndexedIndirect, either directly or
through a RenderBundle execution, is now preceded immediately by at
least one validation pass.
All indirect buffer offests used with DII are validated, and their
validated values are copied into a separate scratch buffer (or zeroed
out there, in the case of validation failure). All encoded DII commands
are rewritten to use the validated parameters instead of the original
ones.
Bug: dawn:809
Change-Id: I5eead937f19536f84f89e2c8e6fed7f18f0aee9f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63461
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Adds some unittests for Limits to dawn_unittests.
Statically links dawn_unittests against dawn_native
to access the internals. Additional tests for dawn_native
can now be added to dawn_unittests as well.
Bug: dawn:685, dawn:1105
Change-Id: I1e67c2f673e43d0e07693f3a50920129f135440e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64780
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch removes the prefix 'm' on the local variable 'mCreateInfo'
in Vulkan::RenderPipeline::ConputeVertexInputDesc() in case we may
misunderstand that it is a member of Vulkan::RenderPipeline.
BUG=dawn:529
Change-Id: Ifa3302a58a88f9628f09787977b5157fb55f9c55
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64841
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
From macOS 11+, Metal requires the minimum buffer offset alignment to be
256 bytes. We have updated the destinationOffset alignment of
resolveQuerySet to 256 in SPEC. This PR is changing the implementation.
Bug: dawn:940
Change-Id: Ie3c69d6a90adb76038dbac95ae2158a38da583f3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63762
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Long term, ideally, these would be fixed and this flag can be removed.
For now, this is an expedient way to allow enabling -Wshadow in
Chromium.
Bug: chromium:794619
Change-Id: Idd3b6eaf61cc6e2a32eecf94d6cc6a41afb5f4eb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64761
Auto-Submit: Peter Kasting <pkasting@google.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This is a simple RefCounted holder of a Buffer ref and offset. Encoded
commands can store a ref to this object instead of directly storing an
inline Buffer ref and offset, allowing other commands to dynamically
patch in a different buffer+offset as needed, in a memory-safe way;
as opposed to e.g. retaining an unmanaged pointer to the encoded
command itself and modifying it in-place.
Validation commands will use this to rewrite buffer references in
encoded commands, so that they execute over validated inputs rather
than over their original client-provided inputs.
No net functional changes in this CL, just some groundwork for indirect
draw/dispatch validation.
Bug: dawn:809
Change-Id: I0570521a610fe3ea08190a525b4904749d7b7f24
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64420
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
This command copies data from host memory into a GPU buffer. It's
analogous to Queue::WriteBuffer, but executed in the context of a
command buffer, sequenced with other encoded commands. This is useful
for supporting a notion of a shared scratch buffer, with a single
allocation whose contents may need to be overwritten with new data
before each pass that uses it.
Bug: dawn:809
Change-Id: If58d49c52a41127e2980dd626fd687eb1c91fe28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64001
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
Generates the exact upstream headers, except for a few Dawn and upstream
changes that have landed since I started this CL, and the "_TODO"s about
extensibility of compilation info/message.
Bug: dawn:1080
Change-Id: I2a6128a3e78cfef7b9f8feae84b7c7c207eb2826
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62861
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Adds a "tag" system so that entries of dawn.json can be conditionally
emitted in different configurations. With a few more dawn.json changes,
this will enable generating the exact upstream header.
Bug: dawn:1080
Change-Id: I3506dadd485e31786578a3a64c3603c964c5354f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62580
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This is a minor refactor that runs transform/FirstIndexOffset in a
separate pass, outside of TranslateToHLSL. It should be functionally the
same as what currently exists.
This is to prepare for creating pipeline cache keys based on the WGSL.
Bug: dawn:1103
Change-Id: Ifc516079bafe2449d422f8bd8485b2459cd3d181
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63224
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>
Allows us to match the upstream header's format list more closely.
Bug: dawn:570
Change-Id: Iee5c6c0e45ab81fa335c3d8e63d8b2c5c455d26c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64522
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Does nothing right now since Dawn always exposes the default limits.
In the future, setting useTieredLimits to true will bucket the
exposed adapter limits to minimize fingerprinting surface.
Disabled by default for native applications, but Chrome will always
enable it.
Bug: dawn:685
Change-Id: I0ecfefc93f7a554f8f8be7906cef9fa8d4745ac2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64524
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Note that all validation rules for RenderPassDescriptor (including
color attachments and depth/stencil attachemt) in the spec have
already been covered in the validation tests.
Bug: dawn:485
Change-Id: I8741b53677876515fe0f90f5db1e05728ef1a452
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64521
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This patch implements the asynchronous path of CreateRenderPipelineAsync
on D3D12 backend.
1. Call the constructor of dawn_native::d3d12::RenderPipeline in main
thread.
2. Execute dawn_native::RenderPipelineBase::Initialize() (a virtual function)
asynchronously.
3. Ensure every operation in dawn_native::d3d12::RenderPipeline::Initialize()
is thread-safe.
4. Save all the return values (pipeline object or error message, userdata, etc)
in a CreateRenderPipelineAsyncWaitableCallbackTask object and insert this
callback task into CallbackTaskManager.
5. In Callback.Finish():
- Insert the pipeline object into the pipeline cache if necessary
- Call WGPUCreateRenderPipelineAsyncCallback
This patch also removes FlatRenderPipelineDescriptor as it is not needed
right now.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I7fd30339ab7bea599c483dea4bd1100359982409
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64440
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This patch disables the workaround about the T2T copy issue (the Toggle
UseTempBufferInSmallFormatTextureToTextureCopyFromGreaterToLessMipLevel)
on the latest Intel Gen9 and Gen9.5 D3D driver (30.0.100.9864) which
contains the fix for this issue.
BUG=chromium:1161355
TEST=dawn_end2end_tests
Change-Id: I6e62b95d1cb92358482356901c541df02998a764
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64280
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This reverts commit 020d69905e.
Reason for revert: Causing Dawn Skia roll build fails
https://task-scheduler.skia.org/job/AZXXBm9h9ozj3kKiRJM5
Original change's description:
> Added Abseil as a third-party dependency
>
> Using the version in the Chromium repo in order to make use of the .gn
> files it contains.
>
> Doing so also appears to require us to switch where we pull googletest
> from so that the directory structure matches what the Abseil build
> config expects. Fortunately this doesn't seem to cause issues in our
> tests.
>
> Bug: dawn:563
> Change-Id: I55831ad33f282b3d8b03b67826fd2776e5602d89
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63780
> Reviewed-by: Austin Eng <enga@chromium.org>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
> Auto-Submit: Brandon Jones <bajones@chromium.org>
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:563
Change-Id: I0fc4e5fc73ab9b0887591135ec01adde990edd6f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64361
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
This introduces CommandAllocator::AcquireCommandBlocks, which accepts a
vector of CommandAllocators and flattens them into a single iterable
sequence of commands. To support this, CommandAllocator is made movable.
Bug: dawn:809
Change-Id: I3984c243e4bd74568eccba1a8a58ec26324c8ffa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63822
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Tint passes threadgroup memory in MSL as entrypoint arguments since
threadgroup memory at the module scope cannot be default initialized.
MSL lacks default constructors for matrices in threadgroup memory.
Bug: dawn:1110
Change-Id: I7462fa448c6ebdb3cc4dc24bd5ff0a99287cdba0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64240
Reviewed-by: James Price <jrprice@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
The follow up CL will remove 0.
Bug: dawn:1026
Change-Id: Ida62f8d8b0dd8f9722e40f3f95366d3db0c7ab52
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64164
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Support vertex-only render pipeline on D3D12, Vulkan, Metal, OpenGL
and OpenGL ES backends. Related validation tests and end to end tests
are also implemented.
Bug: dawn:136
Change-Id: If266fd441c1d39ccd940ea26b74b405f8abb351a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63080
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This patch removes the parameter "descriptor" from the function
RenderPipeline::Initialize() on D3D12, Metal and Vulkan backends as
a preparation of creating render pipeline asynchronously.
BUG=dawn:529
Change-Id: I6bdd74ad0af6a1924fac3703908cd5f66b75994b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64163
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch removes the parameter "vertexState" from TranslateToMSL
and ShaderModule::CreateFunction as we have already been able to
get the vertex states from the RenderPipelineBase object.
BUG=dawn:529
Change-Id: I2971438bfd5e0f3fbea900e1f06c1b33349571da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Using the version in the Chromium repo in order to make use of the .gn
files it contains.
Doing so also appears to require us to switch where we pull googletest
from so that the directory structure matches what the Abseil build
config expects. Fortunately this doesn't seem to cause issues in our
tests.
Bug: dawn:563
Change-Id: I55831ad33f282b3d8b03b67826fd2776e5602d89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63780
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
This CL adds device ID and vendor ID to device properties so that WebGPU
can access it to help populate GPUAdapter.name.
Bug: chromium:1231163
Change-Id: I460e5a72ffba350f88d2649789a61eaea9670135
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64180
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
This seperates the undefined 'arrayLayerCount' from 0 to
WGPU_ARRAY_LAYER_COUNT_UNDEFINED. So 0 arrayLayerCount is treated
as a validation error.
Bug: dawn:1026
Change-Id: I7b4ae024b02ac0d2aa260b2a8c64b09bd967db87
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63660
Reviewed-by: Jie A Chen <jie.a.chen@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Suppresses LoadOpClearIntegerFormatsToLargeValues on Mac 11.5 with
Metal on Intel GPUs.
Bug: dawn:1109
Change-Id: Ia4316ee00ad790752fa3b5d1778d885c5eb3a188
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64160
Commit-Queue: Brian Sheedy <bsheedy@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Adds a way to store the limits on the Adapter and the
Device. For now, adapter limits are always the default
limits, and device limits are stored but not used.
This CL also adds usage of an ErrorObjectIdResolver and
Provider in the WGPUDeviceProperties serialization and
deserialization helpers. Serializing/deserializing this
struct should never have objects.
Bug: dawn:685
Change-Id: I1479b4407b0f9ec9f9b2bff62cad7caa693c99d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63983
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Adds a supression to the failing test.
BUG=dawn:1106
Change-Id: Ib0cfd49b6d1af59c60d7bc4f2e3e1bec5ae80601
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64062
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
This patch removes the parameter "descriptor" in the function
ComputePipeline::Initialize() so that we don't need to define
FlatComputePipelineDescriptor right now.
For render pipeline, as descriptor->vertex is being used for vertex
pulling (passed into vertexModule->CreateFunction()), we will first
refactor the related code in vertex pulling before removing the
parameter "descriptor" in the function RenderPipeline::Initialize().
BUG=dawn:529
Change-Id: Ib172ac0c76fa24070e78c0e57c3262acad9399b9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Tint's HLSL writer can now map sets to spaces, so we can use a dedicated
space and register to store the index offset constants. Currently, we
use the first space (0) and find a free unused register.
Bug: dawn:1103
Change-Id: Ie1fe95ec314097baf0e0952a0c78222cad493c95
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63223
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>
Adds a basic RequestDevice method to the adapter, only in
dawn_native. We will revisit this when we implement adapters
in dawn_wire.
RequestDevice allows us to have tests of the limit bounds
because it receives a callback which can return status codes
and error messages.
Bug: dawn:685
Change-Id: I7a68922b078c6a436f49a16346cb41fb9df9cfee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63982
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Chained structs *may* contain objects which means
deserialization may need an ObjectIdResolver.
However, in practice, we never need to send chained
structs from the server to the client that contain objects for
a valid command.
The one upcoming need for chained server->client structs is to
serialize limit structs.
Because limit structs never need objects, we provide a dummy
implementation of the ObjectIdResolver which always yields an error.
An analogous change is done for ObjectIdProvider.
These classes will be used in a follow-up CL.
Bug: dawn:685
Change-Id: I1c0f3f2d080377f2e1a77bc6e896f24d3d9ab931
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63981
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
- We use Tint unconditionally so binding reflection is now correct.
- WGSL disallows textureSampleCompare in compute shaders and is not
likely to change.
- We now support reading back stencil in tests.
Bug: dawn:439, dawn:667, dawn:216, dawn:704
Change-Id: I7ba0026bb906ce985abb495581b56977da7be2da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63680
Reviewed-by: Brandon Jones <bajones@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch implements the extension "depth_clamp" on Vulkan, which
we need to test if we can correctly record "PrimitiveDepthClampingState"
in FlatRenderPipelineDescriptor - Currently FlatRenderPipelineDescriptor
fails to record this because we incorrectly ignore all the members in
"nextInChain".
BUG=dawn:529, dawn:716
TEST=dawn_end2end_tests
Change-Id: Iec407245a3f37d10a3d1428b0612f0e18e80c616
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63820
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
We only remap bindings for the target entry point, so we need to strip
all other entry points to avoid generating invalid bindings for them.
Bug: tint:1170
Change-Id: Ia1a73601e8d620341fb4f7170dfa856632a04245
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63880
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This patch implements the struct FlatRenderPipelineDescriptor to
save all the pointer members of RenderPipelineDescriptor in
CreateRenderPipelineAsync so that the render pipeline descriptor
is always valid when the render pipeline is created asynchronously.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I99e06581f84c52d484f877ba29e8cc1ca50d68b2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63368
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
When creating a new render pass in D3D12, call the OMSetStencilRef
to set the stencil reference value to zero.
Bug: dawn:1097
Change-Id: I5dd94691b1b354b601c06a02d3d5fa619d8b58ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63360
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
The end to end texture tests with the binary information for the textures are generated using the open source astc-encoder tool.
Also: Refactors end2end compressed texture tests to allow for non-4x4 texel compression formats (ASTC formats are not all 4x4).
Bug: dawn:955
Change-Id: I5311a5aa7bd017de72300bf7c87fba6c869b1db5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63121
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This patch fixes a use-after-free issue in FlatComputePipelineDescriptor
by always making its pointer members point to its own members.
BUG=dawn:529, chromium:1246158, chromium:1246748
TEST=dawn_end2end_tests
Change-Id: I49b98357444edcdb1b225e961d1e4d6e5b11e978
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63366
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
ID2D12CommandQueue::GetTimestampFrequency returns an error HRESULT
when there are bugs in Windows container and vGPU implementations.
To workaround, we check the return value during adapter creation
and disable the timestamp query extension upon failure.
Device creation is still allowed to succeed when the method returns
failure.
Change-Id: Ie71f8712fc9f4f50e4ce26ecfec929b5b1a126d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63225
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
This was missed in a previous CL.
Bug: dawn:1092
Change-Id: I1915371c6a049d8c3b503c72194e568eb7fde95c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63384
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Fixes a crash found while fuzzing by returning early when SetDebugName
is called with an empty D3D12/Vulkan object or when the device is lost.
Adds tests.
Bug: chromium:1245720
Change-Id: Ie443f690cf5635d017295a13e21c33dd2e97dc46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63363
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
Adds labels for Pipelines and ShaderModule. Includes tests. Backend
functionality is implemented for Pipelines, and completed to best effort
for ShaderModule.
Bug: dawn:840
Change-Id: I55024a83f66d9fc2fc0e8b79e4b9a7ebc6f3cf1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62860
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
When ErrorInjector injects a device loss, it is fake and commands are
still running on the device and we need to wait for them before we start
to deallocate stuff.
When handling the error in the frontend, call WaitForIdleForDestruction
so that all the commands are finished. In the Vulkan backend
WaitForIdleForDestruction have a special code path to no allow error
injection on vkWaitForFences in this specific case, as double error
injection would make the problem appear again.
Bug: chromium:1244408
Change-Id: I710fccbb40b4b14d84f5787be5e002b469e6e2e3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63101
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
The D3D12 and Metal backends no longer support any other
shading language translator, so the suffix is superfluous.
Bug: dawn:1099
Change-Id: I6a1a249a80d59dbf9cabf5d4ea917f852745e78e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63400
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This patch implements the struct FlatComputePipelineDescriptor to
save all the pointer members of ComputePipelineDescriptor in
CreateComputePipelineAsyncTask to better simplify the orignal code
path.
We will also implement FlatRenderPipelineDescriptor in the next
patch, which is more important for CreateRenderPipelineAsync as
there are many more pointer members in RenderPipelineDescriptor
than those in ComputePipelineDescriptor.
BUG=dawn:529
Change-Id: I69ab0dc898f0a6dcc9886d827729e6fd7308bd2d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63280
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Prevents bind group layouts created by a default pipeline layout from
being reusable with any other pipelines or layouts, as detailed in
https://github.com/gpuweb/gpuweb/pull/2068
Change-Id: Ic398eb6c6e089ac63ce6650f125dd20a9dfc8862
Bug: dawn:1094
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63220
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This helper helps ensure correct handling of request maps by:
- Forcing erasing to happen immediately when acquiring a request. This
prevents some cases of iterator invalidation if we later change the
container type.
- Implements correct closure of all callbacks, including if the
callbacks themselves add more callbacks.
Bug: dawn:1092
Change-Id: Ia0ba9f050bbf3f0dee846f537910523bebb3bf1b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63003
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Some tests to make sure new requests inside user callback
is okay.
Bug: dawn:1091
Change-Id: I4c53d7fb6637f77e5af6fd0a78d879a2431d4ac8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63041
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
This patch removes the redundant code in CreateRenderPipeline so
that we can better share the common code in both CreateRenderPipeline
and CreateRenderPipelineAsync.
BUG=dawn:529
Change-Id: Ic2a7781525e5594da3d51a42b231df63c0c09339
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62880
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
The end to end texture tests with the binary information for the textures are generated with a combination of the open source etc2comp tool and manual crafting of the data based on the specification in the Kronos Data Format Specifications (https://www.khronos.org/registry/DataFormat/specs/1.1/dataformat.1.1.pdf) for the compressed formats.
Also: Refactors end2end compressed texture tests and some utilities so that we can use parameterized tests for easier new format additions.
Bug: dawn:955
Change-Id: I91686f26a693a85cb076ef0eca3029111a64c50f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62740
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
There might still be fences and commands marked as in-flight in
ShutdownImpl if the device was lost. Delete them anyway because since
the device was lost, it means that all objects are no longer in the
"pending" state (from the Vulkan spec point of view)
Bug: chromium:1244454
Change-Id: I905a9a8e5174591bf93e3cdac3cdcb349d75a581
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63102
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Currently we use gpu family to determine whether a query extension is
supported. The official document provides a way to check the feature
support by GPU counter. Update checking following the official guide.
Bug: dawn:996
Change-Id: I09cf51ed8a8209642eed71c9e4592f6eab82bfa5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60360
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
These are needed for the VulkanDeviceInfo and VulkanFunctions structs.
Change-Id: I1d18e59cd923e5fd702ac65d505793519b3a42b7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62920
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Previously device loss would produce an assert when shutting down where
the frontend though not all commands where finished.
Bug: chromium:1242195
Change-Id: I90fe626b6930859b3fd98b660882fb11b6a9ff8c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62542
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch refactors the implementation of APICreateRenderPipelineAsync
as a preparation of the async path of the creation of render pipeline.
Now the code path of APICreateRenderPipelineAsync() includes the
following 3 parts:
- When an error occurs in the front-end validations, the callback will
be called at once in the main thread.
- When we can find a proper render pipeline object in the cache, the
callback will be called at once in the main thread.
- When we cannot find the proper render pipeline object in the cache,
the newly-created pipeline object, the callback and userdata will be
saved into the CreatePipelineAsyncTracker, and the callback will be
called in device.Tick(). All the logic mentioned in this section has
been put into one function CreateRenderPipelineAsyncImpl(), which will
be overridden by its asynchronous version on all the backends that
support creating pipeline objects asynchronously.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I5706224092588a8c042a952aef2591696072592d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62781
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
In this patch OOB validation in draw and drawIndexed is added for vertex
buffer with zero array stride. For such case, both vertex step and
instance step mode buffer can be validated for both draw and drawIndexed,
as we don't care about actual vertex count and instance count for buffer
with zero array stride.
Related unit test is also added. Also fix the DrawIndexedVertexBufferOOB
unit test.
Bug: dawn:1065
Change-Id: Id302dc0c443dec965347c8ae9f3f4d73aeddc38c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62200
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Compatible Vulkan backends should now enable ETC2/ASTC but no functional
changes because no TextureFormat in ETC2 or ASTC have been added yet.
Bug: dawn:955
Change-Id: I56e8ff73f931a12253fe6d21f3f4b91e3459ef13
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62701
Commit-Queue: Loko Kung <lokokung@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
We should use D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT
if the usage *contains* Uniform usage, not if it is exactly
equal.
Fixed: dawn:1085
Change-Id: I540081e550c9e88efeb08169cecdc40b68d36d14
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62242
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Adds the LabelNotImplemented tag param to the main constructor of
ObjectBase to document objects that still require labels.
Bug: dawn:840
Change-Id: Idd19664e797e4d622401e28e5d278331acefb7a3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62461
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
Adds a generic SetDebugName utility for D3D12 and Vulkan. Passes down
debug label set by user for buffers and textures to be labeled by the
appropriate backend method.
Bug: dawn:840
Change-Id: I7158b537a6e37fdf733645e6830dc33833ee683e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61588
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
Buffer allocations in Dawn may be padded. This padding
could be visible, depending on how the backend
implements robust vertex buffer access. This commit
updates buffer creation to clear all padding bytes
immediately after creation.
It is not counted as a lazy clear.
And, add a test which reads off the end of a padded
vertex buffer to check that the padding bytes are also
initialized.
Also: Update Metal buffers to always allocate enough
space for Tint's vertex pulling, and pass the full
allocated size to Tint. While writing the test in this
commit, a bug was found where Tint assumes there is at
least 4 bytes in the vertex pulling buffer. The WebGPU
API currently allows zero-sized bindings, so Dawn needs
to always allocate enough space for one element.
Also: Update Vulkan vertex/index buffers to allocate
at least one more byte than requested because
vkCmdSetVertexBuffers and vkCmdSetIndexBuffer disallow
the offset to be equal to the buffer size. We need
at least one more byte to make zero-sized bindings
as the end of the buffer valid.
Lastly: Update helper so that a T2B copy of a single
row that touches all bytes in a buffer updates the
buffer state to be fully initialized. This is a small
optimization that is necessary to write the test.
Bug: dawn:837
Change-Id: I829f4764509c4ec784c5aeaaf40b6dcbd4be6866
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62161
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Currently, the bind group layout tightly packs the shader registers for
each of the sampler and non-sampler descriptors sets. This reduces the
max shader register used and helps targeting shader model 5.0, which has
a relatively low max slot count per resource. It is safe in D3D, since a
shader register collision can be valid if the descriptor types differ.
To support Mesa's SPIR-V to DXIL compiler, we need to avoid possible
collisions between resources' shader registers because it uses SPIR-V as
an intermediate representation (which does not namespace bindings by
type). This change re-works BindGroupLayoutD3D12 to not assume the
resulting shader registers will be tightly packed and group per
descriptor type.
Change-Id: I0bb51106c4683bfe02ce15ecad71716734b7a91f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60764
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>
Currently, Dawn ignores the output of D3D12SerializeRootSignature. This
change adds these error messages to the the CheckHRESULT context.
Change-Id: Ieeb63d7b5408ca1bc9e4ab97d777f764cdf06664
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62163
Commit-Queue: Michael Tang <tangm@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
The only part of mGLEntryPoints actually used is the bindings, so
replace ShaderModuleGL::mGLEntryPoints with mBindings.
This required extracting BindingInfoArray from EntryPointMetadata,
making it visible in the dawn_native namespace.
Remove all non-bindings-related reflection, and MSL-specific checks
and workarounds.
Bug: dawn:1076
Change-Id: I05657c0c89f5d8a2185e55f9ad7c8f81d89a8e60
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/62180
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Removes deprecated path for sampling depth textures with
float/unfilterable-float. Attempting to do so now results in a
validation error.
Bug: dawn:1021
Change-Id: I112f45e7227ab1caaf0d6ed203194295e7022db2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61861
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Maintains a 11on12 resource cache on the external image
to prevent re-creating the wrapped resource then
flushing it per produced texture. To prevent
unbounded growth, a basic cap is used which gets
cleared.
This change fixes signficant CPU time spent in the WebGPU command
decoder for video import workloads and excessive memory overhead
from swap chain buffers.
Fixed: dawn:625
Change-Id: I72c07b02f6ab6877a9f21758650962c895933bf9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51421
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is a reland of 365d40b93a
Original change's description:
> Making D3D12 accept InternalUsageDescriptors
>
> This is a follow up from two previous CLs,
> https://dawn-review.googlesource.com/c/dawn/+/58440
> and
> https://dawn-review.googlesource.com/c/dawn/+/58140
>
> This CL adds in the D3D12Backend the possibility to use Dawn Texture
> Internal Usage Descriptor, and adds a series of tests to validate it.
>
> Change-Id: I94f6b39153b60ec8af61bda22d41a865898da613
> Bug: dawn:1027, dawn:1052
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61520
> Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Bug: dawn:1027, dawn:1052
Change-Id: I0d35cbf4dc1c6dc80e1a5dfb4770a5383ef543fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61840
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
Ensures the mapped staging buffer will
always be locked before setting the label.
Otherwise, setting the label could fail
and leave it unlocked which isn't
allowed.
BUG: chromium:1239112
Change-Id: I738f8d6fc3b20b8c8b51671d77e7014d967ffd52
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61860
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
SpirvUtils.* are now in the dawn_native/opengl/ directory.
Bug: dawn:1067
Change-Id: I9cfb7ee52ec1f4ac321cb03978008843e33f82c6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61680
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
The now-removed SPIRV-Cross path used to always do this, and the
pure Tint-only path never actually validated the SPIRV. Tint
does not run SPIRV-Tools validation on its output, so add in
validation to ensure we don't pass invalid SPIRV to the driver.
The validation can probably eventually be removed when we're more
confident that Tint's SPIRV output is always correct.
Also include various cleanups for old / unused code.
Bug: dawn:1036
Change-Id: Iaab037518965e52edbd1829f6ab6ba2af0e70143
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61589
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Auto-Submit: Austin Eng <enga@chromium.org>
Bug: dawn:1036
Change-Id: Ia60c71558bd2c47a6b7148d86b8dcedfaa79ba89
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61585
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Dawn only reapplies bind groups that have changed on the layout
since the last draw. However, the D3D12 backend was always resetting
the root signature state upon switching pipelines. This led to a
bug where the root signature could be changed and dirtied without
reapplying the dirty bind groups.
Moving application of the root signature state to the same loop
that applies bind groups helps ensure the state stays in sync.
Fixed: dawn:1055
Change-Id: Iae89088560e83f6104c921d42de27c03095d654f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61582
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
This commit adds a getter so that Chromium can check whether an
Adapter would support external images. External images are
necessary to implement the WebGPU swapchain and interop with the
rest of the web platform. We should not expose adapters that
cannot interop with the canvas and other web platform primitives
until WebGPU gains options to request more "limited" adapters.
Bug: dawn:1056
Change-Id: Iff83ac26b0e92dccdd4e29c0d854d9276a4a37bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61580
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Brian Ho <hob@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Since the other backends no longer need it, move all of the
utility functions specific to SPIRV-Cross into the OpenGL backend.
This obviates the need for the DAWN_USE_SPIRV_CROSS define, so remove it.
Bug: dawn:1036
Change-Id: I67bb5a85dc128a6f343d09876046cf559395e05f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61541
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Put all cross-platform code references to Spirv-Cross behind
ifdef DAWN_USE_SPIRV_CROSS. Hide build dependencies behind
dawn_use_spirv_cross, which itself is set from dawn_enable_opengl,
since it is the only backend which is still using SPIRV-Cross.
Bug: dawn:1036
Change-Id: Id61512230b50a32c63827a16fece40d7899968d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61400
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Bug: dawn:1036
Change-Id: If447f93f7a17ecfe73f04605a60893edb00990d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61402
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Older names are kept around as an alias for a while. Unfortunately we
have no mechanism for producing deprecation error messages when they
are used.
Bug: dawn:1035
Change-Id: Ic6716fd526ecbedaa8e7925ab93e3ff32f642d97
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61382
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This patch removes the comment about adding "interpolationType" and
"interpolationSampling" to InterStageVariableInfo as they have already
added before. Sorry that we forgot to remove it in the PR of adding
these two members to InterStageVariableInfo.
BUG=dawn:802
Change-Id: Ib2f3769f2dc1c8152280a28aad77bf90abf76608
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61384
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
If the Adapter failed to create a D3D device, it would
attempt to access it on destruction causing the
process to crash.
Bug: dawn:460
Change-Id: I3f13043e8049cd71806ee54efa92c70e26561580
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61300
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
According to the discussion[1], the sum of all the user-defined
inter-stage component count and all the inter-stage builtin component
count should be no more than MaxInterStageShaderComponents (currently
in Dawn it is always 60).
[1] https://github.com/gpuweb/gpuweb/issues/1962
BUG=dawn:1032
TEST=dawn_unittests
Change-Id: Id5266b72b89c48f5b7073b8307f8f2c0512c8a33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61104
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
If [[point_size]] is not emitted, it is undefined. Set the option for
Tint to explicitly set it to 1.0 when necessary.
Bug: dawn:1059
Change-Id: I27c19e88cda30aef0a8f31b213c58d5bf87feabd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61280
Commit-Queue: Austin Eng <enga@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Bug: chromium:1234680
Change-Id: If8f5c2dc0cdf14bf8a0c713d724b883657bd1463
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61103
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Change-Id: I456b6cc660779175afc73bbef5134fbcf4988ad3
Bug: dawn:1036
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60900
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This CL adds an internal method to copy textures, that will disregard
the need of having CopySrc usage.
This CL adds an intermediate helped method to be used by both
APIContextTextureToTexture and APIContextTextureToTextureInternal.
Fixed: dawn:1052
Change-Id: Icd28e0ef58ecfaa412eefe8c95e41cd2298a9acc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58440
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Juanmi Huertas <juanmihd@chromium.org>
The IsMacOSVersionAtLeast() function is only defined on macOS, but was
being used on all Apple platforms.
Change-Id: Ie5e37fb8e408f424e55795327cca7f2a345bfdfa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61120
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Buffer allocations may need padding based on backend requirements.
GetAllocatedSize returns the size of the buffer actually allocated.
This CL also updates the backends to use GetAllocatedSize for buffer
clearing and barrier operations which should operate over the
entire allocated resource.
Bug: dawn:1011
Change-Id: Ic5233214414fa090725a4f50fff70d6e178494c3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60701
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Fix for crbug.com/dawn/1049, where setting a pipeline without drawing can
prevent bind groups from being applied later. This occurs because the mask
for the pipeline is being saved but not its layout, because the bind
groups are never applied. This changes to only save the mask if the bind
groups are applied (the pipeline is used in a draw or dispatch).
Bug: dawn:1049
Change-Id: I4c7ae1125d1b6a06af90aea49a9dd1e4883f4826
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60740
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
The D3D12 docs say it returns UINT64_MAX if the device was removed
Fixed: dawn:1051
Change-Id: Ide3731e9389bdb4a5a81c9f65aa9bcad1b049446
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60961
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Labels GPU allocations by Dawn resource type so we
can debug GPU memory consumption given traces or
full memory dumps.
BUG=dawn:967
Change-Id: I7eb19b4f2f9dd4c55c9039d39ffec9f09461556f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60620
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Seems harmless, but I'm assuming it was not intentional.
Change-Id: I86875f8bbe5923435b4c02cd224197ec2dc6f3a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60924
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Some Vulkan drivers don't handle multiple entrypoints well.
In addition, SPIRV-Cross translation can be wrong for
shader modules with multiple entrypoints. Always emit a single
SPIR-V entrypoint to workaround these issues.
This allows updating CopyTextureForBrowser to use a single
shader module, and it fixes some tests with multiple
entrypoints.
Fixed: dawn:948, dawn:959, dawn:1013
Change-Id: Ie129a32a54845316d11917331937ca44fba3d347
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60640
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tests are no longer failing.
Fixed: dawn:978
Change-Id: I60f19935bf81e3249c94f0d8b8dcfd7de52e47fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60700
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch implements the inter-stage variable matching rules on
the interpolation attributes ('interpolation type' and
'interpolation sampling'). WebGPU SPEC requires that the interpolation
attributes must match between vertex outputs and fragment inputs with
the same location assignment within the same pipeline.
BUG=dawn:802
TEST=dawn_unittests
Change-Id: Ied38d68f73868c30b0392954683963a801e3f3aa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60160
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Adds support for processing texture_depth_multisampled_2d bindings
reflected from Tint, and also removes Dawn restrictions against
multisampled depth. These restrictions were originally added in
https://dawn-review.googlesource.com/c/dawn/+/30240 to validate
against using a multisampled depth texture with a
comparison sampler. This is now disallowed by the language with
distinct binding types and builtins in WGSL. Previously with
SPIR-V, we inferred Depth if the texture was used
with a comparison sampler.
Also check Vulkan limits for supported sample counts.
Bug: dawn:1021, dawn:1030
Change-Id: I7233b16c14dc80d10a851cc4e786d5b05512b57a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60020
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>