dawn-cmake/test/benchmark
Stephen White d9b32c3178 GLSL: fix textureLoad() and textureStore(), depth textures, and more.
The CombineSamplers transform was incorrectly flagging StorageTexture
(which in GLSL ends up as image2D) as needing to be combined with a
sampler, or at least renamed. This is incorrect: StorageTexture never
has an associated sampler, so don't try to pair it up and just output
it as image* in GLSL.

In GLSL, textureLoad (aka texelFetch) of depth textures is not allowed.
The fix is to bind the depth texture as the corresponding f32 texture
instead (e.g., texture_depth_2d -> texture_2d<f32>,
texture_depth_cube -> texture_cube<f32>, etc). This requires changing
both the uniform globals and function parameter types. We're now going
to receive a vec4 instead of a float from texelFetch, so add a ".x"
member accessor to retrieve the first component. (Note that we don't
do this inside a CallStatement since this gives the CloneContext
indigestion, and CallStatement is going to ignore the result of the
call anyway.)

We were failing to find the dummy samplers that Dawn creates for the
calls that actually do require a dummy sampler, since the old Inspector
implementation of GetSamplerTextureUses() does not find them. The fix
is to implement a new Inspector call to return the texture/sampler
pairs the Resolver found during resolution. This will include the
dummy sampler as a null variable pointer.

In order to identify the placeholder sampler, we pass in a BindingPair
to represent it. When we discover a null sampler in the variable pair,
we return the passed-in placeholder binding point to the caller (Dawn).
(Dawn will use a group of kMaxBindGroups, to ensure that it never
collides with an existing sampler.)

Bug: tint:1298
Change-Id: I82e142c2b4318608c27a9fa9521c27f15a6214cd
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/78820
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2022-02-03 22:39:13 +00:00
..
animometer.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00
animometer.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
bloom-vertical-blur.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00
cluster-lights.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00
empty.wgsl benchmarks: Add a basic set of benchmarks 2022-01-18 18:58:16 +00:00
metaball-isosurface.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00
particles.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
particles.wgsl.expected.glsl GLSL: fix textureLoad() and textureStore(), depth textures, and more. 2022-02-03 22:39:13 +00:00
shadow-fragment.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00
simple-compute.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00
simple-fragment.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00
simple-vertex.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00
skinned-shadowed-pbr-fragment.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00
skinned-shadowed-pbr-fragment.wgsl.expected.glsl GLSL: fix textureLoad() and textureStore(), depth textures, and more. 2022-02-03 22:39:13 +00:00
skinned-shadowed-pbr-vertex.wgsl test/benchmark: Add more shaders to the corpus 2022-01-21 22:38:16 +00:00