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>
Execution warning is produced from D3D12 validation layers for noop
dispatches, which leads to device lost. The skip noop dispatch handling
was added to the front-end before, and moved to Metal backend due
to it gets in the way of a validation change in the follow-up CL. We
also need to add it to D3D12 backend now.
Bug: dawn:1028
Change-Id: I364f6f1e0ac79679a43c064cb402874f1e959537
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59960
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This patch enables VkPhysicalDeviceFeatures.sampleRateShading as is required
by the SPIR-V Capability (SampleRateShading) for the implementation of
WGSL built-in variable [[sample_index]] (gl_SampleID). Without enabling
smapleRateShading on the creation of VkDevice the Vulkan validation layer
will generate below error message:
Warning: Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-01091 ]
Object 0: handle = xxx, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xa7bb8db6 |
vkCreateShaderModule(): The SPIR-V Capability (SampleRateShading) was declared,
but none of the requirements were met to use it. The Vulkan spec states: If
pCode declares any of the capabilities listed in the SPIR-V Environment appendix,
one of the corresponding requirements must be satisfied.
BUG=tint:471, dawn:802
TEST=dawn_end2end_tests
Change-Id: Id0c91fa48dfae37b2548ee9f3922d93dfa1da5d9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Dawn currently allows sampling depth textures this way, but it is
not in the WebGPU spec, and the behavior is not guaranteed with the
Metal API.
This commit also updates the stencil sampling tests to expect
(s, s, s, s) or (s, 0, 0, 1).
Bug: dawn:1021
Change-Id: I9210a2a3ff1655747a202a51f46f38faa35c85d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59320
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This chained struct can be used for internally adding usages to
Dawn textures. It will affect how the texture is allocated, but
not affect frontend validation.
One use case for this is so that Chromium can use an internal
copyTextureToTexture command to implement copies from a WebGPU
texture-backed canvas to other Web platform primitives when the
swapchain texture was not explicitly created with CopySrc usage
in Javascript.
Usage:
wgpu::DawnTextureInternalUsageDescriptor internalDesc = {};
internalDesc.internalUsage = wgpu::TextureUsage::CopySrc;
wgpu::TextureDescriptor desc = {};
// set properties of desc.
desc.nextInChain = &internalDesc;
device.createTexture(&desc);
Fixed: dawn:1027
Change-Id: Id4d08b5588d4960d150d559aa11502c69f40a674
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58140
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Simplify the buffer clear logic, and tolerate clear twice when resolving
unavailable queries if the destination buffer is not initialized and not
fully written.
Bug: dawn:973
Change-Id: Iaaf16acfd789787cb2f3eb18cd324c60d5f720b1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59680
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
Now resolving unavailable queries is undefined behaviour on D3D12, it
might cause device hangs or removal. Update to just resolve available
part like Vulkan did, and clear the destination buffer to 0s for the
unavailable part.
Bug: dawn:973
Change-Id: I7cf6808d67179425b4883e8847c76daaf8444dc2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59420
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This patch implements the inter-stage variable matching rules on
the attributes 'location', 'base type' and 'composition type'.
In the next patch we will implement the matching rules on the
'interpoliation type' and 'interpoliation sampling'.
BUG=dawn:802
TEST=dawn_unittests
Change-Id: Ic0a273e01dced301d437add83bad3d0c7d94a133
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58363
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
See https://github.com/gpuweb/gpuweb/pull/1927
Adds a typedef to make a gradual deprecation.
Bug: dawn:1023
Change-Id: Ic81a933a95556fbf5726056530788dde017a1449
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59442
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
FirstIndexOffset must happen after BindingRemapper otherwise some
invalid AST is produced after FirstIndexOffset.
This was found running a CTS test on Windows:
validation,vertex_state:vertex_shader_type_matches_attribute_format
Also adds a regression test.
Bug: dawn:1014
Change-Id: Icbe4b3adb5e5844ffc8435e0e67056c7dff23970
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59281
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
After discussion with driver team, there is no need to differentiate new
driver and legacy driver for build number, so the last 2 fields are used
consistently.
Bug: None
Change-Id: I43ac2b484f84ed209d46dd9283830930908b05ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59121
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yang Gu <yang.gu@intel.com>
This replaces multiple switches with a single indexing into a data
table, and also adds information about the VertexFormatBaseType for
later validation.
Bug: dawn:1008
Change-Id: Ic3f564b0dc571cc0008a54785613f962ce223452
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59030
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Note that this is for direct dispatch calls only. Indirect dispatch
calls are still not validated.
Bug: dawn:1006
Change-Id: I061c15208a01dfb803923823ba4afd38667cad22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59122
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ken Rockot <rockot@google.com>
We define hard limits on these attributes for compute stages. This
enforces them.
BUG: dawn:322
Change-Id: I9b279774e877b5d40d912cb9f812f23d61c20a42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56806
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
For Dawn/Chrome interop, Chrome OS differs from Linux as it uses the
NativePixmap-based SharedImageBacking which stores image memory as
dma-bufs as opposed to opaque FDs. Likewise, for synchronization,
Chrome OS wants to use sync obj FDs as opposed to opaque FDs for
more flexibility.
The motivating difference between sync obj FDs and their opaque
counterparts is how they are created. As their name suggests, Opaque
FDs are mostly meaningless outside of the Vulkan ecosystem and must
be created from a VkDevice. As a result, Linux’s
ExternalVkImageBacking needs the Vulkan implementation to create the
FD even when accessing the SharedImage as a GL texture [1]. On Chrome
OS, however, we don’t guarantee Vulkan outside of Dawn, so we aren’t
able to create the opaque FD directly in Chrome.
Instead, we are always able to create sync objs (e.g. via a
fence [2]) which can be imported as VkSemaphores by simply changing
VkImportSemaphoreFdInfoKHR::handleType. Similarly, we can export
signal VkSemaphores as sync objs as well by updating
VkSemaphoreGetFdInfoKHR::handleType.
This CL adds conditional support for using SYNC_FDs on Chrome OS
when importing/exporting VkSemaphores and renames
SemaphoreServiceOpaqueFD accordingly. With this, we can properly
wait on reads/writes on a GL SharedImage representation before
accessing the same memory in Dawn [3].
[1] https://source.chromium.org/chromium/chromium/src/+/main:gpu/command_buffer/service/external_vk_image_gl_representation.cc;l=75;drc=f887797b3b527feabd5dfe9b3f2cc7f6deade49f
[2] https://source.chromium.org/chromium/chromium/src/+/main:gpu/command_buffer/service/shared_image_backing_gl_image.cc;l=681;drc=f887797b3b527feabd5dfe9b3f2cc7f6deade49f
[3] https://chromium-review.googlesource.com/c/chromium/src/+/3042460
BUG=b:172208313
Change-Id: I5357847fea40e41d1b982054e3573d363e17530c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/59080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brian Ho <hob@chromium.org>
--disable_workgroup_init will disable the workgroup memory zero initiailization. Useful for benchmarking.
--disable_symbol_renaming will disable tint's symbol renamer. Useful for debugging output.
Bug: tint:1003
Fixed: dawn:1016
Change-Id: I92486ef88a2c1112d9ccb40f7920947bd2011c70
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58861
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 requires restructuring the logic around MTLCommandBuffer allocation
so that GetPendingCommandContext is guaranteed to never fail. Logic in
the Metal backend is now similar to the Vulkan backend: the
MTLCommandBuffer is prepared at device initialization time, or after a
submission, such that it is always valid.
A new mUsed boolean is added to CommandRecordingContext to say whether
any commands have been recording. Previously mCommandBuffer was used for
that purpose, but it is now always non-null.
Bug: dawn:801
Change-Id: I5dc6747d1e6d538054010cc50533a03a49af921a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58720
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This includes OOM as well as internal driver failures when
creating a view of an MTLTexture. This required changing the code to use
the Create-Initialize pattern used everywhere else.
Bug: dawn:801
Change-Id: Ib8a8dec74141aacfa58a55bb8201a83351b3b739
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58721
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
1. Trigger all deferred callback tasks before registering a new
device-level callback function, making sure that these tasks won't be
invalided due to callback function changing;
2. Fix the end to end testsuit DeviceLostTests, setting the device lost
callback at the beginning of each test so that callback tasks created
during the test will not be triggered unexpectedly.
Bug: chromium:1223390
Bug: chromium:1223603
Bug: chromium:1228134
Change-Id: I2530e938d8fbb2920f3cc6fc78baa01c5d18ad5d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56040
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This patch adds the validation rules on the maximum inter-shader
stage variable locations. According to Vulkan SPEC, "Each effective
Location must have a value less than the number of location avaiable for
the given interface", and according to Table 18 "Shader Input and Output
Locations", the number of available vertex output locations is
maxVertexOutputComponents / 4, and the number of available fragment input
locations is maxFragmentInputComponents / 4.
BUG=dawn:802
TEST=dawn_unittests
Change-Id: I73a66ad69c808fbd0b128abaed1ca84f19a7925d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58640
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit adds checks to (hopefully) all the remaining places in the
Metal backend where object creation can fail.
Bug: dawn:801
Change-Id: Ic27803e956beef822f94ca8449f7816ddd17c1bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58722
Commit-Queue: Stephen White <senorblanco@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Change the ShaderModuleBase::MakeError to return a Ref<ShaderModuleBase>
rather than a naked pointer. This Ref will be used and finally detached in
DeviceBase::APICreateShaderModule.
Bug: chromium:1223546
Change-Id: Ie4213f091e37fdc61c6e1f0bb742e8787bcb4eb8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58660
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
There is nothing we can do when these errors happen except proceeding
with the clean shutdown of the Vulkan device by destroying all the
fences.
Bug: chromium:1230251
Change-Id: I5f14770bf71072616783afec7cf9538c9b103f23
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58398
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Treat color target format with "float" capabilities as
blendable format and validate when blending is enabled.
Add helpers for checking float16 texture values.
Bug: dawn:726
Change-Id: Icf8c0182e5e9a13523970c84b5af91f395a089af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57744
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Adds some handling that ensures correct reflection of texture_external now
that Dawn uses Tint by default. Enables the previously written tests.
dawn: 1004
Change-Id: I8fd43292e9fe243aee037c70fe47b79ace8b672f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58540
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Previously Dawn was using acquireKey + 1 for the releaseKey but we
changed the code transition to requiring a specific key. We supported
both options for a time but now that Chromium uses a releaseKey, we can
remove the deprecated option.
Bug: chromium:1213977
Change-Id: Iab253673c15b83b107dcc3635ee165cfa09efeb6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58383
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Losing the device makes retreiving the problematic shader source
difficult. Change compilation failures to be less severe
validation errors.
Change-Id: Ibcee9f39be66241e26cc8cfcf09c14aa7dfe2d1c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58080
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This was a temporary measure to be able to roll Tint into Dawn with this
change. The macro will be removed in Tint once this lands.
Bug: tint:984
Change-Id: If599e92b16b5edd96b357ce5ee57143a2c00e22d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58365
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
1. Validate the buffer range for both vertex step mode and instance step mode vertex buffers in Draw,
2. Validate the buffer range for instance step mode vertex buffers and the range of index buffer in DrawIndexed, and
3. Add related validation unit tests DrawVertexAndIndexBufferOOBValidationTests, and remove out-of-date vertex buffer robustness tests.
Bug: dawn:808
Change-Id: Ic27a95138cb1e21b72a1da392b7828368bfe2010
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56361
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
TextureViewDescriptor's default values for dimension and
arrayLayerCount in Dawn are not correct according to WebGPU spec.
This change fixes these bugs.
Bug: dawn:760
Change-Id: Ic1d069838d6c0f7bb1afa1dceaf73e91bdfdb20a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58020
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
And print this to the Dawn logger.
Tests will now print any diagnostic logging calls from Dawn.
Change-Id: Idd4bf816303c182809924f9a432570def808e1b6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57381
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Remove deprecated functions and change new functions to pure
virtual since they are implemented both on dawn and chromium
side.
Bug: dawn:773
Change-Id: I5adfe42ad1155276f533660b938b869c775025bf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58100
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
And print the WGSL program even when !force_wgsl_step
Shaders are often built through string concatenation.
Being able to always dump this is useful.
Change-Id: I5da3866b333e8a80931c7c2837f0247e8f38213d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57380
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Conditional on whether TINT_EXPECTS_UBOS_TO_BE_MULTIPLE_OF_16 is
defined, which it will be in a future Tint CL.
Bug: tint:984
Change-Id: I191cd59fe6947c9113a8fad7dbfbf79903969b27
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57960
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Buffers are padded to be at least 4 bytes. Dawn would
produce invalid barriers for buffers that were "zero"
bytes large. The size for the barrier must be either
non-zero or VK_WHOLE_SIZE. Since we always intend
to transition the entire buffer, simply use
VK_WHOLE_SIZE instead of GetSize() as the size.
Fixed: dawn:969
Change-Id: Ifed4e8f9164bafa3c44917074fcf214e72919c56
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57940
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>
When we clear an uninitialized 3D texture, we should clear all depth
slices for each mip level. The current implementation only clears one
slice (the first slice) for each mip level. This change fixes this
bug. Dawn end2end tests of NonzeroTextureCreationTests can pass with
this fix. These tests fail on D3D12 without the fix.
This change also renames arguments for GetRTVDescriptor() for 3D
texture: change baseArrayLayer/layerCount to baseSlice/sliceCount.
Bug: dawn:547
Change-Id: Ic56f28e9e6430058c31aaa2bb21f4e42f7b7621c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57840
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Not running the renamer can produce code that fails to compile
on the backend, resulting in device lost errors.
Change-Id: I4a841a281142bb8eda1402e1ebd6a5d23b77bfe0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57745
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
crbug.com/tint/386 has been fixed.
We don't need these work arounds any more.
Original CL by bclayton@:
https://dawn-review.googlesource.com/c/dawn/+/54641
Bug: tint:386
Fixed: dawn:943
Fixed: dawn:975
Change-Id: I1b94d1e33b023b7d9b3153094f829885a75b5a5e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57743
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
3D texture implementation has already been done. It's time to remove
the UnsafeAPI toggle for it.
Bug: dawn:547
Change-Id: Ic9e0930d7906ee5274b9e412ebacb2574744b2b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This change moves function ViewDimensionToTextureDimension() to
TextureFormatUtils.h|.cpp.
This change also renames TextureFormatUtils.h|.cpp to TextureUtils.h|.cpp
because the new name makes more sense now.
Bug: dawn:547
Change-Id: I183c68d26365a6cda722be55b8ba3556c1b4c82b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57482
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
The main part of this change is to add a few end2end tests, with
some renaming stuff like arrayLayerCount to sliceCount in order to
include both 2DArray and 3D textures.
The implementation is quite simple: just set UAV descriptor on D3D12.
The new tests can pass on Vulkan and Metal, which indicates the
implementation has been done on them.
The new tests fail on OpenGL and OpenGLES. I will take a look and
submit separate patch for GL and GLES.
Bug: dawn:547
Change-Id: Ic03eab6b06654c48341c935f64f4885be544985c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57160
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Change dawn read/write handle for buffer mapping to be created at buffer
creation time instead of at mapAsync time. Update related buffer mapping
tests and wire tests.
Bug: dawn:773
Change-Id: I7dd423c94e1bc15cfe561ea33ec9e348ddf2bfe0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51164
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Tint now has a single-function API for code generation that
automatically runs the backend-specific sanitizer transforms. This API
allows for backend-specific configuration options such as the fixed
sample mask for MSL (and, in the future, information about which
compiler/version is being targeted), and returns any backend-specific
metadata such as whether a UBO of buffer sizes is required by the
shader.
This change prevents the post-sanitizer program from being exposed to
Dawn, which is a potential foot-gun (e.g. the Inspector is not
expected to be run after the sanitizer transforms, and Dawn is
currently doing this).
The old Generator class API will be removed from Tint shortly after
landing this change.
Bug: tint:697
Change-Id: I9b988d55514f810d3091ec6471731e6eb41dc27f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57103
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Float16 is not standardized in WGSL or implemented in Tint,
so remove support of the extension for now.
Bug: dawn:571, dawn:426
Change-Id: Ia26f0ddb07cabf6057c0d7db9ade547494d2cc6e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56441
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This change adds storage binding type tests for 3D texture. It turns
out that it is working. There is no additional work to be done.
Bug: dawn:547
Change-Id: Ia749200e7d371ad549405ff63c198ea4a27924c0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57120
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
If enabled:
* Don't enable the renamer transform. Helps with readability.
* Emit the produced WGSL when combined with --force_wgsl_step
Change-Id: I336de6e6a4eee08805eee82847bd97cd5a942306
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57040
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Enough FXC workaround have been added to tint that these tests now pass again.
Fixed: tint:904
Change-Id: I6dd355d131ab903ae579391c0bfce93979dfc4f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/57041
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>
When SPIRV-Cross we always reflect samplers as regular samplers. A
recent change implementing proper validation broke programs using
comparison samplers in that path.
Skip that bit of validation when using SPIRV-Cross, that hack can be
removed once we use Tint unconditionally for reflection.
Also reenables some BGL-ShaderModule compatibility tests with
SPIRV-Cross to cover the "fixed" validation.
Bug: dawn:571
Bug: dawn:367
Change-Id: I2d1a65aaea717b4927ac4e838942547a1b413d33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56900
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Removes the last remaining code paths supporting the old rowsPerImage
and bytesPerRow defaulting behavior, and updates all related tests to
strictly expect the spec-complaint behavior.
Change-Id: I022db0b142939d82e33d5989460488881e5a1ab3
Bug: dawn:520
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56803
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Also adds the new limits for maxComputeWorkgroupSize because there are
few systems where the .Z of that limit goes above 64.
Bug: dawn:796
Change-Id: I52e85e7b7c666da15493178e170ca82922d34017
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56082
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
TimestampQueryTests.ResolveTwiceToSameBuffer fails on Intel latest
driver on Windows, because the kInternalStorageBuffer is not treated
in buffer usage when adding resource barrier.
Add missed kInternalStorageBuffer in buffer usage and remove
D3D12_RESOURCE_STATE_UNORDERED_ACCESS from QueryResolve, which will be
added by kInternalStorageBuffer.
Bug: dawn:797
Change-Id: I78607002179ba443b0db09c9c3bbc85fcc97a85b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56523
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
Renames dawn_native::ComponentTypeBit to SampleTypeBit and makes
the bitmask match wgpu::TextureSampleType. wgpu::TextureComponentType
should be removed in a follow-up CL.
The Format table is augmented with float/unfilterable-float information
so that textures can be validated against the BGLEntry's
TextureSampleType.
EntryPointMetadata::ShaderBindingInfo no longer inherits BindingInfo
because the two types are diverging further. Most notably, this CL
reflects from Tint the supported SampleTypeBits for texture bindings.
This bitset is validated against the bind group layout.
Adds an isFiltering getter to SamplerBase. A filtering sampler must
not be used with a non-filtering sampler binding.
Lastly, the CL reflects sampler/texture pairs from Tint and validates
an entrypoint against the pipeline layout that a filtering sampler is
not used with an unfilterable-float texture binding.
Bug: dawn:367
Change-Id: If9f2c0d8fbad5641c2ecc30615a3c68a6ed6150a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56521
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Dereferencing a nullptr is UB by spec, even if the method called is
non-virtual and no memory access to nullptr appears to actually occur.
For example:
error: 'this' pointer cannot be null in well-defined C++ code;
comparison may be assumed to always evaluate to true
[-Werror,-Wtautological-undefined-compare]
Bug: b/179840737
Change-Id: I6385e157e9a883cdd65f5ef9be89bcc3a29324fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56720
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Tint:
* Use the new transform::VertexFormat enum names
WGSL:
* The [[set(n)]] decoration is now [[group(n)]]
* [[builtin(vertex_idx)]] is now [[builtin(vertex_index)]]
Change-Id: I9cbf1368074488c4bb7fa81430bb12ec7581c1fb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56540
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Tint's vertex pulling transform supports the whole GPUVertexState so
we can enable it by default when robustness is necessary.
Adds a suppression for failing tests on Metal Intel.
Bug: dawn:805
Bug: dawn:966
Change-Id: Id7b2c6df2291671164647f65fc50c61e27de90b9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56382
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
The test bots now instantiate separate test suites with/without
this toggle.
Bug: dawn:571
Change-Id: Ib4e8e89ac347d0030b233d1a3b14b318aa862aa6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56440
Commit-Queue: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This will help check that the Vulkan devices are enough for WebGPU in
a following CL.
In addition to additional limits this CL:
- Change maxColorAttachments 4 -> 8 to match WebGPU
- Renames kMinDynamicBufferOffsetAlignment to
kMinUniformBufferOffsetAlignment.
- Renames kMaxVertexBufferStride to kMaxVertexBufferArrayStride.
- Changes validation of buffer offsets to use the separate uniform and
storage limits (but no test is added because they are the same).
- Adds validation and a test for kMaxStorageBufferBindingSize.
- Augment the null::Device memory limit for that new test (it allocates
a buffer of 512MB).
- Fix the maxColorAttachment test to not use hardcoded values.
Bug: dawn:796
Change-Id: Ibe4219130a44355ae91c02aaa0a41cf5d9f9e234
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56081
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
- Add zero-sized implementation in each backend.
- Test creating zero-sized query set for each type.
Bug: dawn:954
Change-Id: Ib2b8a7d890dae6ee40f5a05aac570a4600dedab8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56260
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This change implements 3D texture sampling with an en2end test.
It turns out that the implementation has already been done. The
test can pass with minor changes.
Bug: dawn:547
Change-Id: I5dfe1a446de3287392e39cb4dd58143e115b02cd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
We're migrating to run all tests with both Tint and SPIRV-Cross.
Remove explicitly instantiating only with Tint, and add
skips for tests that will not work if use_tint_generator is not
enabled.
Bug: dawn:571
Change-Id: I8322dec688e75b6efa8c4f18c6b9439a2e325631
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56261
Auto-Submit: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
RefBase::Detatch() method in RefBase.h calls std::move,
but no appropriate header was included. Error example was:
RefBase.h:137:22: error: no member named 'move' in namespace 'std'
Change-Id: I60f84bffba06ba5fd3fea7fb9c4908cfe3989472
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56281
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This is fixup for the
https://dawn-review.googlesource.com/c/dawn/+/54800
where the macre was not properly declared.
Clang doesn't claims about it, but GCC does.
The errors example for GCC 9.3.0:
/dawn/src/dawn_native/CopyTextureForBrowserHelper.cpp:40:5:
error: unterminated raw string
40 | R"(
| ^
/dawn/src/dawn_native/CopyTextureForBrowserHelper.cpp:46:6:
warning: missing terminating " character
46 | )"
| ^
Bug: chromium:1217153, chromium:819294
Change-Id: I47aa2dac37d9dfa7c02532caeb3341edd22fcd07
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56066
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Fix missing Release() on RefBase::operator=(const T&).
Always acquire the new reference before dropping the existing reference.
Consider:
* Object A holds the only reference to object B.
* Ref of A is assigned B.
If A were released before referencing B, then B would be a dead pointer.
Remove RefBase::kNullValue, just use Traits::kNullValue. Avoids an unnecessary constexpr copy.
Add even more tests.
Change-Id: I111079d56cbf8c09162aa6e493078bead9ae97fa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55882
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This makes SPIRV ingestion always go through a SPIRV->WGSL step first.
This will be used to make sure that path works correctly on existing
WebGPU SPIRV sites so we're confident the SPIRV->WGSL translation will
work when compiled to WASM.
Bug: dawn:960
Change-Id: I17efd8c64d9d60ff033ba89b8fff9295e66524ef
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56080
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
We are now passing all of Dawn's E2E tests with the Tint generator.
Bug: dawn:571
Change-Id: Ie74a07bde805b8652ac23af2bda2fa11597d04ce
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55980
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
WGSL specifies that the size of a host-shareable structure is a
multiple of the largest alignment of any member in that
structure. While SPIR-V cross doesn't generate this trailing padding,
Tint does, and so we need to pad the host structure to match to avoid
validation errors.
Bug: dawn:571
Change-Id: Id5de89125a74c0469ae69d6e86b4c570bbdb31ab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56120
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Fix a capitalization error in CMakeLists.txt
Link dxgi.lib only in UWP compilation in CMakeLists.txt
Bug: dawn:766
Change-Id: I011f44c8147998a9f4b3a55b25888ca1ad05a3e1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56180
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch adds a missing check in QueueGL::WriteTexture() to return
a validation error when we try to call writeTexture() on the stencil
aspect on OpenGL backends as copying from a buffer into a stencil
texture is not supported on OpenGL.
BUG=dawn:439
Change-Id: I203d40aefe346aea663a492c5a065248b74f8ea3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56002
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch fixes a wrong buffer type declaration in the shader used
in BufferZeroInitTest.BoundAsReadonlyStorageBuffer. In this test the
buffer should be bound as a read-only storage buffer, so it should be
declared as var<storage, read> instead of var<storage, read_write>.
BUG: none
Change-Id: Ib85bf199f64e205b944b7233aae31323cbec1819
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56042
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Tint has rolled, so this test can be re-enabled.
SPIRV-Cross produces bad results - likely the UBO layout for mat2x2 is
incorrectly padded - so this test is suppressed for !UseTintGenerator.
Fixed: dawn:946
Change-Id: If1d030314f51759e6a2a00dd8edc2597efb1eb4a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55440
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
It may not be the root cause of CTS memory leak, but we found some
issues in D3D12 memory allocation for large buffers (> 4M).
The memory allocation is not freed correctly when we call buffer
destroy. When we create a large buffer, it always allocate committed
resources from the system memory and append it to LRU cache, and will
try to free the expired memory in LRU cache when the left memory size
is not enough for the current allocation. When we call buffer destroy,
we remove its heap from LRU cache, release its allocation, but will
add the allocation reference to a delete queue and wait to be freed
together in the next device.tick. At this time, the destroyed memory is
not really released to the system memory. If no tick is triggered during
the buffer allocation and deallocation, these memories will never be
reused again and there will be a memory leak. We need to free these
memories when we detect there is not enough memory, do not wait for
device.tick to do that.
Add a stress case to track the issue, and need to discuss how to fix it.
Bug: dawn:957
Change-Id: Id4bcc97496d372ad7c27c31675327ca12e133217
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55740
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Core WebGPU requires some Vulkan features to be implemented. Check for
them so that we don't return an adapter for a Vulkan device with
insufficient features.
Bug: dawn:796
Change-Id: I445760f184807b8f2d4ee248289b512c18038f33
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55920
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This ensures ObjC objects do not leak. On non-Apple
platforms, the scope does nothing.
Fixed: dawn:546
Change-Id: Id43702e6536bf9cb37825a5449511e10cf0734f5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55841
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Set BUILD_EXAMPLE to OFF in UWP.
Disable Vulkan in UWP.
Compile GLFW related sources only on supported platform.
Remove linking to user32.lib in UWP.
Add linking to dxgi.lib only in debug configuration.
Use EmptyDebugLogger in UWP.
Bug: dawn:766
Change-Id: I3e6149058048d1b597267dfb9d63342b6a54e0af
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55260
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This patch modifies the ValidateLinearTextureCopyOffset for T2B and B2T
commands to make sure that buffer offset is a multiple of 4 when the
texture is of a depth/stencil format. The unittests are also updated
to cover these cases.
Bug: dawn:721
Change-Id: I5cb9487e61e7f6ac7075157a092a1f3577844042
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55720
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Metal needs RenderTarget usage to be added to the texture
allocation so the clear can be done using a render pass.
Already working for GL which does not have usage flags on
creation.
Also working on Vulkan which does not need a render pass.
We use vkCmdClearColorImage.
D3D12 also needs a render pass to clear multisampled textures,
but it already requires multisampled
textures to be created with RenderTarget flags.
To test the behavior, NonzeroTextureCreation tests are
expanded, and the ExpectSampledDepthData helper is factored
into a more general ExpectSampledFloatData helper.
Fixes: dawn:794
Change-Id: If0f9f26f3c58b4292c85265aa7ff330e9931ddae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55604
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This change adds a few tests to cover more copy scenarios like
copy between different mip levels of the same texture, copies
between 3D texture and 2D Array textures for partial copies,
non-zero offset (copy origin), non-zero mip level, etc.
The new tests expose a bug, which is fixed by this change.
It also re-arranges the tests, in order to put all tests into
corresponding categories like T2B, B2T and T2T tests. Within each
category, tests are in the sequence of 2D texture tests, 2D array
texture tests, and 3D texture tests.
Bug: dawn:547
Change-Id: I624a8814d91950e69126705611f02e258eaf216b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55540
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Fixes locations that explicitly have TODOs about
checking for overflow. Also fixup other locations found while
searching the code for arithmetic operations.
Fixes: dawn:830
Change-Id: I4ef6b97a9cde14439e573a1da8d569ab985efc53
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55605
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This is to get the new version of d3dcompiler_47.dll present in the
updated Windows toolchain.
Also rolls tools/clang and libc++abi to match the version used by
Chromium for this //build and //buildtools revision.
Also fixes -Wdeprecated-copy-with-dtor warnings in Dawn.
Roll build/ ea192b29d..0ff4b3d4e (529 commits; 1 trivial rolls)
ea192b29d2..0ff4b3d4ee
$ git log ea192b29d..0ff4b3d4e --date=short --no-merges --format='%ad %ae %s'
2021-06-22 chromium-autoroll Roll Fuchsia SDK from 5.20210621.3.1 to 5.20210622.0.1
2021-06-22 joelhockey Revert "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)"
2021-06-22 chromium-autoroll Roll Fuchsia SDK from 5.20210621.1.1 to 5.20210621.3.1
2021-06-21 robliao Add LASTCHANGE_YEAR Support to //build/util/version.py
2021-06-21 chromium-autoroll Roll Fuchsia SDK from 5.20210621.0.1 to 5.20210621.1.1
2021-06-21 stha09 unbundle: add libavcodec/packet.h to shim headers
2021-06-21 thakis Revert "Reland^4 "mac: Temporarily use lld as linker in non-pgo builds""
2021-06-21 chromium-autoroll Roll Fuchsia SDK from 5.20210620.3.1 to 5.20210621.0.1
2021-06-21 chromium-autoroll Roll Fuchsia SDK from 5.20210620.2.1 to 5.20210620.3.1
2021-06-20 chromium-autoroll Roll Fuchsia SDK from 5.20210620.0.1 to 5.20210620.2.1
2021-06-20 chromium-autoroll Roll Fuchsia SDK from 5.20210619.3.1 to 5.20210620.0.1
2021-06-20 thakis Reland^4 "mac: Temporarily use lld as linker in non-pgo builds"
2021-06-20 chromium-autoroll Roll Fuchsia SDK from 5.20210619.1.1 to 5.20210619.3.1
2021-06-19 chromium-autoroll Roll Fuchsia SDK from 5.20210619.0.1 to 5.20210619.1.1
2021-06-19 chromium-autoroll Roll Fuchsia SDK from 5.20210616.3.1 to 5.20210619.0.1
2021-06-19 brucedawson Updated toolchain with new d3dcompiler_47.dll
2021-06-18 thakis mac: Stop using thin archives in lld builds for now
2021-06-18 robliao Add LASTCHANGE_YEAR to lastchange.py for Automatic Year Substitution
2021-06-18 asully Revert "Reland^3 "mac: Temporarily use lld as linker in non-pgo builds""""
2021-06-18 thakis Reland^3 "mac: Temporarily use lld as linker in non-pgo builds"""
2021-06-18 bpastene chromeos: Isolate the test image rather than qemu image for VM tests.
2021-06-18 thakis posix: Remove sysroot_ld_path.sh
2021-06-18 gbeaty Add OWNERS files for controlling CQ usage.
2021-06-17 bialpio WebXR: roll ARCore APK version, revert workaround
2021-06-17 thakis Add a comment to install-sysroot.py saying where the output goes
2021-06-17 tikuta build: remove unused run_under_python2 references
2021-06-17 yyanagisawa ignore rewrapper related configs in build/args/chromeos.
2021-06-17 chromium-autoroll Roll Fuchsia SDK from 5.20210616.2.1 to 5.20210616.3.1
2021-06-17 pkotwicz [Build Android] Add tests for incremental javac
2021-06-17 yyanagisawa rewrapper: use linux config for chromeos host compiles.
2021-06-16 bpastene Revert "chromeos: Don't run lacros-related Tast tests on ash-chrome bots."
2021-06-16 miketaylr Revert back to generating chromium_git_revision.h via version.py
2021-06-16 chromium-autoroll Roll Fuchsia SDK from 5.20210615.2.1 to 5.20210616.2.1
2021-06-16 asully Indexeddb: Enable TSAN on CorruptDBRequestHandler
2021-06-16 rnk Give all Clang maintainers OWNERS in //build for cflag changes
2021-06-16 wnwen Android: Increase dex max heap size
2021-06-16 djean [ios] Move ios deployment target to 13.0
2021-06-16 hidehiko Remove dependency to linux/dri from Lacros.
2021-06-15 svenzheng Lacros tests run in parallel
2021-06-15 rnk Revert "Reland "Reland "mac: Temporarily use lld as linker in non-official non-component builds"""
2021-06-15 chromium-autoroll Roll Fuchsia SDK from 5.20210614.3.1 to 5.20210615.2.1
2021-06-15 hferreiro Merge ash/public/cpp/ash_switches.* into ash/constants/
2021-06-15 thakis Reland "Reland "mac: Temporarily use lld as linker in non-official non-component builds""
2021-06-15 pkotwicz [Build] Change 'cannot find symbol' compile message.
2021-06-15 chromium-autoroll Roll Fuchsia SDK from 5.20210614.2.1 to 5.20210614.3.1
2021-06-14 antoinedesbois Add config for unresolved symbols
2021-06-14 agrieve Update android resources doc: R.java are from androd_library()
2021-06-14 chromium-autoroll Roll Fuchsia SDK from 5.20210613.3.1 to 5.20210614.2.1
2021-06-14 pkotwicz [Build] Pass accurate GN target name to compile_java.py
2021-06-14 mheikal [Android] Enable unused resources removal on bundle targets (relandx2)
(...)
2021-03-30 chonggu [Fuchsia] Rename additional_manifests to additional_manifest_fragments
2021-03-30 chromium-autoroll Roll Fuchsia SDK from 3.20210329.3.1 to 3.20210330.0.1
2021-03-30 weizhong Manual roll of catapult
2021-03-30 chromium-autoroll Roll Fuchsia SDK from 3.20210329.1.1 to 3.20210329.3.1
2021-03-30 rmcelrath Check getActivity method owner in FragmentActivityReplacer
2021-03-30 svenzheng Lacros: ash_clang_x64 uses x11 ozone_platform
2021-03-29 bjoyce Mark UNKNOWN test results as ABORT for result_db.
2021-03-29 chromium-autoroll Roll Fuchsia SDK from 3.20210329.0.1 to 3.20210329.1.1
2021-03-29 pkotwicz Move BuildConfig.template to //build
2021-03-29 thakis Reformat a comment in the win toolchain gn file.
2021-03-29 chromium-autoroll Roll Fuchsia SDK from 3.20210328.3.1 to 3.20210329.0.1
2021-03-29 hidehiko Pass all available FDs from ash-chrome.
2021-03-28 chromium-autoroll Roll Fuchsia SDK from 3.20210328.1.1 to 3.20210328.3.1
2021-03-28 thakis symlink.py: Remove an "unused variable f" lint warning
2021-03-28 chromium-autoroll Roll Fuchsia SDK from 3.20210328.0.1 to 3.20210328.1.1
2021-03-28 chromium-autoroll Roll Fuchsia SDK from 3.20210327.3.1 to 3.20210328.0.1
2021-03-27 chromium-autoroll Roll Fuchsia SDK from 3.20210327.1.1 to 3.20210327.3.1
2021-03-27 chromium-autoroll Roll Fuchsia SDK from 3.20210327.0.1 to 3.20210327.1.1
2021-03-27 chromium-autoroll Roll Fuchsia SDK from 3.20210326.3.1 to 3.20210327.0.1
2021-03-26 chromium-autoroll Roll Fuchsia SDK from 3.20210326.1.1 to 3.20210326.3.1
2021-03-26 chromium-autoroll Roll Fuchsia SDK from 3.20210325.4.1 to 3.20210326.1.1
2021-03-26 chonggu [Fuchsia] Switch web engine and runner tests to use test-cmx fragments
2021-03-26 chromium-autoroll Roll Fuchsia SDK from 3.20210325.2.1 to 3.20210325.4.1
2021-03-25 gangwu Call ClipDescription#isStyledText() in Android S
2021-03-25 hnakashima [Android] Create lookup_dep.py
2021-03-25 bjoyce Change UNKNOWN default status of gtests to CRASH.
2021-03-25 thakis In is_ubsan_security builds, add fsanitize=vptr at gn level, not flag level
2021-03-25 thakis mac: Use llvm-nm when building on a non-mac host
2021-03-25 bjoyce Add additional regex check for crashes.
2021-03-25 chromium-autoroll Roll Fuchsia SDK from 3.20210325.0.1 to 3.20210325.2.1
2021-03-25 rubensf [reclient][nacl] Change nacl executable paths to use '\' on windows.
2021-03-25 hans Add script for analyzing the include graph
2021-03-25 sdefresne Use build/branding_buildflags.h instead of GOOGLE_CHROME_BUILD
2021-03-25 chromium-autoroll Roll Fuchsia SDK from 3.20210324.3.1 to 3.20210325.0.1
2021-03-25 aeubanks Unbreak Linux libFuzzer MSan bot
2021-03-25 chromium-autoroll Roll Fuchsia SDK from 3.20210324.1.1 to 3.20210324.3.1
2021-03-24 dpranke Attempt #4 of "Add test directory -> monorail component metadata to test"
2021-03-24 steveroe [fuchsia] Add test json to warn if Chrome-Fuchsia packages exceed 38.6M
2021-03-24 bsheedy Mark Android emulator as supported config
2021-03-24 akhuang Re-enable precompiled headers on Windows, since it's been fixed in Clang.
2021-03-24 chromium-autoroll Roll Fuchsia SDK from 3.20210324.0.1 to 3.20210324.1.1
2021-03-24 chromium-autoroll Roll Fuchsia SDK from 3.20210323.3.1 to 3.20210324.0.1
2021-03-24 dpranke Update '#!/usr/bin/python' shebangs to '#!/usr/bin/env python'.
2021-03-24 wez [android] Migrate Android toolchain rules to use llvm-{nm|strip}.
2021-03-24 chromium-autoroll Roll Fuchsia SDK from 3.20210323.1.1 to 3.20210323.3.1
2021-03-23 horo Revert "Attempt #3 of "Add test directory -> monorail component metadata."""
2021-03-23 dpranke Attempt #3 of "Add test directory -> monorail component metadata.""
2021-03-23 chonggu [Fuchsia] Remove unnecessary package vars from yaml files
2021-03-23 wez [clang] Use llvm-nm and llvm-strip when using Clang toolchain.
2021-03-23 chromium-autoroll Roll Fuchsia SDK from 3.20210323.0.1 to 3.20210323.1.1
Roll buildtools/ 69cc9b8a3..9c143ace7 (26 commits; 1 trivial rolls)
69cc9b8a3a..9c143ace75
$ git log 69cc9b8a3..9c143ace7 --date=short --no-merges --format='%ad %ae %s'
2021-06-22 joelhockey Revert "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)"
2021-06-17 ukai Update for roll clang llvmorg-13-init-12576-g643b6407-1 : llvmorg-13-init-12881-g4017d033-1
2021-06-14 ukai Update for roll clang llvmorg-13-init-12491-g055770d5-1 : llvmorg-13-init-12576-g643b6407-1
2021-06-11 ukai Update for roll clang llvmorg-13-init-11649-g4d788fb8-1 : llvmorg-13-init-12491-g055770d5-1
2021-06-09 ukai Revert "update for clang_version=llvmorg-13-init-11999-g50c0aaed-1"
2021-06-07 ukai update for clang_version=llvmorg-13-init-11999-g50c0aaed-1
2021-06-07 ukai fix reclient_cfgs/OWNERS
2021-06-04 ukai update for clang_version=llvmorg-13-init-11649-g4d788fb8-1
2021-06-04 ukai Add OWNERS for buildtools/reclient_cfgs
2021-06-01 ukai Add reclient_cfgs/win-cross-experiments
2021-05-21 rubensf [reclient] Add option for remote links.
2021-05-20 wnwen Android: Fix java_checker ignored directories
2021-05-19 wnwen Android: Fix py3 presubmit compat for java files
2021-05-19 jopalmer [COIL] Change chromium code search type links to use main rather than master for buildtools
2021-05-14 sky cct: calls setClientDataHeaderForNewTab for hidden tabs
2021-05-14 dpranke Reland "Make //buildtools/checkdeps Python3-compatible."
2021-05-12 thakis Revert "Make //buildtools/checkdeps Python3-compatible."
2021-05-12 dpranke Make //buildtools/checkdeps Python3-compatible.
2021-05-03 msavigny [reclient] Fix up reclient nacl wrapper config.
2021-04-30 msavigny [reclient] Fix up reclient c/c++ wrapper config.
2021-03-29 thakis linux: Don't link clang-format against zlib
2021-03-29 thakis linux: Build clang-format in a sysroot
2021-03-29 thakis mac: Don't link clang-format against libz.1.dylib either
2021-03-28 thakis mac: Don't link clang-format against /usr/lib/libncurses.5.4.dylib
2021-03-26 thakis mac: Add clang-format binary that can run on arm.
Created with:
roll-dep build buildtools
Change-Id: I48668fb6b45df25ba3cd2bc04665a78a9c4399ed
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55620
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Tint now combines a fixed sample mask with any mask authored in the
shader, and generates the builtin if necessary.
Fixed: tint:387
Change-Id: Ic084f28356432566e8d2566f45cf0730f4cd2f6d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55686
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Various aspects with this appear to be broken.
Bug: dawn:838
Change-Id: If706508b90214f9b5f4b2884448f281945295827
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55560
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This bug does not need any work done. The code is correct. Depth
stencil store operations occur in the LATE_FRAGMENT_TESTS_BIT
stage. See crbug.com/dawn/853 for more information.
Fixes: dawn:853
Change-Id: Ib0b7a5af65d09d67d7500ad89dd88c32e13c6d91
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55602
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Auto-Submit: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This reverts commit 7fc0c0519a.
Include fix for issues that caused initial revert
BUG=dawn:950
Change-Id: If1d095d19dd771fd7a608bc54f1bd908562d332c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55682
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This reverts commit 48183b8f58.
Reason for revert: Part of Dawn->Chromium breakage
BUG=dawn:950
Original change's description:
> Vulkan: honor bufferImageGranularity the simplest way.
>
> Vulkan requires that linear and opaque resources be placed in different
> "pages" of bufferImageGranularity size, as some hardware uses the page
> table to contain some compression bits or other stuff. Make Dawn honor
> this limit by aligning all allocations to bufferImageGranularity. This
> is pretty bad and should be improved later.
>
> Also does some cleanups:
> - Add kMappableBufferUsage to represent all mappable usages.
> - Remove the proxy function for resource management from
> vulkan::Device and call ResourceMemoryAllocator directly.
> - Use an enum to make the difference between mappable, linear and
> opaque resources.
>
> This issue was found while doing a change of the memory type selection
> in Vulkan, that started failing some unrelated tests on Nvidia. Without
> knowing the details of the HW or the driver it is really hard to write
> tests, except by copy-pasting a failing test. This is why there is no
> test added in this CL, and instead will rely on tests not failing with
> the follow-up CL.
>
> Bug: dawn:659
>
> Change-Id: Ib7c1f3f1949457e04ca8e23d212dc60af7046213
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52920
> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>
TBR=cwallez@chromium.org,senorblanco@chromium.org,enga@chromium.org,dawn-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: I133f6a44227819bf262ad2b6e8e9d0d7bfaaefaa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: dawn:659
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55642
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Previously when comparing a "bestType" that's device-local with a
"current" that's non-device-local, the logic to favor device-local
memory would be skipped and the types compared on their size. This lead
to incorrect memory types selection on some configurations (where the
small device local heap was selected).
Bug: dawn:659
Change-Id: Ie764815082ebeef845b70077fe630df05bcdb92b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/39500
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Vulkan requires that linear and opaque resources be placed in different
"pages" of bufferImageGranularity size, as some hardware uses the page
table to contain some compression bits or other stuff. Make Dawn honor
this limit by aligning all allocations to bufferImageGranularity. This
is pretty bad and should be improved later.
Also does some cleanups:
- Add kMappableBufferUsage to represent all mappable usages.
- Remove the proxy function for resource management from
vulkan::Device and call ResourceMemoryAllocator directly.
- Use an enum to make the difference between mappable, linear and
opaque resources.
This issue was found while doing a change of the memory type selection
in Vulkan, that started failing some unrelated tests on Nvidia. Without
knowing the details of the HW or the driver it is really hard to write
tests, except by copy-pasting a failing test. This is why there is no
test added in this CL, and instead will rely on tests not failing with
the follow-up CL.
Bug: dawn:659
Change-Id: Ib7c1f3f1949457e04ca8e23d212dc60af7046213
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52920
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
After adding some e2e tests for 3D texture T2T copy on non-zero mip
levels, it turns out that there is a bug in the e2e test itself.
The 3D texture copy splitter works well.
Bug: dawn:547
Change-Id: I51aef7aaca4caf9c86bfb0590eb0288d17731ba5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55144
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Tint now matches the behavior of spirv-cross for shaders to use the
arrayLength builtin, and so needs a uniform buffer containing storage
buffer lengths to be passed to shaders that use this builtin.
Fixed: tint:256
Change-Id: Ib51cc4a3c6f7c2cdea867a23ed868d9d3740d734
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55181
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This CL adds the support ofwgpu::CopyTextureForBrowserOptions::alphaOps
for CopyTextureForBrowser(), which allows the user to specify the alpha
operations (DontChange, Premultiply, Unpremultiply) when calling
CopyTextureForBrowser().
BUG=chromium:1217153
Change-Id: Idb5dd4482b33f2ada9aafc24380afeb48f2e26bc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54800
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
ShaderRobustnessPerf:
SPIRV-Cross apparently generates incorrect code for MSL and OpenGL, when
attempting to initialize workgroup memory. Disable these tests when not
running with use_tint_generator.
D3D12DescriptorHeapTest:
The UBO layout for a mat2x2 was incorrect, but the test relied upon this.
Temporarily disable the test so we can roll the fix.
Bug: dawn:945
Bug: dawn:946
Change-Id: I810249b26a8a0b583796c0ba63b8a703eb9540e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55248
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Refer the TODO in ShaderModuleBase::InjectCompilationMessages to
issue dawn:944 for further tracking.
Bug: dawn:753
Change-Id: I2ff09ba5914f2df0182bf26e9001a66782811f06
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55223
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Add the formatted tint messages in OwnedCompilationMessages, which will be emit after creating the shader module succeeds of fails.
This patch also change the compilation messages handling in creating shader modules. Now the compilation messages are separated from sparseResult, and should be handled manually. A new method, ShaderModuleBase::InjectCompilationMessages, is introduced to move a given OwnedCompilationMessages into the shader module, and emit the formatted tint errors and warnings. This method should be called explicitly on a valid or error shader module.
Bug: dawn:753
Change-Id: I5825186c6d9c4aa7725aebd0c302bfce5e1f37cf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53890
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Also tighten previous suppressions to only apply when using the Tint
generator.
TBR=bclayton@google.com
Bug: tint:904
Change-Id: I22210227c428eb38901904966ec2c3bd70ce607b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55200
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Copies between 3D and 2DArray textures need to be done depth/array
slice by slice via CopyTextureRegion() API on D3D12 because this
API can copy one single subresource every time.
However, if both src and dst textures are 3D texture, we can copy
all depth slices in one shot, which is a fast path for this
copy scenario.
Bug: dawn:547
Change-Id: I950ed58319fb0f30dfc8a2de3e57e8a64406f7e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55140
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Disabling the one test clearly wasn't enough
Bug: tint:904
Change-Id: I23f448d2f3028fff13e4eb406b08a7175166ea9d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/55100
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Sarah Mashayekhi <sarahmashay@google.com>
Reviewed-by: Sarah Mashayekhi <sarahmashay@google.com>
The vertex buffer alignment in particular is helps make the
implementation of programmable pulling much easier on Metal since the
vertex data will be able to be represented as array<u32>.
Bug: dawn:805
Change-Id: I2bf2742db3b8fa478be620c892925b8b75dc514c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54659
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Values of array and matrix can now only be indexed by a constant value.
Dynamic indexing requires the value to be held in memory.
See: https://github.com/gpuweb/gpuweb/issues/1782
Bug: tint:867
Change-Id: I2b9ad6e40fc8121e7aca3a71c190639b39b0b862
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54652
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Otherwise bindings with non-zero groups get through to the Tint MSL
backend and break assumptions.
Bug: tint:104, dawn:571
Change-Id: I8d95ba142a386ff0d992ffe5f88a7acf93057ce1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54960
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
CopySplitTests unittests were added for 2D texture copy splitter.
Now that we have added 3D texture copy splitter recently, it's time
to enable these unittests for 3D texture copy splitter.
This change enables the CopySplitTests unittests for 3D texture copy
splitter, with some fixes:
- Footprint depends on bufferOffset and copySize, not bufferSize,
- Copy regions overlap validation incorrectly added 1 extra pixel,
- For 2D texture copy regions, there is one empty row at most in
a copy region. However, it is not true for 3D texture copy
regions when we are copying the last row of each slice.
It also adds a few more tests for 3D texture copy splitter when the
copySize.height is 1 and there is an empty row in the copy region.
Bug: dawn:547
Change-Id: I5381993ed5c656da0f82395e7c7bccc54d784767
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54500
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
TextureOffset should respect both origin and copySize when we are
addressing the empty first row issue. So textureOffset in copy 1
should just move/add (copySize.height - blockInfo.height) rows
in order to copy the last row of all depth slices but the last one.
Bug: dawn:547
Change-Id: I6a1acf656651869c8934897d5c7e8974f1a5eb9a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54441
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
The config was already being set, but the transform itself was not
being added to the manager.
Bug: dawn:571
Change-Id: I850d5b0f37635598427b4a3a3285d243b89fad46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54721
Commit-Queue: James Price <jrprice@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Use the BindingRemapper transform to remap resources binding numbers
to the indices chosen in the pipeline layout.
Bug: dawn:571
Change-Id: I548f063f09970222dea289f05285764fc3ea1b46
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54520
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
In the timestamp internal pipeline, the ResolveQuery buffer cannnot be
binded as Storage buffer in binding group layout due to it has not
Storage usage.
Add InternalStorageBuffer for buffer usage and
InternalStorageBufferBinding for buffer binding type, make the
QueryResolve buffer implicitly get InternalStorageBuffer and only
compatible with InternalStorageBufferBinding in BGL, not Storage buffer
binding type.
Bug: dawn:797
Change-Id: I286339e703e26d3786c706ded03f850ca17355fb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54400
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This feature is not yet implemented in Tint and it not planned for OT.
BUG=dawn:799
Change-Id: Ib97dcd39e8ae956aa6fdc4cc1b148ec7f101b061
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54280
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The runtime array parameter is now passed as a pointer, instead of by
value.
Change-Id: I632814d2a2890dbe4476c2b01023a5ff8de42d21
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54485
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
It isn't clear if this should be a limitation of the WebGPU
specification. Until further investigation is done, disallow it in Dawn
to avoid undefiend behavior.
Bug: dawn:812
Change-Id: Iab8208f1ea479263b08ede41374ce1a680ce191e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53387
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
We have a new validation rule that states that all calls to functions that return a value must use that value. ignore() is the escape hatch.
Bug: tint:886
Change-Id: I9ab8d288b3c54ad4b7e46feda129c36c9136c20b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54200
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
The log output code snippet duplicates again and again in this test.
So this change put it into a function and all tests can call that
function without duplicated code. It names the new function as
DoTest(), which calls DoTest2D() (the original DoTest()). The new
function can add DoTest3D() into the test in order to test 3D
texture splitter if needed and all tests don't need to change
anything.
It also removes TexelBlockInfo instance in DoTest2D(), which provide
no new info, just as Origin3D instance (for origin) and Extent3D
instance (for copySize).
Bug: dawn:547
Change-Id: I668682c5bdbae56dcdc8cf0e232f27233e17b883
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54221
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
If the copy region generated from 2D texture copy splitter has an
empty first row due to alignment adjustment and we simply extend
it to all copied depth slices, the copy region will be incorrect
for 3D texture copy.
If there is an empty first row and the copy height is odd, we can
split the copy region into two:
- copy0: copy the first depth slice
- copy1: copy the rest depth slices because there is no empty
row after alignment adjustment
This method resolves the remaining problem when copy height is 1.
It also is an optimization for other odd copy height cases, say
copy height is 3, 5, 7, etc.
This change implements the special situation when the copy region
generated from 2D texture copy splitter has an empty first row and
its copy height is odd.
Bug: dawn:547
Change-Id: Idf4f4a9b87f783c5328463e0f4182429a7e809f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53885
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Deprecates the computeStage member of the descriptor in favor of compute
as described by the spec. In order to support both variants without
breaking backwards compatibility some code had to be manually added to
the wire client to copy from the deprecated member to the new one and
visa versa.
Change-Id: I9d5c2fc9c446c927c5792c9af9ed56c90060b65b
Bug: dawn:800
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53884
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The change implements copy non-zero mip level for 3D textures
on D3D12 when the texture has multiple mip levels. The texture
size on level 0 can be either 256-byte aligned or 256-byte
unaligned(its size is non-power-of-two).
Bug: dawn:547
Change-Id: I8ed74fa587cfd814e7f526173dcb653d0a252a1e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51201
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
- Pipeline statistics query is not fully implemented, disallow its
creation as unsafe
- Add pipeline statistics creation in UnsafeAPIsTest, because it needs
enable extension, add a separate test class for it.
BUG: chromium:1177506
Change-Id: Ic77e04c9c854b396e7240674bd9deb0caf97a513
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53889
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
On macOS 10.15 on AMD GPU, WriteTimestamp cannot be called without any
copy commands on MTLBlitCommandEncoder, otherwise crash occurs. But this
issue is not reproduced on macOS 11.0, just disable timestamp query on
the bad version on AMD.
BUG: dawn:545
Change-Id: I69a012b2091b8ccd251d23ddb26b72e06c07492f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53581
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This allows the client to specify a different release key for the keyed
mutex than the default of acquire key + 1. If the release key is the
sentinel value of UINT64_MAX, it's set to acquire key + 1. Once Chromium
transitions to always specifying the release key, it will be made a
required parameter and the default behavior will be removed.
Bug: chromium:1213977
Change-Id: I327f7157bb7ff23cf216e43043568ce7c6f38a60
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53880
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Implements two basic binding tests requested in a previous review. Moves
ExternalTextureState enum to be private.
Bug: dawn:798
Change-Id: I9e5ac31a92bab26b7d68568802db1fa988e849a9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53700
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones (Intel) <brandon1.jones@intel.com>
If there is an empty row at the beginning of a copy region due to
alignment adjustment, this copy region split by 2D texture splitter
will be definitely incorrect for 3D textures because every depth
slice (except the first slice) will wrongly skip one row. We need
to recompute this copy region via modifying this copy region and
adding a couple more copy regions for the empty first row issue.
The idea of recomputation is:
- modify this copy region and don't copy the last row in order to
make its bufferSize.height not exceed rowsPerImage,
- use one more copy region to handle the last row of each depth
slice except the last depth slice,
- use another copy region to handle the last row of the last depth
slice.
Bug: dawn:547
Change-Id: Ib2f6019963ed29d62a9f13d7316b5f04801db8c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52341
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The unavailable queries are allowed in ResolveQuerySet and resolved to
0s, which has been fixed in
https://dawn-review.googlesource.com/c/dawn/+/48320.
BUG: dawn:434
Change-Id: I72b1f0b621fc22a7a0d30c407c7359e59d7b905c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53762
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Add a toggle named "dump_translated_shaders", and when this toggle
is enabled, translated HLSL shaders will be dumped and log via
Device::EmitLog in the kInfo logging level.
BUG: dawn:792
Change-Id: Ia5ccc96019c32b43aa315f080f80a26919b441e3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53580
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
There have been some bugs seen with this on some platforms.
Bug: dawn:838
Change-Id: I29fa483eee3c299960d2c998fce90d918ac4dc9d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52560
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
When we are copying data, we need to offset "rowsPerImage" rows
for each depth slice, even though this is a partial copy whose
copy height is less than rowsPerImage.
In addition, when we copy the original data into expected buffer
for comparison, we don't pack data for T2B copy and T2T copy. We
don't remove paddings during copy. So I renames PackTextureData
to CopyTextureData. For B2T copy, we do pack data. Right now we
name it CopyXXXX and we pack the data during some copies, it is
understandable. But if we name it PackXXXX but don't pack data
sometimes, it is weird. In addition, for B2T copy, we pack the
data, so I shorten the buffer size we allocated for comparison.
This change also renames "slice" to "layer" if it includes multiple
depth slices and actually means a layer, but keep slice as slice if
it means an array layer or a depth slice for different cases.
Bug: dawn:547
Change-Id: I6d82e6c25f50bd4c988b1f65f85b24ad1c191d01
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53501
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Add timestamp query back in Metal supported extensions, and calculate
the timestamp period based on CPU timestamps and GPU timestamps sampled
on device.
There is a crash issue (dawn:545) on macOS 10.15 on AMD devices, but
cannot be reproduced on macOS 11.0+, we can just disable it on AMD with
macOS 10.15 in the following CL.
Bug: dawn:434
Change-Id: Icb4823e7c3115776e64c6a41fd0aea0f6536ccdf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51720
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
If we are copying a partial of rows, the buffer size doesn't need
to be that large of the entire image which has "rowsPerImage" rows.
There was a bug in texture copy splitter. And this workaround was
introduced at https://dawn-review.googlesource.com/c/dawn/+/30741
in order to workaround that bug. D3D12 validation is actually correct.
Now that we have fixed the bug at
https://dawn-review.googlesource.com/c/dawn/+/52680/. The workaround
is not needed.
Bug: dawn:547, dawn:520
Change-Id: I92292c71dc5479fc2ba863eb9f897516bd1a96a0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53360
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Details:
- Add the logging level type WGPULoggingType, including levels verbose,
info, warning, and error,
- Add the API SetLoggingCallback, which bind the callback to deal with
logging string,
- Add the return command DeviceLoggingCallback and related code,
- Add DeviceBase::EmitLog(WGPULoggingType, const char*) , and
DeviceBase::EmitLog(const char*) use WGPULoggingType_info as default,
to post logging from native or server device to bound callback
via CallbackTaskManager.
BUG: dawn:792
Change-Id: I107b9134ff8567a46fa452509799e10b6862b8d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52200
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Zhaoming Jiang <zhaoming.jiang@intel.com>
This patch implements the asynchronous path of CreateComputePipelineAsync
on D3D12 backend with the basic framework of the dawn_unittest
AsyncTaskTest.Basic.
1. Call the constructor of dawn_native::d3d12::ComputePipeline in the main
thread.
2. Execute dawn_native::ComputePipelineBase::Initialize() (a virtual function)
asynchronously.
3. Ensure every operation in dawn_native::d3d12::ComputePipeline::Initialize()
is thread-safe (PersistentCache).
4. Save all the return values (pipeline object or error message, userdata, etc)
in a CreateComputePipelineAsyncWaitableCallbackTask object and insert this
callback task into CallbackTaskManager.
5. In Callback.Finish():
- Insert the pipeline object into the pipeline cache if necessary
- Call WGPUCreateComputePipelineAsyncCallback
Note that as we always handle the front-end pipeline cache in the main thread,
we don't need to make it thread-safe right now.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I7eba2ce550b32439a94b2a4d1aa7f1b3383aa514
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47900
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is blocking the Tint roll which adds validation that
textureSampleCompare cannot be used in the compute stage.
Simply disabling this test for now since WGSL discussions seem to
indicate there may be a builtin added with a different name and
semantics.
Change-Id: Iaecf5865c9fb38aea3231c3ae823d783a665984d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
In every copy region, its bufferSize.height minus rowsPerImage
can be texture format's blockInfo.height (it is 1 for uncompressed
formats) at most, and it appears only if bytesPerRow is 256 and
copySize on height is a full copy.
This change will benefit 3D texture copy splitter via removing
unwanted empty rows issues. Because empty rows in 3D copy splitter
may lead to recompute/modify copy regions and there might be new
copy regions added.
The removed empty row situations are:
1) Partial copy on height: copySize.height < rowsPerImage *
blockInfo.height
2) bytesPerRow is greater than 512. For example, if bytesPerRow
is 512 and data in one row straddles two rows and there is no
empty row at the first part. The second part will have a fake
empty row if we don't recompute its alignedOffset.
3) There are two empty rows in a copy region. For example:
if data in one row straddles two rows and there is an empty row
in the first copy region. Then there will be two empty rows in
the copy region of the second part if we don't recompute the
alignedOffset.
This change also fixes an issue found by Corentin that copy related
argument "rowsPerImage" should not take effect when we are copying
one single depth or array slice.
Bug: dawn:547
Change-Id: I603291d559de1d05e420e5ed1f4cabf53de5a93f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52680
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Tests are based on the IOSurfaceWrappingTests.
Sampling tests are not implemented, since they would require
support for the samplerExternalOES sampler type in WGSL.
Bug: chromium:1205155
Change-Id: Icc114eaf6efaee93f1b8486e615f0fd307f23080
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50201
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Instead of having it as a decoration.
The old style is now deprecated and will be removed soon.
See https://github.com/gpuweb/gpuweb/pull/1735 for the WGSL spec change.
Bug: tint:846
Change-Id: Id2fa681ddf7b97cd3fa41d7b5538029d96db7e28
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53082
Reviewed-by: Corentin Wallez <cwallez@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This toggle will be used by Chromium to disallow the unsecured SPIR-V
path such that a renderer process can only use WGSL.
This new toggle will be covered by a test in Chromium that ensures that
in the default configuration SPIR-V is disallowed.
Bug: chromium:1214923
Change-Id: Ia67e0c7466044e1086399d995dc841426fe604c9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52781
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This patch removes the function declarations which don't have their
function bodies.
BUG=None
Change-Id: Id16c2a225319331cdbc3a827ebbabf58c16e1dfd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53140
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch re-enables the T2T copy workaroudn on Intel Gen9 and Gen
9.5 GPUs because the latest released Intel D3D driver still cannot
handle some copies correctly in some copy shapes.
BUG=chromium:1161355
Change-Id: Ia96fe05c3e027f56a734331de03fe42745754cc3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/52960
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
And fix a bug where the Metal backend hit an ASSERT when
clearing combined depth/stencil textures by copy.
Bug: dawn:780
Change-Id: Idf3061570f63d0abd3e8a41d0c251db4f6dc7e0c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51840
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Expand coverage for these tests by using combinatorial test
parameterization. Covers more cases and expands coverage to
compressed textures. This caught a bug on Vulkan where only the
first region for multi-layer compressed texture copies was cleared.
It also caught a driver bug on some Intel platforms, where clearing
the non-zero mip of a depth texture does not work.
Bug: dawn:780
Change-Id: Ic601bae111c1c2dd150f569d7e02759ca765201e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51680
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This change mainly is a preparation for 3D texture copy splitter,
which will be based on 2D texture copy splitter and then revise
or recompute incorrect copy regions if needed.
The change itself mainly rename some variables and comments and
distiguish 3D texture copies from 2D (array) texture copies. For
example, term slice is changed to layer if it only refers to layer
slices in 2D textures and it is not shared by depth slices in 3D
textures.
Bug: dawn:547
Change-Id: I6f84134a4fbcb90708901a1059b60e78e1a25ca5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This is a header-only utility so it can be easily included and
used anyhere. Include it in DawnTest.h to automatically pick up
definitions to print test parameters.
Also, work around bot limitations for very-long test names.
Bug: none
Change-Id: I940263ab0a4cc415b06fa04749694f16ff08335c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51841
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch implements the default implementation of WaitableEvent
(AsyncWaitableEvent) with std::condition_variable instead of
std::future as std::future will always block its destructor until
the async function returns, which makes us unable to clean up all
the execution environment of the async task inside the async
function.
This patch also implements WorkerThreadTaskManager to manage all
the async tasks (inherited from WorkerThreadTask) in the future,
for example all the Create*PipelineAsync() tasks.
This patch also updates the related dawn_unittest WorkerThreadTest.
Basic.
BUG=dawn:529
TEST=dawn_unittests
Change-Id: Ie789ba788789e91128ffc416e7e768923828a367
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51740
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This is the last patch to replace DAWN_SKIP_TEST_IF with
DAWN_SUPPRESS_TEST_IF or DAWN_TEST_UNSUPPORTED_IF. With this patch
DAWN_SKIP_TEST_IF will be completely removed from Dawn.
BUG=dawn:779
Change-Id: I5aec03697877ff9c6fa175f8d16eba951dd94cfa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51806
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Not doing so produces an infinite loop when iterating from begin to end.
Bug: none
Change-Id: I323587a19ba1618d7e9a326de2ee398ae5e0bb7b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51762
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Renames all the RenderPipeline*2 stuff to simple RenderPipeline* but
keeps *2 definitionas around as typedefs and wrappers so that users can
migrate away from it.
Bug: dawn:22
Change-Id: If301d81a829bba0646c3a61068f2279932b191e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51764
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This is the first part to completely replace DAWN_SKIP_TEST_IF
with DAWN_SUPPRESS_TEST_IF or DAWN_TEST_UNSUPPORTED_IF.
BUG=dawn:779
Change-Id: I1795eb4271de08667d43f24b64b42d15ca4b8071
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51721
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Fences are no longer part of the WebGPU spec, and have been removed from
Blink.
Bug: dawn:22
Change-Id: I240c4c4107acfaf9facec88a43a38b5ff327c7a6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50702
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Currently, we use the device maximum supported shader model for DXC
compiler. Meanwhile, we should use HLSL version 2018 or above to support
the maximum shader model. Otherwise, it may report below errors:
Explicit template arguments on intrinsic Load requires HLSL version 2018
or above.
Bug: None
Change-Id: I7b1bfd1c08eb5ad30b2f7d59d280678bb71d1d64
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51460
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
These tests are used to demonstrate that different copy scenarios
will impact how TextureCopySplitter to split copy regions for 3D
textures on D3D12.
Bug: dawn:547
Change-Id: I49947387acaa61f4eacbcd5a18c6cd8db913d2d0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Also add macros to make it easier to generate a params struct.
This makes it possible to generate parameterized tests in
dawn_end2end_tests
Bug: none
Change-Id: I009475dcc08a5274f5871237a363489cff7298f1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51000
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This changes the call to SPIRV-Cross in the GLSL backend to always set
the binding= decoration on interface variables instead of changing the
variable name and matching against it as was done previously. This
matching by name was done for macOS's OpenGL driver's old version of GL
but isn't needed now that Dawn has a Metal backend for macOS.
This also fixes opengl::ShaderModule to iterate only on bindings that
are known to the layout as the reflection between SPIRV-Cross and Tint
can be different.
Bug: tint:808
Bug: tint:386
Change-Id: I308b8da5994d8618799cf6583f1b0e5ea2ba2069
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51520
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
`kExternalTexture` was recently added in tint, and now the compiler warns / errors that this isn't handled by the switch.
Add a default that is `UNREACHABLE()`.
Will fix one of the issues preventing a tint -> dawn roll.
Bug: dawn:728
Change-Id: I510526af46e1f1981a7434f615aa8ed5e56534cd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51362
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This patch disables the workaround about the T2T copy issue (the Toggle
UseTempBufferInSmallFormatTextureToTextureCopyFromGreaterToLessMipLevel)
on the latest Intel Gen9 and Gen9.5 D3D driver (27.20.100.9466) which
contains the fix for this issue.
This patch also implements the D3D driver version comparison algorithm
for Intel drivers.
BUG=chromium:1161355
TEST=dawn_end2end_tests
Change-Id: I406598f2c5745214a60bfc43fb732d45360aa1fe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51343
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch introduces two new macros to replace DAWN_SKIP_TEST_IF():
1. DAWN_SUPPRESSED_TEST_IF(): for the tests failing on a specific HW / backend /
OS combination
2. DAWN_TEST_UNSUPPORTED_IF(): for the tests which require an extension or a toggle
to be present /not present or some WIP features.
This patch also adds a command line parameter "--run-suppressed-tests" to disable
the macro DAWN_SUPPRESSED_TEST_IF(), so that we can test any tests that are related
to any specific HW / backend / OS combinations without changing the source code and
re-building dawn_end2end_tests.
This patch also replaces DAWN_SKIP_TEST_IF() with DAWN_SUPPRESSED_TEST_IF() or
DAWN_TEST_UNSUPPORTED_IF() in QueryTests.cpp and ShaderFloat16Tests.cpp to test
the functionality of these two new macros. DAWN_SKIP_TEST_IF() will be completely
replaced by DAWN_SUPPRESSED_TEST_IF() or DAWN_TEST_UNSUPPORTED_IF() in the next
patch.
BUG=dawn:779
Change-Id: I05db632c614b6ad348fcac85da84744e45be3ae1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51341
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Also fix and enable testing for texture initialization on OpenGLES.
This CL also factors code so that opengl::Texture::ClearTexture can
use the DoTexSubImage helper.
Note: Clearing of compressed textures on GL still unimplemented.
Bug: dawn:780
Change-Id: I5c1268ee570f2d4347d365465700dd416fbf5619
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50121
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Also add suppressions for tests failing after the ANGLE roll.
Roll third_party/angle/ 9a025fd44..835bcb1e2 (460 commits; 1 trivial rolls)
9a025fd448..835bcb1e27
$ git log 9a025fd44..835bcb1e2 --date=short --no-merges --format='%ad %ae %s'
2021-05-08 lexa.knyazev Vulkan: Support GL_EXT_texture_sRGB_RG8
2021-05-18 angle-autoroll Roll vulkan-deps from 055e71b2a367 to 3d799e0e9b08 (25 revisions)
2021-05-14 syoussefi Vulkan: Optimize respecifying an image
2021-05-17 syoussefi Vulkan: Fix a bug releasing DynamicBuffer-owned buffer
2021-05-13 cnorthrop Tests: Add Pokemon Go trace
2021-05-13 cnorthrop Capture/Replay: Add const to string pointer
2021-05-13 cnorthrop Capture/Replay: Skip glGetActiveUniform
2021-05-13 cnorthrop Capture/Replay: Reset programs on loop
2021-05-17 cnorthrop Skip Texture2DTest.TextureSize on Linux+GL+TSAN
2021-05-17 jmadill ANGLETest: Skip test setup/teardown on major error.
2021-05-17 jonahr Fix out_of_range error in System_utils_posix
2021-05-14 syoussefi Vulkan: Cleanup texture image respecify
2021-05-13 syoussefi Vulkan: Fix desc set cache bug with xfb offset
2021-05-14 jmadill Gold Tests: Implement flaky retries and sharding.
2021-05-17 angle-autoroll Roll SwiftShader from c4d054c6ad41 to af907708adb3 (2 revisions)
2021-05-17 angle-autoroll Roll Chromium from 3b747dab7bb3 to 9b886afc6e79 (485 revisions)
2021-05-14 gert.wollny Capture/Replay: Add suffix to label for test file search
2021-05-12 gert.wollny Capture/Replay: Print context diff also with frame gaps
2021-05-10 gert.wollny Capture/Replay: track robustResourceInit
2021-04-12 cclao Vulkan: Add webgl conformance/texture-size test
2021-05-14 ianelliott Vulkan: Fix AGI hierarchy
2021-05-12 cclao Skip Texture2DArrayIntegerTestES3.NonZeroBaseLevel on OSX+OpenGL
2021-05-14 syoussefi Vulkan: Disable BufferVk suballocation
2021-05-14 angle-autoroll Roll VK-GL-CTS from 1c4a387382ea to 535dfe49fc49 (1 revision)
2021-05-14 geofflang GL: Recreate textures on eglReleaseTexImage.
2021-05-12 m.maiya Bug fix in glTexParameter and glGetTexParameter validation
2021-05-12 cclao Fix IOSurfaceClientBufferTest.RenderToBGRX8888IOSurface on OSX+OpenGL
2021-05-11 jmadill Test Runner: Add test expectations parser.
2021-05-05 jonahr Reland Change to module directory when loading swiftshader ICD.
2021-04-29 sergeyu [Vulkan] Add DisplayVkNull
2021-05-14 angle-autoroll Roll VK-GL-CTS from 6498f4042d9f to 1c4a387382ea (19 revisions)
2021-05-14 cnorthrop Tests: Update capture_replay_expectations
2021-05-07 cclao Vulkan: Add feature flag to flush at framebuffer boundary
2021-05-12 lubosz.sarnecki TracePerfTests: Don't call framebuffer functions on GLES1.
2021-05-13 jplate CL: Add symbol version map to libOpenCL
2021-05-14 angle-autoroll Roll Chromium from b0687cb1f1ec to 3b747dab7bb3 (328 revisions)
2021-05-09 jplate CL: Implement context for front end and passthrough
2021-05-11 syoussefi Translator: Fix struct/uniform separation w.r.t to arrays
2021-05-13 ianelliott Disable GL_EXT_shader_framebuffer_fetch_non_coherent on Arm/QCOM
2021-05-11 jmadill Allow specifying GPU config on expectation check.
2021-05-11 syoussefi Translator: Fix local var inits vs struct/uniform separation
2021-05-12 gert.wollny Capture/Replay: recreate the EGL window if contexts don't match
2021-05-13 angle-autoroll Roll Chromium from 3fb708290557 to b0687cb1f1ec (639 revisions)
2021-05-11 geofflang Add messages for framebuffer completeness errors.
2021-03-05 syoussefi Vulkan: Allow DynamicBuffer suballocation in BufferVk
2021-05-12 syoussefi Remove teglAndroidUtil.cpp override
2021-05-13 jmadill Test Runner: Fixes to skipped tests.
2021-05-09 jplate CL: device partitioning for front end and passthrough
2021-05-12 sugoi Add array bounds checks for WebGL shaders
2021-05-13 angle-autoroll Roll SwiftShader from be169ef35238 to c4d054c6ad41 (2 revisions)
(...)
2021-04-02 jmadill Add GL_ANGLE_get_serialized_context_string.
2021-03-30 cnorthrop Tests: Add Dragon Raja trace
2021-04-02 jmadill Fix rapidjson build error in Skia.
2021-03-29 cnorthrop Capture/Replay: Support multi-digit context
2021-03-25 cclao Vulkan: Add baseLevel and generateMipmap test for immutable texture
2021-03-25 m.maiya Vulkan: Add YUV G8_B8R8_2PLANE_420_UNORM support.
2021-03-31 cclao Vulkan: Add test render to immutable texture will flush
2021-04-02 angle-autoroll Roll vulkan-deps from a0d5b9653a91 to 61083c4a2ae0 (4 revisions)
2021-03-31 gert.wollny JsonSerializer: use stubs when building without rapidjson
2021-04-02 angle-autoroll Roll Chromium from cc20ce29e7a7 to 9c9ca054e2bc (391 revisions)
2021-04-01 cnorthrop Tests: Add Aztec Ruins trace
2021-04-01 cnorthrop Tests: Add League of Legends: Wild Rift trace
2021-04-02 kainino Revert "Metal: Support importing external metal textures"
2021-03-29 xinghua.cao D3D: fix uniform block alignment error
2021-04-01 ynovikov Fix and re-enable component build of angle_apks
2021-04-01 ynovikov Add Linux, Ozone and Fuchsia chromium.angle bots to CQ
2021-03-13 lehoangq Metal: Support importing external metal textures
2021-03-30 jonahr Don't append newline to empty InfoLog stream.
2021-04-01 angle-autoroll Roll vulkan-deps from 0a4b29c05e71 to a0d5b9653a91 (6 revisions)
2021-04-01 angle-autoroll Roll Chromium from e4067deef470 to cc20ce29e7a7 (104 revisions)
2021-03-31 jonahr Revert "Reland "Add support for Linux GPU info with Vulkan backend""
2021-04-01 angle-autoroll Roll Chromium from c181ac047c8b to e4067deef470 (350 revisions)
2020-07-18 lehoangq Metal: implement ANGLE_device_metal extension.
2021-03-31 ynovikov Reland "Link angle_util statically into angle_system_info_test"
2021-03-12 jonahr GLX: Always call XSync on creation/destruction of WindowSurfaces
2021-03-31 syoussefi Add a gl-d3d-only target for the translator
2021-03-30 cclao Vulkan: Split fragment shader from ColorAttachmentAndAllShadersRead
2021-03-30 jmadill Enable messenger_lite trace on SwiftShader.
2021-03-26 syoussefi Vulkan: Remove spam output regarding pipeline cache
2021-03-31 chonggu [Fuchsia] Use manifest fragments for Cr-Fuchsia binaries
2021-03-31 angle-autoroll Roll vulkan-deps from 4b3769b941e6 to 0a4b29c05e71 (2 revisions)
2021-03-31 angle-autoroll Roll Chromium from 8599134e632f to c181ac047c8b (466 revisions)
2021-03-19 timvp Detach separable shaders
2021-03-17 timvp Support linking PPOs without attached Shaders
2021-03-30 syoussefi Vulkan: Temporarily use GOOGLEX instead of EXT for MSRTSS
2021-03-25 rafael.cintron Check return value of allocateResource instead of asserting
2021-03-17 timvp Update PPO's executable when attached program is re-linked
2021-03-30 ynovikov Replace Win x86 dEQP GPU.FYI bot with chromium.angle bot
2021-03-30 angle-autoroll Roll vulkan-deps from e0d8a486f6d5 to 4b3769b941e6 (3 revisions)
2021-03-30 angle-autoroll Roll SwiftShader from fb53aa2bb7da to 4c0f888d7ef8 (1 revision)
2021-03-30 angle-autoroll Roll Chromium from 26bf9bb622f1 to 8599134e632f (396 revisions)
2021-03-17 timvp Reland "Save/Load missing members"
2021-03-29 syoussefi Don't link with SPIR-V repos if !vulkan && !metal
2021-03-15 gert.wollny Capture/Replay: serialize context to JSON
2021-03-15 gert.wollny Capture/Replay: Enable GetTexImage tests
2021-02-23 gert.wollny capture/replay: impl CaptureGetRenderbufferImageANGLE_pixels
2021-03-25 penghuang Only enable framebufferMultisample with framebufferBlitANGLE
2021-02-23 gert.wollny capture/replay: implement CaptureGetTexImageANGLE_pixels
2021-03-29 angle-autoroll Roll vulkan-deps from 7079d8df17da to e0d8a486f6d5 (7 revisions)
2021-03-29 angle-autoroll Roll Chromium from e0abc3035c46 to 26bf9bb622f1 (218 revisions)
Roll third_party/vulkan-deps/ 105af117f..3d799e0e9 (225 commits)
https://chromium.googlesource.com/vulkan-deps/+log/105af117f053..3d799e0e9b08
$ git log 105af117f..3d799e0e9 --date=short --no-merges --format='%ad %ae %s'
2021-05-18 chromium-autoroll Roll Vulkan-ValidationLayers from 2b22f2703be9 to 1d86b3235b42 (1 revision)
2021-05-17 chromium-autoroll Roll Vulkan-ValidationLayers from 2d7f42a44fa7 to 2b22f2703be9 (3 revisions)
2021-05-17 chromium-autoroll Roll Vulkan-ValidationLayers from c46a663b305b to 2d7f42a44fa7 (1 revision)
2021-05-17 chromium-autoroll Roll Vulkan-Tools from 1d176506710c to f89f72e10562 (1 revision)
2021-05-17 chromium-autoroll Roll Vulkan-ValidationLayers from 38bdcddf817f to c46a663b305b (3 revisions)
2021-05-15 chromium-autoroll Roll Vulkan-ValidationLayers from 957552062392 to 38bdcddf817f (1 revision)
2021-05-14 chromium-autoroll Roll Vulkan-ValidationLayers from 6da4ac2df971 to 957552062392 (1 revision)
2021-05-14 chromium-autoroll Roll Vulkan-ValidationLayers from da6b48f6f5f2 to 6da4ac2df971 (2 revisions)
2021-05-14 chromium-autoroll Roll SPIRV-Tools from 18d45142e7a2 to f0d110e3058b (1 revision)
2021-05-13 chromium-autoroll Roll Vulkan-ValidationLayers from 2e2e61e6aeb4 to da6b48f6f5f2 (1 revision)
2021-05-13 chromium-autoroll Roll Vulkan-ValidationLayers from e27f26557588 to 2e2e61e6aeb4 (3 revisions)
2021-05-13 chromium-autoroll Roll Vulkan-ValidationLayers from 20678fff2a19 to e27f26557588 (4 revisions)
2021-05-13 chromium-autoroll Roll SPIRV-Tools from 010cd289db8b to 18d45142e7a2 (1 revision)
2021-05-12 chromium-autoroll Roll SPIRV-Tools from f6b59599ae6c to 010cd289db8b (1 revision)
2021-05-12 chromium-autoroll Roll SPIRV-Tools from de1cae069c06 to f6b59599ae6c (1 revision)
2021-05-11 chromium-autoroll Roll Vulkan-Tools from c251814e52e6 to 1d176506710c (1 revision)
2021-05-11 chromium-autoroll Roll Vulkan-Tools from 6407a0c8a489 to c251814e52e6 (1 revision)
2021-05-11 chromium-autoroll Roll Vulkan-Tools from 535fc4091298 to 6407a0c8a489 (1 revision)
2021-05-11 chromium-autoroll Roll glslang from d234552c3095 to 202c8abae0a3 (1 revision)
2021-05-11 chromium-autoroll Roll Vulkan-Loader from 039cea5353be to a132dee142c0 (1 revision)
2021-05-11 chromium-autoroll Roll Vulkan-Tools from 202eb962485c to 535fc4091298 (1 revision)
2021-05-11 chromium-autoroll Roll Vulkan-ValidationLayers from 0aca21bce7bc to 20678fff2a19 (15 revisions)
2021-05-11 chromium-autoroll Roll Vulkan-Tools from 4ee5f2a8bee0 to 202eb962485c (1 revision)
2021-05-11 chromium-autoroll Roll glslang from 9431c53c84c1 to d234552c3095 (1 revision)
2021-05-11 chromium-autoroll Roll SPIRV-Tools from 1020e394cb12 to de1cae069c06 (1 revision)
2021-05-11 chromium-autoroll Roll Vulkan-ValidationLayers from 5ef1ec1b87b1 to 0aca21bce7bc (6 revisions)
2021-05-10 chromium-autoroll Roll Vulkan-Headers from 3f437c4a94ae to 9af411e83fb0 (1 revision)
2021-05-07 chromium-autoroll Roll Vulkan-ValidationLayers from 6330153b2b84 to 5ef1ec1b87b1 (2 revisions)
2021-05-07 chromium-autoroll Roll glslang from 41e39c615b14 to 9431c53c84c1 (1 revision)
2021-05-07 chromium-autoroll Roll SPIRV-Cross from 0eeaffe048b9 to 418542eaefdb (1 revision)
2021-05-07 chromium-autoroll Roll SPIRV-Cross from 72a2ec4c1b56 to 0eeaffe048b9 (1 revision)
2021-05-06 chromium-autoroll Roll Vulkan-ValidationLayers from 157c4bfe15cf to 6330153b2b84 (1 revision)
2021-05-05 chromium-autoroll Roll Vulkan-ValidationLayers from 5f40eb72ecd0 to 157c4bfe15cf (1 revision)
2021-05-05 chromium-autoroll Roll Vulkan-ValidationLayers from 3cafbf75e124 to 5f40eb72ecd0 (1 revision)
2021-05-05 chromium-autoroll Roll Vulkan-ValidationLayers from 3fa29a63072b to 3cafbf75e124 (7 revisions)
2021-05-04 chromium-autoroll Roll Vulkan-Loader from f14e11c9bf69 to 039cea5353be (1 revision)
2021-05-04 chromium-autoroll Roll Vulkan-Loader from 91955fbcff84 to f14e11c9bf69 (1 revision)
2021-05-04 chromium-autoroll Roll Vulkan-ValidationLayers from 0e7f7a9e108b to 3fa29a63072b (2 revisions)
2021-05-04 chromium-autoroll Roll Vulkan-Loader from 5dcea8a449c8 to 91955fbcff84 (1 revision)
2021-05-04 chromium-autoroll Roll SPIRV-Tools from 8ec9f456e614 to 1020e394cb12 (1 revision)
2021-05-04 chromium-autoroll Roll Vulkan-ValidationLayers from 6eaf131c0cd7 to 0e7f7a9e108b (2 revisions)
2021-05-03 chromium-autoroll Roll Vulkan-ValidationLayers from 61225265ebac to 6eaf131c0cd7 (1 revision)
2021-05-03 chromium-autoroll Roll glslang from 186bccdd9f8a to 41e39c615b14 (1 revision)
2021-05-03 chromium-autoroll Roll glslang from 56b17b2f2dfc to 186bccdd9f8a (1 revision)
2021-05-03 chromium-autoroll Roll Vulkan-ValidationLayers from cd5ffbe1bac1 to 61225265ebac (1 revision)
2021-05-03 chromium-autoroll Roll Vulkan-ValidationLayers from 884579ec2928 to cd5ffbe1bac1 (1 revision)
2021-05-03 chromium-autoroll Roll Vulkan-ValidationLayers from 5f00f84a15f6 to 884579ec2928 (1 revision)
2021-04-30 chromium-autoroll Roll Vulkan-ValidationLayers from a19068db1b8b to 5f00f84a15f6 (2 revisions)
2021-04-30 chromium-autoroll Roll Vulkan-ValidationLayers from 7ab4afe5052d to a19068db1b8b (1 revision)
2021-04-29 chromium-autoroll Roll Vulkan-ValidationLayers from 5363130b7570 to 7ab4afe5052d (3 revisions)
(...)
2021-03-26 chromium-autoroll Roll SPIRV-Cross from 84d1f8aa2a40 to 28ae7b8f357c (1 revision)
2021-03-26 chromium-autoroll Roll Vulkan-ValidationLayers from 5c65b37c60d8 to 0cee3a4e5088 (2 revisions)
2021-03-26 chromium-autoroll Roll SPIRV-Tools from f22793015360 to d0c73fcee18f (1 revision)
2021-03-25 chromium-autoroll Roll Vulkan-ValidationLayers from b1a10a4bc609 to 5c65b37c60d8 (3 revisions)
2021-03-25 chromium-autoroll Roll SPIRV-Tools from ecc840d30b69 to f22793015360 (1 revision)
2021-03-24 chromium-autoroll Roll Vulkan-ValidationLayers from 8d63a36ca533 to b1a10a4bc609 (1 revision)
2021-03-24 chromium-autoroll Roll Vulkan-ValidationLayers from 56b864783fd2 to 8d63a36ca533 (1 revision)
2021-03-24 chromium-autoroll Roll SPIRV-Tools from d20c9c2cf3fb to ecc840d30b69 (1 revision)
2021-03-24 chromium-autoroll Roll Vulkan-Tools from 27c21248221f to 1d3ce716dfef (1 revision)
2021-03-23 chromium-autoroll Roll Vulkan-Loader from f17f507c2472 to 5180defc0195 (1 revision)
2021-03-23 chromium-autoroll Roll Vulkan-ValidationLayers from 50fb183594f5 to 56b864783fd2 (1 revision)
2021-03-23 chromium-autoroll Roll SPIRV-Tools from bed84792f9dd to d20c9c2cf3fb (1 revision)
2021-03-23 chromium-autoroll Roll Vulkan-Loader from 1353e80d87b4 to f17f507c2472 (1 revision)
2021-03-23 chromium-autoroll Roll glslang from c51a774ebdd2 to 2c7c84c8ac99 (1 revision)
2021-03-23 chromium-autoroll Roll SPIRV-Tools from edb8399b0ff3 to bed84792f9dd (3 revisions)
2021-03-23 chromium-autoroll Roll Vulkan-ValidationLayers from 96810e2a54f8 to 50fb183594f5 (2 revisions)
2021-03-22 chromium-autoroll Roll glslang from 6701c2540bb2 to c51a774ebdd2 (2 revisions)
2021-03-22 chromium-autoroll Roll Vulkan-ValidationLayers from cd8d97e985a4 to 96810e2a54f8 (1 revision)
2021-03-22 chromium-autoroll Roll glslang from 847a19cd2b42 to 6701c2540bb2 (2 revisions)
2021-03-22 chromium-autoroll Roll Vulkan-ValidationLayers from 0480f13e233c to cd8d97e985a4 (1 revision)
2021-03-22 chromium-autoroll Roll Vulkan-ValidationLayers from a8918dfc53cf to 0480f13e233c (1 revision)
2021-03-22 chromium-autoroll Roll Vulkan-Headers from 89d366355e6f to a8d6ab19d197 (1 revision)
2021-03-21 chromium-autoroll Roll SPIRV-Tools from 6382cbb4973e to edb8399b0ff3 (1 revision)
2021-03-20 chromium-autoroll Roll SPIRV-Tools from 6578899781f6 to 6382cbb4973e (1 revision)
2021-03-20 chromium-autoroll Roll SPIRV-Tools from 75d7c14cfb07 to 6578899781f6 (1 revision)
2021-03-20 chromium-autoroll Roll SPIRV-Tools from f2a19b0150b9 to 75d7c14cfb07 (1 revision)
2021-03-19 chromium-autoroll Roll glslang from 979319b9b161 to 847a19cd2b42 (1 revision)
2021-03-19 chromium-autoroll Roll Vulkan-ValidationLayers from 309d9bea0956 to a8918dfc53cf (3 revisions)
2021-03-19 chromium-autoroll Roll SPIRV-Tools from 8f421ced3e05 to f2a19b0150b9 (1 revision)
2021-03-19 chromium-autoroll Roll SPIRV-Tools from 2b0d16a05905 to 8f421ced3e05 (1 revision)
2021-03-19 chromium-autoroll Roll SPIRV-Tools from a732e4c03cc1 to 2b0d16a05905 (1 revision)
2021-03-19 chromium-autoroll Roll SPIRV-Tools from a611be7782de to a732e4c03cc1 (1 revision)
2021-03-18 chromium-autoroll Roll glslang from d18bcd64fa40 to 979319b9b161 (1 revision)
2021-03-18 chromium-autoroll Roll Vulkan-ValidationLayers from b6c181342bff to 309d9bea0956 (2 revisions)
2021-03-18 chromium-autoroll Roll Vulkan-ValidationLayers from f8f145df59a7 to b6c181342bff (1 revision)
2021-03-18 chromium-autoroll Roll Vulkan-ValidationLayers from d5bf0be344f5 to f8f145df59a7 (2 revisions)
2021-03-18 chromium-autoroll Roll SPIRV-Tools from 4f498774db52 to a611be7782de (1 revision)
2021-03-18 chromium-autoroll Roll glslang from f5929b8c5f83 to d18bcd64fa40 (1 revision)
2021-03-17 chromium-autoroll Roll glslang from b2e5b5c559e1 to f5929b8c5f83 (1 revision)
2021-03-17 chromium-autoroll Roll Vulkan-ValidationLayers from 894604a86c46 to d5bf0be344f5 (1 revision)
2021-03-17 chromium-autoroll Roll Vulkan-ValidationLayers from e53e4e5f0cdc to 894604a86c46 (1 revision)
2021-03-17 cwallez OWNERS: Replace dsinclair with cwallez
2021-03-17 chromium-autoroll Roll SPIRV-Tools from c040bd3ae5fa to 4f498774db52 (1 revision)
2021-03-17 chromium-autoroll Roll SPIRV-Tools from 8866fd7ae27e to c040bd3ae5fa (1 revision)
2021-03-17 chromium-autoroll Roll SPIRV-Tools from 79ab273f997e to 8866fd7ae27e (3 revisions)
2021-03-16 chromium-autoroll Roll SPIRV-Tools from 042eff73fe0d to 79ab273f997e (1 revision)
2021-03-16 chromium-autoroll Roll Vulkan-ValidationLayers from 60f29ec48880 to e53e4e5f0cdc (3 revisions)
2021-03-16 chromium-autoroll Roll Vulkan-ValidationLayers from 053e2bf22dd2 to 60f29ec48880 (3 revisions)
2021-03-16 chromium-autoroll Roll SPIRV-Tools from 4100477e76c8 to 042eff73fe0d (2 revisions)
2021-03-16 chromium-autoroll Roll SPIRV-Tools from 478754c00537 to 4100477e76c8 (1 revision)
Bug: dawn:789
Created with:
roll-dep third_party/angle third_party/vulkan-deps
Change-Id: Iacc6680ee6168390d1bf88b5bafdcef59475159d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51361
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Currently we use offset to calculate the index of the queries in
timestamp compute shader, which is incorrect. The offset is the buffer
offset where we start to write the query results, and has nothing to
do with query index. In the query availability detection, the query
index should be based on the parameter firstQuery.
Add new test for resolving a timestamp query twice to the same
destination buffer with potentially overlapping ranges.
Bug: dawn:434
Change-Id: I2b5c5b192cf5d987ac48187e8240a25937957f51
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50760
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This permits enabling the OpenGL and OpenGL ES backends independently.
This change also enables the OpenGL ES backend on Windows.
This will cause the end2end tests to run on OpenGL ES on the
GPU-less bots, via SwANGLE.
Bug: dawn:580
Change-Id: I43d514b18862d176610b95e97013a67723ddac20
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50881
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Force the use_tint_generator toggle so that Tint is used as much as
possible in fuzzers to get coverage of the relevant code.
This will also fix a recurring fuzzer issue that required a code
transform that only exists in the Tint path: bindings must be renumbered
otherwise we hit an integer overflow in Swiftshader's descriptor set
writes.
Bug: chromium:1209602
Change-Id: Ie868fb07306f96a8ecf42a687313e0a466041a45
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51240
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
The change renames Texture2DCopySplit and copies2D to
TextureCopySubresource and copySubresources respectively.
Because they are not used for 2D only.
I didn't change Texture2DCopySplit to TextureCopySplit in order
to reflect its meaning and distinguish it from TextureCopySplits.
TextureCopySubresource is a collection of copy regions for either a
single layer of a 1D/2D texture or all depth slices on the same
mip level of a 3D texture (They are exactly what subresources are).
It also renames function ComputeTextureCopySplit to
ComputeTextureCopySubresource, and a couple similar renaming.
Bug: dawn:547
Change-Id: I17f8b349e209af0ed1ccaee4634be1e8235a63b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50920
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Use the device maximum supported shader model for DXC compiler.
Bug: None
Change-Id: I05f66d499405a3512a43daca35bb20be84f1f6c5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51080
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
The previous matmul is using 1-dimensional shared array. This PR
adds the 2-dimensional shared array. The perf result shows that:
1. For 1-dimensional shared array, enabe-robustness wil bring almost 2x
regression both for matmulFloat and matmulVec4 on Intel CFL.
2. For 2-dimensional shared array, enabe-robustness will bring almost 2x
regression on matmulFloat. But have little impact on matmulVec4 on Intel
CFL.
Tested on Intel_R_UHD_Graphics_630.
shader enable robustness disable robustness
MatMulFloatOneDimSharedArray 5383 us 3105 us
MatMulFloatTwoDimSharedArray 4788 us 2608 us
MatMulVec4OneDimSharedArray 3070 us 1743 us
MatMulVec4TwoDimSharedArray 1840 us 1802 us
Bug: dawn:594
Change-Id: Ia29a78cf70649ef8d3ba8476db1ad4d6ded80840
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50481
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Added in https://dawn-review.googlesource.com/c/tint/+/50742
Bindings may not collide except on the D3D12 backend where we use
the register offset as the binding number. Offsets may alias if
they are for different HLSL register types (buffer, texture, etc.)
Bug: tint:797
Change-Id: I020e3b5cd1d35fdf5678b587225507e0cf24f5b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50801
Commit-Queue: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Certain backends performs transformations on the tint::Program in the ShaderModule.
These transformations may raise diagnostics.
Tint diagnostics generated from an underlying tint::Source::File need that File kept alive.
Change-Id: I32deceb4cedb419e914631d342884fc27972b5cb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50581
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Skip these tests on D3D12 because it is not implemented yet.
Bug: dawn:547
Change-Id: I0a009b00bd26bb04794bb627c53f4540462f1ca7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50243
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Yunchao He <yunchao.he@intel.com>
Bug: dawn:783
Change-Id: I3c7f0ffc3f45a0d67b411a39342e89c710604d54
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50244
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This is more consistent with the other backends that have a
CommandRecordingContext.
Bug: dawn:780
Change-Id: Icb689d00cc4d873a489fc4d4c247feeb15f8797c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50120
Commit-Queue: Stephen White <senorblanco@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Adds UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout (0x4dae5635)
initially, since we can see that it's causing issues with the WebGPU CTS
tests.
Change-Id: I862e3986d59ae590458f9011a16cc824bf752e72
Bug: dawn:785
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50423
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch skips CopyTests_T2B/CopyOneRowWithDepth32Float on all
D3D12 backends because it fails on many D3D12 drivers.
See https://crbug.com/dawn/727 for more details.
BUG=dawn:727
TEST=dawn_end2end_tests
Change-Id: I3d2c4cf363772939796a71c7efa165e57ed6ba41
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50280
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is now handled inside the SPIR-V sanitizing transform and can be
enabled via a transform config option.
Fixed: tint:753
Change-Id: I897c60dd304dd4643cc905a8ca3001dd963c5fb0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50060
Auto-Submit: James Price <jrprice@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This CL complete the validation rules for CopyTextureForBrowser by:
- Restrict source texture must have |CopySrc| and |Sampled| usage.
- Restrict destinaton texture must have |CopyDst| and
|RenderAttachment| usage.
- Restrict sample counts of source texture and destination texture
must be 1.
- Restrict source copy origin.z must be 0.
- Restrict CopyTextureForBrowser() can only copy to single slice.
A validation unittest is added to check.
BUG=dawn:465
Change-Id: I5e645a4b69edeaf97ce1231bd7c8036027524ba8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49306
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Below are the list of all the individual changes, which are a good order
in which to review this CL.
Core changes:
- Change the tracking in the frontend to produce a synchronization
scope per dispatch instead of per compute pass. Some bindgroups might
not be part of any synchronization scopes so we also track all the
referenced resources on the side so they can be checked during
Queue::Submit validation.
- Fix clearing in the GL and Metal backends to use the per-dispatch
synchronization scopes.
- Fix the Vulkan backend to use the per dispatch synchronization scopes
to produce the correct pipeline barriers. This allows the removal of
previous logic that was subtly incorrect for Indirect buffer. This
allows the merging of the Compute and Render DescriptorSetTracker into
a single small helper class.
- D3D12 changes are similar to Vulkan, but the simplification is just a
the suppression of a branch with a lot of code in
BindGroupStateTracker.
Test changes:
- Fixup all the ResourceUsageTracking tests to follow the WebGPU spec
for synchronization scopes (fixing a lot of TODOs).
- Add additional tests checking that Indirect buffers are not allowed
to be used as a writeable storage in the same synchronization scope.
- Add tests for Queue::Submit validation correctly taking into account
resources that are bound but unused in compute passes.
- Add an end2end test for using a buffer as Indirect and Storage at the
same time in a DispatchIndirect, which would previously produce
incorrect barriers in the Vulkan and D3D12 backends.
Other small changes (that I was to lazy to put in a different CL):
- Add the utils::MakePipelineLayout helper function.
- Fix Indirect not being in the list of readonly buffer usages (caught
by a test added in this CL).
Bug: dawn:632
Change-Id: I77263c3535a4ba995faccbf26255da9a2f6ed3b5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49887
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This workaround was only necessary in the Metal backend but it was easy
to put it in the frontend so it was put there. However, this simplification
gets in the way of a validation change in the follow-up CL. So we move
the nooping to the Metal backend.
Bug: dawn:632
Change-Id: I0a9957a1bc9bdd7867eb8c60fcab710832c13af2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49886
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This change is a preparation for making the compute pass track the
synchronization scope usages per dispatch instead of for the whole pass.
This CL just separates the Compute and RenderPassResourceUsage types.
This requires making the difference between
SyncScope/ComputePass/RenderPass ResourceUsageTracker instead of having
a single combined tracker.
This change also duplicates SetBindGroup by removing the common handling
in ProgrammablePassEncoder and putting it in ComputePassEncoder and
RenderEncoderBase. This is necessary because the UsageTracker types are
now split, but it will also help have different handling of SetBindGroup
for compute and render in follow-up CLs.
There are no functional changes.
Bug: dawn:632
Change-Id: I482c04483d8b734fb10e44e717071eedcff2f15f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49884
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This makes error messages from command buffers more useful because they
keep the whole stack trace instead of just showing that the error was
created in the CommandBuffer::Finish call.
Bug: dawn:632
Change-Id: I23e66045c3caa1ad086003a04eed78c40aefc562
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49885
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This change is a preparation for making the compute pass track the
synchronization scope usages per dispatch instead of for the whole pass.
- Split the tracking of render and compute passes usages.
- Rename PassTextureUsage to TextureSubresourceUsage since is it not
per-pass
- Add SyncScopeResourceUsage as a subclass of PassResourceUsage to
start modifying some of the code to work with synchronization scopes
(even if syncscope == pass at the moment).
There are no functional changes.
Bug: dawn:632
Change-Id: Ieeb6d70a44dc1c726f26989eebcd87e63e732785
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49883
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch implements CallbackTask and CallbackTaskManager to store
the callbacks of Create*PipelineAsync().
In the futureCallbackTaskManager will manage all the callbacks that
should be called in Device.Tick().
BUG=dawn:529
Change-Id: I6ad4352371eb44515bc2d85cdc68220c9b758b8e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49060
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Mip dimension should be greater than or equal to 1, while width >> level
may lead to 0.
Bug: dawn:547
Change-Id: Ib3dfb9fbdbed0e922df6efa366598eff0ca10df2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49506
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Note that a slice somehow means a subresource on D3D12. There
are mip slice, array slice, and plane/aspect slice in D3D12.
We reuse the term "slice" for multiple depth of a 3D texture,
although one single depth slice of multiple depth slices is
not a separate subresource of a 3D texture (all these depth
slices for one mip are a separte subresource in 3D texture).
For the reason above, this change also renames "slice" to
"layer" in some functions if "slice" is a layer in that
function. Because a layer is definitely a subresource but a
slice may not be (like a single depth slice of a 3D texture).
Bug: dawn:547
Change-Id: I88b8120ef7f73bfc261fc225f4242924da221654
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49240
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This patch fixes the incorrect return status of Create*PipelineAsync
when device is lost by explicitly calling and clearing all the
Create*PipelineAsync callbacks in DeviceBase::HandleError() when the
device is lost.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I67a8047b2e5a54f6f85c5a4cbcf420b744ac0d5c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Remove d3d12.li, dxgi.lib and d3d11.lib dependencies when targeting UWP.
Add dxgi.lib only for DXGIGetDebugInterface1 in debug build when targeting UWP.
Use DXGIGetDebugInterface1 only in debug build when targeting UWP.
Bug: dawn:766
Change-Id: I5fa53dbb257acf604836f861f75a122a7d417e7c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49040
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: 陈俊嘉 <cjj19970505@live.cn>
This patch removes an incorrect ASSERT(IsComplete()) in the
destructor of AsyncWaitableEvent because when the destructor of
AsyncWaitableEvent is called, the async task attached to mFuture
may not be completed and the status of mFuture may not be 'ready'.
In fact in C++14 we can always guarantee the attached async task
is completed after the destruction of mFuture.
BUG=dawn:529
Change-Id: I2f28246beb025a0d39dd432a404c0b04aed17249
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
GBV's ability to patch shaders with validation code
was hanging several end2end tests. Since disabling
GBV shader patching would render partial validation
ineffective, partial validation was re-mapped to have
GBV disabled while full validation enables GBV by default.
End2end tests now default to partial validation so
tests that would otherwise not run with GBV can still
have some coverage.
BUG=dawn:592
Change-Id: Iafb271b5ee8862592152fa45c34f188d64432e60
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46725
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Auto-Submit: Bryan Bernhart <bryan.bernhart@intel.com>
This avoids breaking dependents when they use a version of clang that's
different than the one being tested on Dawn CQ.
Also re-enable -Wdeprecated-copy(-dtor)
Bug: chromium:1201858
Change-Id: I09763fdb98e7dba53b4d9fa66fa4c606620a0078
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49100
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Remove the following 2 function declarations since their function
bodies are no longer available.
1. ResultOrError<Ref<RenderPipelineBase>> CreateRenderPipeline(
const RenderPipelineDescriptor* descriptor);
in src/dawn_native/Device.h
2. BufferUploader* GetBufferUploader() const;
in src/dawn_native/vulkan/DeviceVk.h
BUG=none
Change-Id: I55a92a4acb3af3ea4807bfd0b58a0246d0b28cc9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/49061
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Add necessary cflags and cflags_cc for winrt compilation.
Add 'dawn_is_winuwp'.
Set 'dawn_enable_vulkan' and 'dawn_supports_glfw_for_windowing' when compiling for UWP.
Link d3d12, d3d11 and dxgi stub libs when compiling for UWP.
Use LoadPackagedLibrary instead of LoadLibraryA in DynamicLib when compiling for UWP.
Swapchain related changes will be in another commit.
Bug: dawn:766
Change-Id: I1210798a21cc175bab77281403d262d4bfb02d99
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48480
Commit-Queue: 陈俊嘉 <cjj19970505@live.cn>
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
This CL adds two helpers for more ergonomic processing of
ChainedStructs.
1. FindInChain(): Iterates through the chain and automatically
casts the ChainedStruct into the appropriate child type before
returning.
2. ValidateSTypes(): Verifies that the chain only contains structs
with sTypes from a pre-defined set. This also allows the caller
to specify one-of constraints.
3. ValidateSingleSType(): Verifies that the chain contains a
single struct with a specific sType or is an empty chain. This
is a common case of |ValidateSTypes()| and is separated out as
a fast-path.
Change-Id: I938df0bf2a9b1800b1105fb7f80fbde20bef8ec8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47680
Commit-Queue: Brian Ho <hob@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Previously this was being indirectly supplied by <memory>, which has
been removed. Clang happily still finds std::forward, but GCC does
not.
BUG=dawn:768
Change-Id: I87e6bb6aa83bc7f3253c58e32fa0ba977752858c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48820
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
- Add vkCmdFillBuffer in ResolveQuerySet to clear the buffer to 0s for
these unavailable queries if the buffer has been initialized or fully
used which won't been initialized with 0s again.
- Because vkCmdFillBuffer has driver issue on Intel Windows, Skip some
affected cases.
- Remove unsafe api checking from Occlusion Query.
Bug: dawn:434
Change-Id: Ib34f81d93b0de8f08f0eeebf3c8a967eeb5ecefb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48320
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This will help detect cases where the mapped data is used after it is
freed, in particular in WebGPU tests around the interaction of mapping
and GC.
Bug: chromium:971949
Change-Id: I820d9885d39379fbc95c6504b9a4151053768d93
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48382
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch moves the initialization of DXC libraries from
BackendD3D12::GetOrCreateXXX() to Device::Initialize() so
that we don't need to deal with those lazy initializations
in the asynchronous path of Create*PipelineAsync().
BUG=dawn:529
Change-Id: I792847c138738ae8c300d7a1bf3d23fc8fecd746
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48580
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This test was passing on SPIRV-Cross due to SPRIV-Cross's
overreporting of binding information per entry point. On Tint it was
failing, because the resources in the vertex shader were not being
referenced, so not being reported. I have corrected the values passed
to the utility code that generates the shaders, so that it generates
the needed references.
I have also slightly tweaked the test, so it will distinguish between
failure states better.
BUG=tint:716
Change-Id: If88f600a36cba8b580d888e902b8d8102e05bd10
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48520
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
unique_ptr's destructor sets itself to null and frees its owned
memory. This is a problem because for the slab allocator, the
member variable holding the unique_ptr is inside the freed memory.
Bug: skia:10501
Change-Id: I41179261041fe415bb2af3667114b079f61b3c7b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48100
Auto-Submit: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Use tint::transform::DataMap for inputs as well as outputs.
This allows tint to nest transforms inside each other (e.g. embedding
transforms inside sanitizers), and still having a consistent way to pass
data in and out of these transforms, regardless of nesting depth.
Transforms can also now be fully pre-built and used multiple times as
there is no state held by the transform itself.
Bug: tint:389
Change-Id: If1616c77f2776be449021a32f4a6b0b89159aa2a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48060
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Previously all uses of reentrant object creation in Dawn native
needed to manually AcquireRef. Change them to use CreateFooInternal that
returns a ResultOrError<Ref<>> and are renamed to CreateFoo.
Bug: dawn:723
Change-Id: Ifcda3659d02cc5a4c63c248dc53af7fee7c4a61d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46626
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
As of https://github.com/gpuweb/gpuweb/pull/1352 the spec indicates that
GPURenderPassColorAttachmentDescriptor and
GPURenderPassDepthStencilAttachmentDescriptor should use .view rather
than .attachment to indicate the TextureView associated with the
render pass attachment.
Bug: dawn:762
Change-Id: I70d615e19d8e7aae5b26aa5965c7109289ab868b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47902
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Tint now sorts struct members with entry point IO attributes.
Bug: tint:710
Change-Id: I7bb37cab2f101fbcf55dd8b42ee3b3af1250bf1a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47840
Commit-Queue: Brandon Jones <bajones@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Brandon Jones <bajones@chromium.org>
This reverts commit 5c9b6a8f81.
The issue has now been fixed in Tint and rolled into Dawn.
Fixed: dawn:758
Change-Id: Id7deb6cea9f22ee8c5f345a28d2d37499b47d692
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/48080
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: James Price <jrprice@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Matches most recent spec changes. setBlendColor has been marked as
deprecated.
Bug: chromium:1199057
Change-Id: I4584ce789bd7d14401244509d5ada62a46236a5d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47901
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Several of the enum names have changed recently. Update them to match
the spec and mark the older ones as deprecated.
BUG: chromium:1199057
Change-Id: I7a29588dd18b8fb738773c2478b173093f2aa834
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47860
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
A Dawn CL landed at the same time as a Tint roll in Dawn, causing
failures in a large number of D3D12 use_tint_generator. Disable testing
of that configuration entirely while we investigate the issue and fix
it.
Bug: dawn:758
Change-Id: I6c897efc637821a20281c91668889ae95c1c2b1a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47774
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Changes I/O to use function parameters and return values, removes
unnecessary "-> void" return types, and changes "const" to "let".
BUG: dawn:755
Change-Id: Iabbfcc280fae37d73cba6a2f7e2215ed579a04e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47700
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Fixes issues with OpenGL when using the newer style of WGSL I/O that
relies on function parameters and return values. Also added several
end2end tests to cover different variants of that style of I/O.
BUG: dawn:755
Change-Id: I73b4b07ce924ce22e917bf399be705dc67519037
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47701
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Refactors support for toggle control flags, --enable-toggles= &
--disable-toggles, from the end2end tests into a utility class to make
them available elsewhere. The unittests now uses this utility class to
parse toggle control flags.
For some toggles, like 'use_tint_generator', the unittests are known to
be broken with them turned on. They will be fixed in subsequent CLs.
BUG=dawn:756
Change-Id: Ic283e8a82bedcbf255258cca3e62f58c79d3857b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47740
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Use the same pattern for all conditionals: single-call, then row-by-row,
2D case, then 3D.
Bug: dawn:684
Change-Id: I410183815299e9ec2d90790809a056dd578771e3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47320
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
We augment the DoTexSubImage() call for the desktop GL fast path
for compressed textures (upload in a single call where possible).
Bug: dawn:684
Change-Id: Id67c39b1efbc8b435b58064cad66a55c153ce675
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47240
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Also drive-by fixes some other deprecated constructs (const -> let, and
a disabled test having ancient WGSL).
Bug: dawn:755
Change-Id: I924dfbcbd0a7d0478f3e9b3766585751a0392499
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47620
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Depth/stencil formats are invalid for 1D and 3D texture.
This change adds this validation rule, and adds a validation
test for it.
Bug: dawn:730
Change-Id: Idac6d1bf7b8c7261eb7b4b59504de10e13d049cc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47200
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This will help experiment using dawn_wire for remoting WebGPU to render
on the screen.
Bug: None
Change-Id: I9a60ff8c3889ec917f6fd56e4cbb1ffef639748d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47621
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Move texture uploads into CommandBufferGL::DoTexSubImage() and use it
for both CommandBuffer CopyBufferToTexture and
QueueGL::WriteTextureImpl(). On the CB side, For now this is only used
for compressed ES textures. Desktop GL has a fast-path for compressed
textures that isn't currently implemented.
Bug: dawn:684
Change-Id: I4da02e9c96c13fd71d133778168a5597efa7b59a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47123
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
The HLSL writer issue is now fixed.
Fixed: tint:686
Change-Id: I6d4709652d1ca46971a4ad2d150b21ad954ec055
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46450
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Replace TODOs for those tests that now fail with another issue.
Fixed: tint:682
Change-Id: I2665f0d4f495e4efc5adef4cf46a965df7c8936c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46451
Auto-Submit: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Now that we have a real extension type (PrimitiveDepthClampingState),
we can replace the dummy extensions used in the WireExtensionTests
with the real deal.
Change-Id: I43dfa66f2cc909b5fc95b55382d3cb53ce022a0f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47300
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brian Ho <hob@chromium.org>
Tint diagnostics hold a raw pointer to the tint::Source::File, so that source snippets can be printed.
The tint::Source::File pointer was taken from a stack allocation, and the diagnostics were left with a dead pointer.
Have the ShaderModuleParseResult keep the tint::Source::File alive with a PIMPL unique_ptr.
Change-Id: I80d77516afd4012e15992821e060ef3038eba1c1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47422
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Constructing a float2x2 from a float4 in a ConstantBuffer by extracting individual scalars with the array-index operator appears to produce invalid DXBC.
Tweak the test so that we use .xy, .zw swizzles instead.
Bug: tint:681
Change-Id: I027f8df96f2a5fda355668b35773d79f4fcdc08b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47421
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Tint only reflects the bindings that are statically used so before this
fix it would produce an empty pipeline layout. Fix this by statically
referencing the sampler binding in the shader.
Fixed: dawn:754
Change-Id: I381acd9adb7d1e80ccf0642b5189750a5a43de25
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47420
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Validation is now automatically performed, and the Validator class is
now redundant and will soon be removed from Tint.
Bug: tint:642
Change-Id: I9ddbe523d85e2a4dfeff6d08324a6ca368d6cc74
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47124
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
The various backends hit UNREACHABLE() during pipeline creation if
depthStencil.depthCompare (or likewise for stencil) are set to
undefined.
Bug: chromium:1195694
Change-Id: Ibf4d8d47b4c98343dce3caccdf79ee90c0de899f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46863
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This change also marks 3D view creation as Unsafe API.
BUG: dawn:547
Change-Id: Icdb7b48f19054d70258363f6d58ded957be72b70
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46723
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Test is flaky on the NV bot so it's being disabled
as I investigate.
BUG=dawn:733
Change-Id: I9b721f05665cefe8a6eee53fe691f83071484965
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47260
Reviewed-by: Corentin Wallez <cwallez@google.com>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
After we applied __VA_ARGS__ in macros and use {x, y} and {w, h}
to replace (x, y) and (w, h) in EXPECT_TEXTURE_RGBA8_EQ and
EXPECT_TEXTURE_FLOAT_EQ, we can use the more general macro
EXPECT_TEXTURE_EQ. Then these two macros can be removed. Austin
has already put a TODO for this change but didn't do that.
utils::MakeOrigin and utils::MakeExtent are removed because they
are not needed.
In addition, this change removes 0 in callers for parameter level,
because level's default values is 0 in helpers implementation.
BUG: dawn:748
Change-Id: Iece4db7a8ed1d47b57988412f1c897205e7403d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47100
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
The previous CL had no way of communicating disagnostic messages from
Tint to the ShaderModule in the event that it failed to validate. This
change ensures that messages generated during validation aren't dropped
on the floor and can be queried from the failed modules CompilationInfo.
BUG: dawn:746
Change-Id: Ic2551654ca30baab0fb5124a148eb4fcdf4b0f22
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46960
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch refactors the implementation of APICreateComputePipelineAsync
as a preparation of the async path of the creation of compute pipeline.
Now the code path of APICreateComputePipelineAsync() 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 compute pipeline object in the cache, the
callback will be called at once in the main thread.
- When we cannot find the proper comptue 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 CreateComputePipelineAsyncImpl(), which will be overrided
by its asynchronous version on all the backends that support creating
pipeline objects asynchronously.
Note that APICreateRenderPipelineAsync is not changed in this patch because
it is now under refactoring to match the current updates in WebGPU SPEC.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: Ie1cf2f9fc8e18c3e6ad723c6a0cefce29a0eb69c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45842
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Most tests pass, those that don't are skipped.
Change-Id: Ia08373551a48382aceffbbc0e23bd15828ebe219
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46452
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
If a texture format supports multisample, it should be renderable.
This change adds this validation rule to fix a bug. It also adds a
validation test in dawn_unittests.
BUG: dawn:731
Change-Id: I33a06cb16367e4e379b29b223ef6b69128baf30f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46840
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This change removes layer and use origin.z in MACROs
EXPECT_TEXTURE_FLOAT_EQ and EXPECT_TEXTURE_EQ.
It also removes parameter layer in MACROs' implementation
functions AddTextureExpectation and AddTextureExpectationImpl
and use origin.z instead in these functions.
BUG: dawn:747
Change-Id: I0103524074c6c250fa2f85bf9c3abda8c8cd2197
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
We do query resetting for each query commands outside render pass,
whether they're rewritten or not, so no longer need to track their
availability on command encoder. The availability on query set is enough
for resolving sparse queries.
But we still need to track query availability on render pass for query
rewrite checking and query resetting per render pass. Because reset
command must be called outside render pass, we need to reset them
together before the beginning render pass based that. Add availability
tracking on pass resource usage tracker (we only need it on render pass
) to facilitate use it in Vulkan backend.
Bug: dawn:434
Change-Id: Ie1b413ff54f62f3b84fe612e4abe45872c387e81
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This change implements 3D texture copy on D3D12 for texture to
buffer and texture to texture copy for full copy upon the entire
3D texture.
It also uses a function named CopyBufferToTexture to wrap
CopyBufferTo3DTexture and CopyBufferTo2DTextureWithCopySplits.
Likewise, it uses another function named CopyTextureToBuffer to
wrap Copy3DTextureToBuffer and Copy2DTextureToBufferWithCopySplits.
BUG: dawn:547
Change-Id: I4293f6ca4d37f604e6f1c10827686d17469a07ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46820
Commit-Queue: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Dawn uses objects with move semantics like Ref<> that feel like they
need to be std::moved in a bunch of places. This warning triggers when
std::move() is used when it has no effect, keep the code less verbose.
Bug: None
Change-Id: I2b11f709e943e7b16024bfde07910577b983aa34
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46441
Commit-Queue: Stephen White <senorblanco@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Implements the GPUCompilationInfo and GPUCompilationMessage interfaces,
adds the GPUCompilationMessageType enum, and adds the compilationInfo
method to GPUShaderModule.
BUG: dawn:746
Change-Id: Ied70cbbfedbf4890916ec076993714e5042f70e4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46600
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
The attribute was just in the wrong place, I shouldn't have removed it
completely.
Bug: chromium:1195827
Change-Id: Iad2a5fdcc2e8bd76ddb82cc09cde62c3a57e3c54
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46800
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This CL adds depth clamping support to Metal by invoking
MTLRenderCommandEncoder::setDepthClipMode. I only implemented the
feature for the new-style of RenderPipelineDescriptor since the
old one seems to be deprecated.
Bug: dawn:716
Change-Id: Icd63c72294546042ae452360863a7f9c16b40f95
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45640
Commit-Queue: Brian Ho <hob@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This CL support subrect copy. Use scale/offset to copy from subrect of
source texture and viewport for copy to subrect of dstTexture.
BUG=dawn:465
Change-Id: Ice43c0da15f6d9526912879e2e734f6570f2d673
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46422
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Converts each of the native API backends to use RPD2 natively, started
converting the old format to the new one in the deprecated entry point,
removed all other handling and validation of the old format, and turned
on the deprecation warning.
BUG: dawn:642
Change-Id: I20b671960a83f65ecb4ce6ce1165a563025983cd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46726
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Refactors the existing general reflection code to either use Tint or
SPIRV-Cross, depending on the backend being used and provided flags.
Tint is used when UseTintGenerator is enabled, otherwise SPIRV-Cross is
used.
For OpenGL, when Tint is used, additional reflection is performed using
SPIRV-Cross to support GLSL generation.
There still exists backend specific reflection that needs to be
implemented in Tint for the complete removal of SPIRV-Cross for
non-OpenGL when UseTintGenerator is enabled.
BUG=dawn:743
Change-Id: Ie77afa83a2c960b3c87a3419997a16f8392991fd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46480
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
This ends up incorrectly reporting live objects from previous CTS tests.
We should find a better way to call ReportLiveObjects, but doing so on
backend initialization is probably not the right time.
Bug: dawn:745
Change-Id: I9d0beb5f8b20af9c83f5e78f19630d5c78ef4da2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46721
Auto-Submit: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is the first patch to implement 3D texture copy. It starts with
implementation for 3D texture copy on D3D12 backend with the simplest
case: copy to the entire 3D texture. And texture's width is aligned
with 256 bytes.
The implementation for 3d texture copy might be inaccurate/incorrect
in some functions for complicated cases. But don't panic. The previous
implementation is also incorrect because many functions assumes that
we are copying to/from 2D textures only. And I will incrementally fix
the incorrect functions via upcoming tests for 3d texture copy.
BUG: dawn:547
Change-Id: I588b09fc8d0f0398e0798573415ba3a6a3f576fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45980
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
We are going to send another PSA about new APIs in Dawn/Chromium and
want developers to be able to use CreatePipelineAsync. The
implementation is safe, it just doesn't offload the work to a different
thread yet.
Bug: dawn:529
Change-Id: Ia093e46f8c3d389fd42eb5c1ad6b94ab8e64957b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46448
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Adds GPUExternalTexture-related types, as well as
Device::ImportExternalTexture. Adds a basic unit and end2end test.
Bug: dawn:728
Change-Id: Iee9533eb872c493a089cccd500748f1a61457407
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46060
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
Each quadrant now uses a unique color so
a test result failure can better indiciate any
unexpected sampling behavior.
BUG=dawn:733
Change-Id: If0e814956c1d686bdddcfb6de4dbf24f05d5a027
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46540
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
This fixes a failure when use_tint_generator on D3D12, but also preps
the code for the future where WGSL requires that return values from
functions are used.
Bug: None
Change-Id: I6b8a5e0aef6550ef39d2972cdc510e05e4be3662
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46620
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This is another incremental change towards using the new render
pipeline descriptor throughout the entire stack. Creates blueprints for
hashing with the new descriptor when provided before then converting it
to the old format for the native backend creation.
BUG: dawn:642
Change-Id: I1927b12fd02b2fedf25ef4428f07e339fa666715
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46541
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This is a preparation CL for 3D texture copy. It refactors texture
result comparison MACROs and their implementations, in order to
add texture result comparison for 3D texture. Prior to this change,
texture result comparison supports 1D/2D texture only.
BUG: dawn:547
Change-Id: Ia242356e05f4762e33a8278ec0d038b8580f7aa9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46320
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
It was used to avoid requiring the dependency on Tint so it isn't needed
anymore now that Dawn unconditionally dependent on Tint.
Bug: dawn:686
Bug: dawn:706
Change-Id: Ifd12c2f94fcaaa70120ae7ef72bcdc34f970fbea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46004
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This is in preparation for a change that will change all the
CreateFooInternal to be CreateFoo so they can be called in a
reentrant manner without special refcounting.
This also standardizes all the backends (except OpenGL and Null)
to use Object::Create that returns a Ref<T> or ResultOrError<Ref<T>>,
something we wanted to do for a long time.
Bug: dawn:723
Change-Id: I9e0baced333ffeb0affbc6a276c9bd9de082263a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46440
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>