It's come up multiple times that ASAN doesn't support
std::nothrow which leads to OOM bugs filed by the fuzzers.
Use a common helper to avoid this and return nullptr for large
allocations when ASAN is enabled.
Bug: none
Change-Id: I492b4ff4e498cf82d4ca08ba849671d3d16b9cfb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36280
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
In timestamp compute shader, we will create an internal buffer for
resolving QuerySet and use it as input buffer in compute shader,
the user-provided resolve buffer is used as output buffer.
This will cause the buffer zero initialization to be called twice,
one is the internal buffer is zero initialized in ResolveQuerySet,
antoher is the user-provided buffer is tracked as pass resource
and need to be initialized. But for ResolveQuerySet(), we expect
there is only once.
We have no special requirements to have an internal buffer. It is
possible to directly use the user-provided buffer for read and
write becuase it will get STORAGE_INTERNAL usage.
Bug: dawn:434
Change-Id: Ia8c8ac6e9ba23fea31468a6d9b4580eece189be2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36201
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
- Get timestamp period on each backend
D3D12: Get GPU frequency(HZ) from queue and calculate the period in ns
Vulkan: Get timestampPeriod from device properties
Metal and others: don't need the period
Bug: dawn:434
Change-Id: Ia5588a3dccadfe92d7384b9fdf1e6848c6e5c6e2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36220
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Hao Li <hao.x.li@intel.com>
This patch fixes a bug in the implementation of the toggle
UseTemporaryBufferInCompressedTextureToTextureCopy on Vulkan backend.
The previous implementation only considered the T2T one-layer copies,
which will cause the validation error by Vulkan validation layer. This
patch fixes this issue by adding the missing support of multi-layer
copies.
This patch also fixes the failures in the WebGPU CTS tests
color_textures,compressed,array,* on the Linux/Vulkan backends with
Vulkan validation layer enabled.
BUG=dawn:42, chromium:1161355
TEST=dawn_end2end_tests
Change-Id: Ic437919a843b8439d267b8d75b27ade3a9e7bcae
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36260
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Adds the first type trait that checks that the equality operator is
defined for two types.
Bug: dawn:441
Change-Id: Ied80c5d876739272c07d513727a3ee709a721eab
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35522
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
SPIRV-Cross still emits some comments, so for now, just check that
the specific guard comments Dawn uses are not contained in the HLSL
output.
Bug: dawn:549
Change-Id: Ia6d32befa5ef983e56494542d46e9c3592b6480a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36300
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This patch enables CompressedTextureFormatTests on Win/Intel/Vulkan
after the upgrade of Windows try bots.
BUG=dawn:42
Change-Id: Ifad6634973ef30af7f416798973325a5fa7cbe67
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35920
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
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>
- Limit the maximum query count to 8192 to fit Metal restriction.
- Add unittest tests of query count and remove the test of buffer
size overflow validation on 32-bits.
Bug: dawn:434
Change-Id: Ie573b715cc3f67ec158996119a8b4a49e493680a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36021
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Fixes validation errors when drawing with point topologies, and without explicitly writing to the PointSize builtin.
Fixed: tint:321
Change-Id: I3c00c5ee56966a82d9e3024cb277eae8921a9af2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35800
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Because the uint64 is not supported on all GPU drivers, we use uint32
and float to simulate the multiplication of uint64, but there is
accuracy loss between the results and the expected results computed by
uint64. This test checks that the accuracy loss is less than 0.2%.
Bug: dawn:434
Change-Id: I6f5c842b6915f101441886bdfa4f9feb2827d174
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/34120
Commit-Queue: Hao Li <hao.x.li@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
In OpenGL ES glPixelStorei() doesn't affect the execution of
glCompressedTexSubImage*D(), and GL_UNPACK_COMPRESSED_BLOCK_* is not
defined in OpenGL ES, so on the OpenGL ES backends, to implement
CopyBufferToTexture() with compressed texture formats, we can only copy
the compressed texture data once per compressed block row.
With this patch CompressedTextureBCFormatTest/* can pass on Intel Mesa
OpenGL ES driver.
BUG=dawn:42, dawn:580
TEST=dawn_end2end_tests
Change-Id: Ied84a187beaf9105d3664c4e874b3b7ddda4e4b0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36020
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Changes the internal BindingInfo structure and any references to it. The
BindGroupLayoutEntry information is normalized when converting it into
the internal representation, but still accepted as either the old or
new layout. A "bindingType" member is added to the BindingInfo that's
not present in the BindGroupLayoutEntry itself to indicate which of
buffer, sampler, texture, or storageTexture is populated. This proves
useful for a myriad of switch statements in the various backends.
Bug: dawn:527
Change-Id: I6ae65adae61d0005fc50ed6d1bc2ec9b2a1295ad
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35862
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Auto-Submit: Brandon Jones <bajones@chromium.org>
This patch skips all the dawn_end2end_tests using glTextureView() on the
OpenGL ES backend as glTextureView() is not available in OpenGL ES.
With this patch all the dawn_end2end_tests will be able to run on Intel
Mesa OpenGL ES drivers with no crash.
BUG=dawn:580
Change-Id: I420eebfd699edf745bd08cb941f3143aad2fbd06
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/36040
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
This makes it less manual code and less error prone to
add new callbacks to the wire.
Bug: dawn:384
Change-Id: I8547af2dba8289d1badd41e53dd732c776fb5d06
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35600
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This CL changes SubresourceStorage to have an inline storage for the
per-aspect compressed data and allocate the storage for decompressed
data lazily. This will avoid the large performance cost of allocations
in the happy case.
Bug: dawn:441
Change-Id: Iae1cab87b699cb0e60031abe7306cdff92fbd049
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35521
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Converts most of the tests to use the new layout, with the exception
of a few that are dependent on additional Dawn changes before the
conversion can happen. The deprecation warning is not enabled yet
due to these remaining changes.
Bug: dawn:527
Change-Id: Idcfd9fc873756f5a9f88de2ce9ab65c66b79bf39
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35582
Commit-Queue: Brandon Jones <bajones@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This was here to ensure all callbacks return, but this can now
be done by calling device.Tick - which Chromium does
periodically. Remove it now, especially since it will be incorrect
when the wire supports more than one device.
Bug: dawn:384
Change-Id: If948ffe8931be7ba989f733efd64549d0c56b382
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35841
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
One of the issues blocking Dawn->Skia rolls
Change-Id: Ia3c68edd2c2745586dfb6a778e3a493df20aa66d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35820
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@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>
This CL adds the Merge() operation to SubresourceStorage() that allows
modifying the content of a storage with another storage.
Bug: dawn:441
Change-Id: I28e3cd7bc967056eda2c387b2b6e164eb370a241
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35520
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
The issues causing these tests to fail with the Inspector enabled have
been resolved.
BUG=dawn:578
Change-Id: Ie0b7b4d6b2d1a3b432f4eed7542c64e31bf44fdb
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/35680
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>