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>
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>