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 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>
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>
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>
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>
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>
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>
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 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>
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>
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>
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>
This didn't make sense since these members can be specified to have no
data by setting the length to 0.
- Prevent uses of this patten by adding an assert in WireCmd.cpp's
generator.
- Fix SetBindGroup dynamicOffset to not be optional but default to
nullptr instead.
This issues would cause a read of uninitialized pointers becaus the
generator code looked like this:
SetBindGroupCmd cmd;
cmd.dynamicOffsetCount = record.dynamicOffsetCount; // 1
bool has_dynamicOffset = record.has_dynamicOffsetl // false
if (has_dynamicOffset) {
cmd.dynamicOffsets = ...;
}
// Oh no! dynamicOffsets contains garbage even if dynamicOffsetCount
// is set to 1. dawn_native will happily read it.
Bug: chromium:1220036
Change-Id: I5c468b639f671cef3be2fa64667a0bf114fc902b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54643
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This extension is just added for testing unsupported feature at device
creation. We don't need to update Extensions info because the
invalidExtension is not a valid extension and must be treated as
InvalidEnum.
BUG: chromium:1175091
Change-Id: I11462a053fb5db8e11a54173e13f338c1c4f7b6f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/53891
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Hao Li <hao.x.li@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>
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>
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>
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>
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>