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>
The single DAWN_ENABLE_OPENGL flag in the root CMakeLists.txt did not define
DAWN_ENABLE_BACKEND_DESKTOP_GL or DAWN_ENABLE_BACKEND_OPENGLES, so examples
with `-b opengl` reported `Backend isn't present` and failed to start.
ENABLE_OPENGL flag in root CMakeLists.txt was replaced by ENABLE_DESKTOP_GL
and ENABLE_OPENGLES flags, repeating the logic of similar flags
in GN buildsystem as done in src/common/BUILD.gn
and scripts/dawn_features.gni.
Change-Id: I6302de7aa98436ddc0aa002d83dd6b3e7102e49c
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56283
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Sergey K <sergey.ext@gmail.com>
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>