These fuzzers currently depend on being able to change the signal
handler at runtime, but the default flags being used forbid this. This
CL overrides the upstream default to allow changing the handler.
BUG=chromium:904725,chromium:904712
Change-Id: I68423564981b7f2e39f7c00744b92da982cf19e9
Reviewed-on: https://dawn-review.googlesource.com/c/2361
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This will avoid compilation to break, and adds standalone reproducers
for the fuzzer_tests.
BUG=chromium:903380
BUG=dawn:34
Change-Id: I9995a852076d9f6d1ebdee5b999989c2d74d4709
Reviewed-on: https://dawn-review.googlesource.com/c/2321
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Dan Sinclair <dsinclair@google.com>
This CL adds in fuzzers for SPIRV-Cross for HLSL, GLSL, and MSL
outputs. These fuzzers live in Dawn because there is not appropriate
location in the Chromium source repo for them and it is unlikely they
would be land-able in the SPIRV-Cross repo, because it is not coupled
with Chromium's build system and thus Clusterfuzz so would be
effectively dead code. Dawn depends on this code, but it is also
integrated into the Chromium build system, so this was the best place
I could find for them
The code under fuzz unfortunately uses exceptions/aborting as its
error reporting mechanism. This is an acknowledge short coming and
there are efforts to remove this behaviour. To work around this and
reduce the number of false positives found by the fuzzers, a signal
trap has been implemented which will be removed once the code under
fuzz has been updated.
The trap replaces the existing signal handler and silencing signals
while running the code under test. This allows the code under test to
call abort() and not crash the fuzzing process. Theoretically, only
SIGABRT should need to be trapped, but something is causing the signal
from abort() to be converted to SIGSEGV when running under ASAN.
This signal trap has been tested with the fuzzing/sanitizers by
intentionally inserting bad calls that will occur after a few thousand
test cases. It was confirmed that the fuzzer detected the issue and
stops fuzzing.
The alternate to implementing this signal trap would be to turn on
exceptions for the fuzzer. This was attempted, but proved to be
fruitless due to what was reported as an ODR issue, but couldn't
couldn't be silenced. The likely underlying issue was a pre-built
library or other object being built without exceptions was causing
different versions of symbols or the exception version of the standard
library not being instrumented by ASAN. Given the majority of Chromium
eco-system turns off exceptions, fixing this issue would not be
helpful to the larger community and was looking like it would require
significant effort.
BUG=chromium:903380
Change-Id: I63a5595383f99b7a0e150d72bb04c89b8d722631
Reviewed-on: https://dawn-review.googlesource.com/c/2260
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Max Moroz <mmoroz@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
BindGroupTests.ReusedUBO and BindGroupTests.UBOSamplerAndTexture fail on
Metal so we have to skip them temporarily.
BUG=dawn:33
Change-Id: I2875dab6d856eb207ee5b785ddf160df2cb9fd5b
Reviewed-on: https://dawn-review.googlesource.com/c/2240
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Likewise "presented" textures won't be available for use in submits so
this sets up state-tracking and validation for textures too.
Command buffer resource usage is now stored in the frontend instead of
done per-backend because it is used to validate resources are allowed in
the submits.
Also adds a test.
BUG=dawn:9
Change-Id: I0537c5113bb33a089509b4f2af4ddf4eff8051ea
Reviewed-on: https://dawn-review.googlesource.com/c/2142
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch adds the entry points for creating cube map and cube map
array texture views. This patch also adds validations that the array
layer in the texture view descriptor must be 6 when the texture view
dimension is cube map, and a multiple of 6 when the texture view
dimension is cube map array.
BUG=dawn:16
TEST=dawn_unittests
Change-Id: I86a66c3753a7678351f65b43f6cd54b96d1b762c
Reviewed-on: https://dawn-review.googlesource.com/c/2200
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
MSC doesn't like the use of sizeof(member) inside the same struct.
So hardcode the padding, and assert that the offset is 256.
Change-Id: I78bbca6871cf8227c90d00a03ccf8e3d955b7d21
Reviewed-on: https://dawn-review.googlesource.com/c/2160
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
When both the vert and frag shaders have a UBO binding, the D3D12
backend was using register offset 0 for both, causing a collision,
and the wrong constant value used in one of the shaders.
The fix is to use the binding offsets computed by the BindGroupLayout,
since they know about all of the bindings, not just the ones computed
for each shader. This made it necessary to defer shader compilation
until pipeline layout creation time (as is done in the Metal backend
for similar reasons).
Finally, those bindings offsets computed by the BGL include an offset
for the CBV, UAV and SRV subgroups, so we must add the same register
offset when assigning the BaseShaderRegister to the descriptor ranges
in the PipelineLayout constructor so that they match.
Bug: dawn:20
Change-Id: I18287bf1c06f06dd61288e12da64752f54634466
Reviewed-on: https://dawn-review.googlesource.com/c/1960
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This also removes support for Travis and AppVeyor, as well as git
submodules for dependencies.
It also adjusts .gitignore to include dependencies (submodules are
implicitly ignored but are removed in this commit).
Finally, removes some CMake-specific code from the code generator.
BUG=
Change-Id: I4ebc04e530a574b412ef0ca81e4672db01f0ed92
Reviewed-on: https://dawn-review.googlesource.com/c/2040
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch renames the field "mipLevel" of TextureDescriptor to
"levelCount" to align with the WebGPU idl.
BUG=dawn:16
Change-Id: I36b30d78831786e4c21ffd641f820375e95a1be5
Reviewed-on: https://dawn-review.googlesource.com/c/2100
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Running test in a Chromium build requires using their gtest and gmock
targets as well as a harness that is in //base. Since we want to run
Dawn tests on the Chromium GPU bots, we need to support two
configurations both building tests standalone and in Chromium.
BUG=chromium:870747
Change-Id: I862e62a607e193a27562ece0f1f6d46d8728e446
Reviewed-on: https://dawn-review.googlesource.com/c/2080
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch implements creating texture view with texture view descriptor
with glTextureView, which is supported on OpenGL version >= 4.3. As is
required by glTextureView, we allocate storage for a texture by
glTexStorage*D instead of glTexImage*D.
BUG=dawn:16
TEST=dawn_end2end_tests
Change-Id: I29bcf6d538a70b4d6d1e5a21276b9e8d6e93ca51
Reviewed-on: https://dawn-review.googlesource.com/c/1980
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
d3d12::Buffer::UnmapImpl() was passing an empty range to
ID3D12Resource::Unmap(). This causes it to be a no-op when writing a
buffer. The fix is to store the entire mapped range in the Buffer,
and use it during Unmap().
Note: this doesn't seem to actually cause an issue on the D3D12 drivers I
have, so I have been unable to write a test for it. However, it does cause
an issue in RenderDoc: the buffer data appears unmodifed after the
Map/memcpy/Unmap calls. The hypothesis is that RenderDoc notices the empty
range at the API level, and leaves its shadow buffer contents unmodified.
Because I feel this change is correct regardless, I'm landing it without
a test.
Bug: dawn:25
Change-Id: Ie5dd5fcfedbe1d80c75a3d8094c97af27653ee00
Reviewed-on: https://dawn-review.googlesource.com/c/1920
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Most of names in dawn.json are in lower case, and we leave a blank space
between words. This tiny patch revises a few names, in order to conform
to the rule.
BUG=
Change-Id: I8f3f706bd48ce04fcca207a28f1b8725d7e0a7bc
Reviewed-on: https://dawn-review.googlesource.com/c/2000
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This patch is the first part to implement creating a texture view
with a texture view descriptor on D3D12 and Metal back-ends. With
this patch the texture views created with descriptor can be bound
as sampledTextures on D3D12 and Metal back-ends.
Note that the support of rendering into a layer or a mipmap level of
a texture on D3D12 and Metal back-ends is not included in this patch.
BUG=dawn:16
TEST=dawn_end2end_tests
Change-Id: I62473ec5a4bb6b84d797ef7fd9cb98689ff763f4
Reviewed-on: https://dawn-review.googlesource.com/c/1940
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This removes the need for Clone() so it is removed and also adds tests
for the new constructors.
BUG=dawn:11
Change-Id: Ia45c765c2d30e40b0e036427793a62327b2008fc
Reviewed-on: https://dawn-review.googlesource.com/c/1901
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
These new versions contain the fix for not having static libraries
with no sources depending on source sets in their BUILD.gn
BUG=chromium:870747
Change-Id: Ib979d5ee581f37db22347f0f725086a9b9833d07
Reviewed-on: https://dawn-review.googlesource.com/c/1900
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This patch implements creating a texture view with given texture
view descriptor on Vulkan back-ends.
This patch also updates TextureViewTests to test various mipmap
levels and adds several tests to cover all added features.
BUG=dawn:16
TEST=dawn_end2end_tests
Change-Id: I602e5a076e4f717f555cb9a9ef98d5dfceadbe81
Reviewed-on: https://dawn-review.googlesource.com/c/1880
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This patch removes CreateDefaultTextureView in all the back-ends of
class Device and implements this function by CreateTextureView using
a TextureViewDescriptor created from the original texture.
Note that this patch only refactors the original implementation of
creating default texture. The support of creating texture views from
a texture view descriptor will be added in the next several patches.
BUG=dawn:16
Change-Id: Iadfc1e17e1cf23a4c1fa8ff44b1fb1a765d21e3f
Reviewed-on: https://dawn-review.googlesource.com/c/1840
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
ObjectBase will contain data that all WebGPU objects have such as a
pointer back to the device, a refcount (via inheriting from RefCounted),
a name, an error status etc.
BUG=dawn:24
Change-Id: I919e1a6d4a68811ceb6e503b2a793815c92f2528
Reviewed-on: https://dawn-review.googlesource.com/c/1620
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This patch adds the entry point creating texture view with a
TextureViewDescriptor and all the validations on the parameters
according to https://github.com/gpuweb/gpuweb/issues/79.
BUG=dawn:16
TEST=dawn_unittests
Change-Id: Ibc04a0f7b9f334c57da191606313ab156e18af1f
Reviewed-on: https://dawn-review.googlesource.com/c/1800
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This rolls glslang and shaderc to be able to use their BUILD.gn files,
and also rolls SPIRV-Tools and spirv-headers to have compatible
versions.
BUG=chromium:870747
Change-Id: I13c615f6f3d148c9b69f06547992bf5910e04e62
Reviewed-on: https://dawn-review.googlesource.com/c/1680
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
If a bindgroup was re-used in multiple command buffers in a single call
to queue.Submit(), it was skipping the creation of the corresponding
descriptor heap for that bind group in the second command buffer.
The fix is to use the command buffer's index into the submit command as
part of the key for the bind group's descriptor heap.
Change-Id: Ie66a0e772b10cc72bf040f090dac4c4a10f24266
Reviewed-on: https://dawn-review.googlesource.com/c/1740
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This reverts commit d3c4eda135.
Reason for revert: Issue has been fixed so we can remove the XCode
requirement.
Original change's description:
> Add a temporary requirement for Mac bots to have XCode.
>
> BUG=chromium:884015
>
> Change-Id: Iee2373b23ab5534165b36c40600cae86545ee3d9
> Reviewed-on: https://dawn-review.googlesource.com/1544
> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
> Reviewed-by: Stephen White <senorblanco@chromium.org>
TBR=cwallez@chromium.org,kainino@chromium.org,senorblanco@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: chromium:884015
Change-Id: I5ae40e2343c7684bdbe533f5a8baa1490cdb37d1
Reviewed-on: https://dawn-review.googlesource.com/1643
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
BUG=chromium:870747
Change-Id: I678393ca29f934ecc23f0140d2d211fccf619a5f
Reviewed-on: https://dawn-review.googlesource.com/1640
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Dawn is missing a logo.
Change-Id: I836dc973119a33353a2d8051b2c84d2519b9a664
Reviewed-on: https://dawn-review.googlesource.com/1600
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Ryan Tseng <hinoka@google.com>
This patch fixes a typo "false" in main.py. The right token should
be "False".
Change-Id: Ic56f6f3290b30ce2dd56dbe1ce4c31821b981723
Reviewed-on: https://dawn-review.googlesource.com/1560
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This splits off part of CommandBufferBuilder in separate
RenderPassEncoder and ComputePassEncoder objects. To match the WebGPU
IDL and factor some code, both these encoders inherit from
ProgrammablePassEncoder.
These encoders are pure frontend objects and record into the
CommandBufferBuilder command allocator objects, so no changes to the
backends were needed.
Error handling is still ew, because the "builder" mechanism we had
doesn't allow for "split builders". Nicer error handling will have to
wait on Dawn matching WebGPU.
All the tests and samples were updated to the new structure.
BUG=dawn:5
Change-Id: I5f5d4ad866e2c07fedd1ba7a122258c6610941f1
Reviewed-on: https://dawn-review.googlesource.com/1543
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
At this point this change is a noop, however encoders introduced in
follow-up patches aren't builders and thus won't have the fluent syntax.
BUG=dawn:5
Change-Id: Idc5f327a1a7788c3ba16a50491aefb054700f257
Reviewed-on: https://dawn-review.googlesource.com/1540
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
BUG=chromium:884015
Change-Id: Iee2373b23ab5534165b36c40600cae86545ee3d9
Reviewed-on: https://dawn-review.googlesource.com/1544
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This patch is the first one to support inspecting GPU information for
dawn_end2end_tests.
In this patch, we support collecting the device name, device id and
vendor id on D3D12 and Vulkan. We also support collecting the device
name on OpenGL. The collection on Metal will be supported in the next
patch. Using this information we implement a series of APIs to inspect
the information of both OS and GPU vendor.
We also skip two failed tests on Windows Intel Vulkan backends.
BUG=dawn:10
Change-Id: If52a960c0bae3922a0b5650500218eff1400d77a
Reviewed-on: https://dawn-review.googlesource.com/1460
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>