Multiple groups of limits may be defined via macros.
ApplyLimitTiers degrades the incoming limits such that
each limit value within a group is clamped to the
best possible tier. A device may be in Tier 2 for one
limit group, but Tier 1 for another limit group.
Also adds equality operators to dawn_native generated structs
for comparison of expected limits in the test.
Bug: dawn:685
Change-Id: Ibdf947f2ccd44f70d66f48bed472ff5681230633
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64720
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
These are behind the new `dawn_node` flag, which can be enabled by using the new `scripts/standalone-with-node.gclient` file.
Bug: dawn:1123
Change-Id: Ia7ca715808e46b17f91338f56ffc6794d0104fd7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64900
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Contains macros used for logging and marking code as unimplemented.
Bug: dawn:1123
Change-Id: I861348b0cc53eb1dc80ed5b477ab33af45d1acd9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64747
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
A go WebIDL parser and template generator tool.
Will be used to generate the NodeJS bindings for Dawn.
We may wish to reimplement this in Python some day. Not today.
Bug: dawn:1123
Change-Id: I31c868efcd8ba00084a6c25a1fc0e3ad774dfa53
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64746
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Since spirv_to_dxil does not generate HLSL, to support pipeline caching,
we need to generate a cache key from the WGSL instead.
A new type, ShaderCompilationRequest, is added to isolate the
compilation inputs to help ensure that the cache key contains all
relevant information.
Bug: dawn:1103
Change-Id: Ic2f09326dc3ac254cecf35098dcfe95aa396796f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61160
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Michael Tang <tangm@microsoft.com>
Outer projects can just set() the option / setting before calling add_subdirectory() on Dawn.
Also provide a build directory for Dawn's third_party dependencies. Allows the outer project to specify a third_party directory that's out of the dawn tree.
Change-Id: I04c5f12b362ee9c9488b7b78a6aa5fa6f55dec98
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64743
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This patch implements the asynchronous path of creating render
pipeline on Vulkan backend. This patch also makes the access to
the member mCache of Vulkan::RenderPassCache thread-safe as it
can be accessed in different threads simultaneously.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I74c799935ef46405275585cb5dccfcb552a48aa4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64840
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Begin's using Abseil's string formatting and new error context tracking
to dramatically improve the usefulness of validation messages. In
addition to putting in place several utilities to enable better messages
this change also updates the BindGroup buffers bindings validation
messages as a test for the new mechanisms.
Bug: dawn:563
Change-Id: Ie5bf5ffb24a9013cebd67745dc4172dfbc901e9a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64201
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
glfw is used by several `src/utils/*.cpp` files, regardless of whether examples are being built or not.
Change-Id: Iba90fbf96e254979c72acf792af3cb86d889f5db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64742
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Change-Id: Ie6be1301c3f2f9877a9dfb04ab5025559b90d926
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64741
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
If this prefix is omitted, then any subdirectory that matches the pattern will also be ignored.
Change-Id: I09b2629156416c26f885d765f88e69be236b7d3e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64745
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
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>
Fixes the library_webgpu_enum_tables.js generation for the BC formats.
ETC2 and ASTC are not in the spec yet, so I took a guess at how those
would be formatted.
Bug: dawn:501
Change-Id: Icee5f1db039c1b401082676dab3020dda21da8bb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64525
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
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>
Make a md doc placeholder for buffer mapping.
Linking the google doc now.
Change-Id: I085e10474148fdb2a710655cc5115f8fc2b4b5b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64523
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>