Added a new transform::RemoveContinueInSwitch that replaces continue
statements in switch cases with setting a bool variable, and checking if
the variable is set after the switch to continue.
Bug: tint:1080
Change-Id: I3c0a6c790e1bb612fac3f927a4bd5beb2d0d4ed1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/84960
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
The CMake file states c++17, Chromium is at c++17. This CL updates the
style guide documentation to specify c++17 as required for Tint.
Change-Id: I4dd8e9aa69de6f32a59ced2c5b861c83adf2edfe
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85320
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Bug: dawn:549
Change-Id: I5d6306f33b7ad2247ee75a0c5387a2bc6fac0497
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/83901
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Loko Kung <lokokung@google.com>
Spec issue: https://github.com/gpuweb/gpuweb/issues/2715
Spec PR: https://github.com/gpuweb/gpuweb/pull/2716
This is invalid in the Metal API because MTLTextureType2DArray is
imcompatible with MTLTextureType2DMultisample, even if the layer
count is 1.
MTLTextureType2DMultisampleArray is not supported until macOS 10.14
and iOS 14.0.
Further, the view type must match between the API and the shader.
a 2D view array requires texture2d_array in MSL.
It would be inconsistent to allow 1-layer 2D arrays which internally
get translated as (non-array) MTLTextureType2DMultisample. You would
expect to need to use texture2d_ms_array in the shader.
Change-Id: Ib9268c1276d3d31e90d6c61118e27fa2afd0617d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85200
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
Contains generic Map and Set types.
Golang 1.18 added new support for generics, but has not yet added a standard library that provides generic containers. In future versions of Golang, there will almost certainly be similar implementations of these types.
Until then, use these to simplify some code.
100% test coverage.
Bug: dawn:1342
Change-Id: I2a5c7bfb26f15c2099037d3fa0f0576df641d9f6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85220
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This function was copy-pasted in two transforms, and will be used in the
next one I'm writing.
Bug: tint:1080
Change-Id: Ic5ffe68a7e9d00b37722e8f5faff01e9e15fa6b1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85262
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
The test files were already updated manually in a previous change, so
we just need to update the template file to match.
Bug: tint:1475
Change-Id: I6f1b3d3a7a3df014b58e67ec2645b1dfcc275de1
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/85260
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Disable the scissor test during clear.
Change-Id: Ia6945304c257867ed5cb6a6ae0c2c49998a33ca7
Bug: dawn:1340
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85143
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Addressing issues that showed up after the initial stencil8 CL landed.
D3D12:
- Selecting the `all` aspect of a `stencil8` texture was ASSERTing
Metal:
- Using the `stencil` aspect of a `stencil8` texture was hitting an
UNREACHABLE().
Bug: dawn:666
Change-Id: Ic2931dbb915e109727ca24e3216a661fba84e508
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85021
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
Change-Id: Iee67027431d791d6425e0cc502f6b6a23bc160d6
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85141
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Script was opening file in text mode and failing with:
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position
299: character maps to <undefined>
Fixed by opening file in binary mode.
Change-Id: I4db670438164116d9a41eb9e7e725868037c17fc
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85161
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
glBlitFramebuffer() takes min and max coordinates, not min and size.
Bug: dawn:1084
Change-Id: I7b8b53ecd9c5ade20d4d7a909bd134c13a2d960b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85081
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Move texture allocation in an AllocateTexture() local.
Use the GL target to determine the choice of allocation call, not
the Dawn TextureDimension. This leaves TargetForTexture() and
TargetForTextureViewDimension() as the authorities on Dawn -> GL
conversion.
Change-Id: Ia31fbba9a8e71a9ce8dd9c89676dbc51d8848bb5
Bug: dawn:593
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85080
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
This simplifies reference management and make the swapchain's reentrant
code avoid APIEntryPoints.
Bug: dawn:723
Change-Id: I6c456b9ec349c73d783dbb12a284f322d0be4e1a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84763
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Now WebGPU objects can be destroyed in any order without the risk of
causing segfaults.
Bug: None
Change-Id: I00aecf49aa65308c13ab0accc69152fa1361d714
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84768
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
On D3D12 backend, external texture holds mD3D11on12Resource which caches
D3D11on12Resources and guarding by refptr. The texture will released this ref
until destructor works.
This model leaks the gpu memory if client fails to release all the ref to
the texture.
Instead, external texture also provides a method called "Destroy". It is
called more eagerly and means the external texture is in the end of lifecycle.
So thid CL moves the ref reset of D3D11on12Resource into Destroy(). This prevents
unexpected gpu memory leak caused by client missing ref release call.
Bug: 1308405
Change-Id: I253e1eda192256e4bd1c470e26dcc6af3c234447
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85000
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
And reject the device creation promise with an error that looks like an
OperationError to make the CTS happy.
Bug: dawn:1242
Change-Id: I43ec3ebc030cb4178520c9174e164a42b94f6bf8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85060
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Implement new transform UnwindDiscardFunctions that replaces discard
statements with setting a module-level bool, adds a check and return for
this bool after every function call that may discard, and finally
invokes a single function that executes a discard from top-level
functions.
Regenerated tests and remove HLSL ones that used to fail FXC because it
had difficulty with discard.
Bug: tint:1478
Bug: chromium:1118
Change-Id: I09d680f59e2d5d0cad907bfbbdd426aae76d4bf3
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/84221
Reviewed-by: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
When enabled, for each test, FXC is run first, and if it succeeds, DXC
is run. If both succeed, the test passes, otherwise it fails. This
option allows us to get meaningful feedback from running this script
against HLSL files, as well as taking advantage of the feature to delete
skips for tests that now pass (both FXC and DXC in this case).
Change-Id: Iae2ebfda7bd92f1b94893e648e2d1fb1f6979b39
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/84680
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Now the message will report the details of both the expected and
incompatible attachment states, helping developers see what the source
of the error was.
Bug: dawn:563
Change-Id: I58eea166cb2da634f0295fb4660c982f96c62a2d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84940
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <bajones@chromium.org>
External textures are handled purely in the frontend so there is no need
to update the backend BGL to handle them. The TODOs can just be removed.
Bug: dawn:728
Change-Id: I319cf2a79bdc06a1457f3ec5746b07b5d05eef62
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/84767
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
- Format specific targets to have the hash in the target rule instead
of a variable.
- Only have the base part of the URL in a variable
- Use vulkan-deps instead of individual DEPS (spirv-tools,
spirv-headers & glslang)
BUG=tint:1481
Change-Id: I871a656e26050698da2c77f4f39fec94a9c4f8a4
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/84723
Reviewed-by: David Neto <dneto@google.com>
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>