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>
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>
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>
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>
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>
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>
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>
Also does small cleanups in dawn.json
Bug: None
Change-Id: Icbe8c9370496fa63fdd32b43d4f7a0666acf71c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45920
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Still leave deprecated `depth` functional as there are some references in
other clients. Using `depth` and `depthOrArrayLayers` at the same time is
invalid. Add DeprecatedAPITests.
Bug: chromium:1176969
Change-Id: Ia06645e4f3c17588323dd36b11f9f3988b2e3aba
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/44640
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Since it isn't used by anyone yet we can make a breaking change to
CreateRenderPipelineAsync to immediately start using
RenderPipelineDescriptor2.
Bug: dawn:1177501
Change-Id: I9f88c6fc1b325b7a9356536e2a071d4f17abd6ea
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/45280
Commit-Queue: Brandon Jones <bajones@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
First add a new but unused entry depthOrArrayLayers to Extent3D
Bug: chromium:1176969
Change-Id: Ie106c2be7306dd0f3f739385b4bbc89bf2359603
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/44982
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Currently normalizes anything using the new layout to the old one for
the sake of getting things working as quickly as possible. Follow up
changes will gradually push the new layout through more of the stack.
Bug: dawn:642
Change-Id: Ie92fa9dde21174f62ceba1a1f4866cbc24c5fc6f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38600
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This is to follow the renames in the upstream WebGPU specification.
Typedef are left in places to make a smooth deprecation period.
Bug: dawn:22
Change-Id: I5134b897930c1fa883c49dd80d2665d6684ec022
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/43882
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
This is to follow the changes in the upstream WebGPU spec.
Bug: dawn:22
Change-Id: I192c5ffe6008ac13ce466e712dd98528938b5e63
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/43881
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Shifts the older enum values up by 30, but if anyone was using values
rather than the enums themselves they'd land on the right formats
anyway.
Bug: dawn:695
Change-Id: I92a177b427fb1bb14b60d9280f89d030c5941a38
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/42561
Commit-Queue: Brandon Jones <bajones@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This is the replacement for Fence in the single-queue WebGPU world. To
keep this CL focused, it doesn't deprecate the fences yet.
Bug: chromium:1177476
Change-Id: I09d60732ec67bc1deb49f7a9d57699c049475acf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/41723
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Removes special casing depth-stencil or multi-planar formats.
Like depth-stencil, NV12 views can be created but not sampled.
BUG=dawn:551
Change-Id: I3cd43d079253f4ee45660d0efd2723e1650f88d3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/41342
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Can be used to help with deprecation during simple struct renames.
Includes typedefs for VertexAttributeDescriptor -> VertexAttribute and
VertexBufferLayoutDescriptor -> VertexBufferLayout as specified by the
latest RenderPipelineDescriptor changes.
Bug: dawn:642
Change-Id: Iab3d74d179884499540e813b0e66859713031ccb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/40581
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Adds support for NV12 texture format and per plane view aspects.
Only allows planar sampling of imported DX11 textures. See usage
tests for examples and formats.h for rules.
Bug: dawn:551
Change-Id: I44b89d2c07bb9969638e77ce7c756ef367167f0c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38781
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Bug: dawn:22
Change-Id: Ifce24a0b19fb8d3acb6ac8ab32f3f3e22a248b3b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/39340
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Use default SamplerDescriptor if not descriptor is passed in.
Change some createSampler calls to pass nothing in for testing.
The default values for SamplerDescriptor and that from
utils::GetDefaultSamplerDescriptor are different so we may still want to
keep it.
Bug: dawn:599
Change-Id: Ie75d9e1fde608cb19049b50f4613be63802c8719
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38621
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
Adds some maxAnisotropy implementation.
Adds an end2end test, drawing a slanted plane with a texture of which each mipmap has a different color, with different maxAnisotropy values.
You can get an idea of what it does at https://jsfiddle.net/t64kpu81/85/
Needs further CTS.
Bug: dawn:568
Change-Id: I89ac56d8cf0fbb655358bf6effa016ddc1f8426f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35143
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
https://dawn-review.googlesource.com/c/dawn/+/34921 introduced a couple
of bugs. This CL fixes them and tests to ensure that the new validation
logic is working correctly.
BUG=dawn:527
Change-Id: Ief01dfda0b97a202bf12ff6aeb0e7a3b84b4b81c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35700
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Updates BindGroupLayoutEntry to allow for the newly split-up descriptors
that define each binding type in it's own member (buffer, texture, etc.)
The previous style of descriptor is still supported but is deprecated.
For the sake of keeping the scope reasonable, this change does not alter
the BindingInfo structure that's used internally by the various
backends. That will come as a followup.
Bug: dawn:527
Change-Id: I2f301f5f36fa2ce7ff15126ac90dc4c19d5e32ca
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34921
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This CL enable CopyTextureForBrowser to accept options. The first
supported option is flipY, which can be implemented through scale and
offset uniforms.
BUG=dawn:465
Change-Id: Ia90153ee63a50e0e40beb1c13c63764d19a0b809
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34402
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This also simplifies a bunch of code in backends that was used to handle
getting the indexFormat from the pipeline "late".
Bug: dawn:502
Change-Id: Ibae50c8df21323fd391515f6036552e9fb868d93
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/32023
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This makes a nearly one-to-one mapping between the JS and C APIs, which
benefits projects like Blink and Emscripten.
- JavaScript's `undefined` is equivalent to C `WGPU_STRIDE_UNDEFINED`.
- JavaScript's `0` is equivalent to C `0`.
- To implement the API correctly, Blink must special-case an actual
value coming in from JS that is equal to WGPU_STRIDE_UNDEFINED
(0xFFFF'FFFF), and inject an error.
Keeps but deprecates a reasonable approximation of the old behavior.
Bug: dawn:520
Change-Id: Ie9c992ffab82830090d0dfc3120731e89cd9691c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31140
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Previously the surface argument of CreateSwapChain was made un-optional
to prevent a compilation error. This broke examples because the
device-compatibility part of the wire would start dereferencing a null
pointer.
Instead of making the surface non-optional, make optional objects not
produce = nullptr for method calls in webgpu_cpp.h.
Bug: dawn:22
Change-Id: Icef357cc2b11ed452c78431dde514e4d497ae159
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31565
Reviewed-by: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Like copyTextureCHROMIUM in Chromium, CopyImageBitmapToTexture can use
internal pipeline to do the GPU uploading. But Dawn doesn't support
internal pipeline now.
This patch adds the first internal pipeline for Dawn and add the API
CopyTextureForBrowser to use internal pipeline to do gpu uploading.
The patch integrates very simple wgsl vertex/fragment shaders to do
simple direct blit to verify the whole system works.
BUG=dawn:465
Change-Id: I8b566af38a10eea00f7426c39e752958ef057abd
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30960
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
The default value for optional object structure members wasn't set
correctly for C++ structures.
Bug: dawn:22
Change-Id: I09e7f3675f6e0b5990ddcf03601b3b91cd25f553
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/31200
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch fixes a crash issue when the device is destroyed before
the callback of CreateReady{Render, Compute}Pipeline is called. Now
when the callback is called in DeviceBase::ShutDown(), the cached
pipeline object will also be destroyed before the callback returns.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I91ec2608b53591d265c0648f5c02daf7fadac85e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30744
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This patch adds the entry point of CreateReadyComputePipeline in both
dawn_native and dawn_wire.
TODOs:
1. Add more tests in dawn_unittests and dawn_end2end_tests.
2. Put the main logic of creating a pipeline into a separate thread.
BUG=dawn:529
TEST=dawn_end2end_tests
Change-Id: I7edd269a5422a8b85320a7f9173df925decba633
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30060
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
And deprecate using ::Float in the bind group layout for
"shadow textures" in the pipeline (along with a deprecation test).
Adds the ability to be used with DepthComparison only to depth textures,
this could potentially a breaking change if users where doing
depth-comparison on float32 textures but that's not supported in WebGPU.
Bug: dawn:527
Change-Id: Ib28b0443e3002e0aa2811713b9e843c2417e13e7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/30240
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
And use it to print the driver version at the start of
dawn_end2end_tests. This will help when figuring out issues
happening on CQ but not necessarily locally.
Bug: None
Change-Id: Ibdb9ab8cab53cc1e1cf8a807da53edeca616bed9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/29602
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch adds two new buffer map async status "destroyed before
callback" and "unmapped before callback" to replace the status "unknown"
so that the developers can get more details when meeting such errors in
the call of buffer mapAsync.
Note that this patch still preserves "unknown" as it is still being used
in Chromium.
BUG=dawn:533
TEST=dawn_unittests
Change-Id: I12deefb49311ea6adea72c24e4e40797dd7eb4a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28883
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Change dawn.json to reflect changes in the WebGPU IDL. Also fixes any
conversion issues in Dawn.
Bug: dawn:525
Change-Id: Ifb46329f073bcf31d43342f20f4819eac061d5a1
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28400
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
It isn't in the upstream WebGPU spec and completely unimplemented in
Dawn.
Bug: dawn:527
Change-Id: I2023c7b1de2a9fa50d26ab1678b7ef7e32c64af6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/28500
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
First step of a multi-part change to bring the setIndexBuffer
method up-to-date with the current WebGPU spec. This change
preserves the previous setIndexBuffer semantics for backwards
compatibility until developers have been notified and given
a grace period to transition to the new signature.
BUG=dawn:502
Change-Id: Ia8c665639494d244f52296ceadaedb320fa6c985
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/27182
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Also update RG11B10Float to be name RG11B10Ufloat
Bug: dawn:22
Change-Id: I0ea76dc25c37ebaeb4c2c2c2a119d00940acc145
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/25760
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Fix a couple names in the definition of writeTexture.
Bug: None
Change-Id: I051b6db0db076a1150850b885073cc36d3bd4b0e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24900
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
MapAsync in dawn_native is fully implemented and only missing
a couple cleanups that can be done once MapRead/WriteAsync are
removed.
MapAsync in dawn_wire is left as a pure shim on top of
MapRead/WriteAsync and will be transitioned to its own commands
in follow-ups.
All MapRead/WriteAsync end2end and validation tests are duplicated
for MapAsync.
Bug: dawn:445
Change-Id: Ib1430b9257149917be19a84f13e0ddd2a8eccc32
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24260
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Adds RenderPassDescriptor.occlusionQuerySet for struct compatibility
with upstream webgpu.h, and validation errors that it's not used (since
it's not implemented).
Bug: dawn:22
Change-Id: I05ac75105038a0d7569cc720170e55f35b0f80d7
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24620
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Implements validation for RenderPassDepthStencilAttachmentDescriptor depthReadOnly and
stencilReadOnly flags to match WebGPU specification. Includes corresponding unit tests.
bug: dawn:485
Change-Id: I21e624850d5a393469569417f102fb979dbfdf27
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24602
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Added Queue::WriteTexture with validation but no actual
implementation. Tests were mostly taken from validation tests
for copying buffer to texture. Validation tests for CopyB2T
and WriteTexture do not cover 2d-array textures yet.
Bug: dawn:483
Change-Id: I9027eb615c02fe2265cde912f6ba17a235b94728
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24440
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Tomek Ponitka <tommek@google.com>
This CL:
- Adds mappedAtCreation to dawn.json
- Changes dawn_native to implement CreateBufferMapped in terms of
mappedAtCreation.
- Duplicates all the CreateBufferMappedTests to mappedAtCreation tests
(both validation and end2end).
- Implements dawn_wire's mappedAtCreation in terms of
CreateBufferMapped. The reversal in dawn_wire will be done in a
follow-up CL.
Bug: dawn:445
Change-Id: I70b9fa729b1402524a6b993c3f288987eb65c6c4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24083
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Moved some of the validation helper functions from CommandEncoder.cpp
to CommandValidation.cpp. This will make them accessible for
Queue::WriteTexture. Also introduced ValidateLinearTextureData
and ValidateTextureCopyRange which combine already implemented
checks in a way that's defined in WebGPU spec.
Bug: dawn:483
Change-Id: I04304c5e4906f3745c6adf75758fae179c6ffcfe
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24283
Commit-Queue: Tomek Ponitka <tommek@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
- Move wgpu::TextureUsage::Storage at the end of the enum.
- Reorder some methods of device to be in alphabetical order.
- Reorder members of wgpu::QuerySetDescriptor.
- Change SurfaceDescriptorFromHTMLCanvasID to
SurfaceDescriptorFromCanvasHTMLDescriptor.
Bug: dawn:22
Change-Id: Ib18fbaf153ad2969b0d0c4e49682e8736b00776c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24280
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This CL adds GetMappedRange reusing the existing GetMappedPointerImpl
call in dawn_native. In dawn_wire tracking is added to keep a
Buffer::mMappedData around.
Tests are added to test the result of Get[|Const]MappedRange in all
buffer states.
Bug: dawn:445
Change-Id: I3737dc4d36f31d392839952da0b5c0d10c7c8a88
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/23861
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This CL checks buffer sizes before creating map read/write handles.
It is an error to map a buffer that can't be addressed on the CPU.
It also changes client-side synchronous errors on mapAsync to be
normal map failures, and not device lost errors. These should be
recoverable.
The CL adds additional testing for really large, but not UINT64_MAX
buffers, and fixes a VVL warning when buffer allocations exceed the
size of their memory heap.
Bug: dawn:450, dawn:398, chromium:1014740
Change-Id: Ieb34c04c3d01c429b7e3b7810729d5e91ecb6270
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22626
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This reverts commit 0357eed7de
and reland commit bdc05c3d5f.
The Vulkan-Loader has a bug where if the instance is created
with Vulkan 1.1 and not the promoted extensions, it will skip
emulation and if the ICD doesn't support Vulkan 1.1 nor the
extensions. Enable the promoted extensions, even when creating
a Vulkan 1.1 instance.
Original change's description:
> Check FP16 support on vulkan backend
>
> This patch check FP16 support on vulkan backend, and introduces
> the shader_float16 extension.
>
> BUG=dawn:426
> TEST=dawn_end2end_tests
>
> Change-Id: Ie09568a416ce9eb2c11afeede3e7da520550d5fb
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21901
> Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
> Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Austin Eng <enga@chromium.org>
Bug: chromium:1087896, dawn:426
Change-Id: I2c4465fb2fe957966b44d3e5840112219481c639
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22781
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch check FP16 support on vulkan backend, and introduces
the shader_float16 extension.
BUG=dawn:426
TEST=dawn_end2end_tests
Change-Id: Ie09568a416ce9eb2c11afeede3e7da520550d5fb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21901
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
They were deprecated in favor of bytesPerRow and rowsPerImage.
Bug: dawn:22
Change-Id: I5bd3262ee8ba2f891d01f6b8a3f5df86f7596686
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21684
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
It was deprecated in favor of chaining a
wgpu::ShaderModuleSPIRVDescriptor.
Bug: dawn:22
Change-Id: I210cd7c21c33c6ca8dd286ea64389b774a4355e5
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21683
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
It was deprecated in favor of wgpu::Device::GetDefaultQueue.
Bug: dawn:22
Change-Id: I28d7e616b2beb7de8eed3a3df501eb97a6475928
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21682
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
It was deprecated in favor of viewDimension.
Bug: dawn:22
Change-Id: I8016d7440d98cc69acd1b48cb76f7ae1c1353896
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21681
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This removes the following types and members as well as fixup code
and depraction tests for them:
- wgpu::BindGroupLayoutBinding
- wgpu::BindGroupLayoutDescriptor::bindingCount
- wgpu::BindGroupLayoutDescriptor::bindings
- wgpu::BindGroupBinding
- wgpu::BindGroupDescriptor::bindingCount
- wgpu::BindGroupDescriptor::bindings
Bug: dawn:22
Change-Id: Ifc0e25107f3dcfbb850624cb362909f38c90bec2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21680
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This also adds the definition of the WGSL sub descriptor but forbids
using it for now.
Bug: dawn:22
Change-Id: I0514eec95bbcda28911547d6bda4d5257b62432b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19865
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This is a reland of 6d9e4f8076
Now that the Chromium-side API change has landed, this CL can land.
Original change's description:
> Add ComparisonSampler binding type and validation tests
>
> Bug: dawn:367
> Change-Id: Iba1d3d03f6247a356b6f3fabfe7a7ba3c0753171
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18423
> Reviewed-by: Austin Eng <enga@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
Bug: dawn:367
TBR=cwallez@chromium.org,kainino@chromium.org
Change-Id: I325d096e7ce092d17833429c3f54ef7c71189739
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/20045
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This reverts commit 6d9e4f8076.
Reason for revert: Breaks the roll in Chromium, gpu_sampler.cc must first be
fixed to use the new undefined value, before this can be landed.
Original change's description:
> Add ComparisonSampler binding type and validation tests
>
> Bug: dawn:367
> Change-Id: Iba1d3d03f6247a356b6f3fabfe7a7ba3c0753171
> Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/18423
> Reviewed-by: Austin Eng <enga@chromium.org>
> Commit-Queue: Austin Eng <enga@chromium.org>
TBR=cwallez@chromium.org,kainino@chromium.org,enga@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: dawn:367
Change-Id: Ic071a601df2063bd2da5388b2e75c1a121924a69
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19983
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This makes all backends register the default queue at device
initialization time, so that the same queue is returned by
each call to GetDefaultQueue.
All usages of CreateQueue are replaced by GetDefaultQueue
except a couple ones that could use the queue initialized by
DawnTest::SetUp.
A deprecation warning mechanism is added so that users of Dawn
can now that they should upgrade their usage of the API. It also
comes with a backdoor so we can test that they are emitted.
New DeprecatedAPITests are added that will contain tests for
deprecated APIs, and will also check that deprecation warnings
are produced.
The special casing of GetDefaultQueue in the wire will be done
in a follow-up CL to ease the review. It happens to work through
the regular wire mechanisms at the moment but returns a different
object on each GetDefaultQueue call.
Bug: dawn:22
Change-Id: I78dc1fa474769674278d30040e8d05c658b88360
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19724
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
The upstream WebGPU spec decided to not pursue CreateBufferMappedAsync,
and it adds some complexity to Dawn, so we remove it.
Bug: dawn:22
Change-Id: I4182a90c4a1aa0bfbaecd7d8f67d7049cf5df5d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/17321
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>