dawn-cmake/test/types
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
..
texture GLSL: fix textureLoad() and textureStore(), depth textures, and more. 2022-02-03 22:39:13 +00:00
function_scope_declarations.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
function_scope_declarations.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
function_scope_declarations.wgsl.expected.hlsl writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
function_scope_declarations.wgsl.expected.msl validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
function_scope_declarations.wgsl.expected.spvasm validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
function_scope_declarations.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
function_scope_var_conversions.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
function_scope_var_conversions.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
function_scope_var_conversions.wgsl.expected.hlsl Add support for converting bool to other types 2021-07-19 17:35:39 +00:00
function_scope_var_conversions.wgsl.expected.msl Add support for converting bool to other types 2021-07-19 17:35:39 +00:00
function_scope_var_conversions.wgsl.expected.spvasm Add support for converting bool to other types 2021-07-19 17:35:39 +00:00
function_scope_var_conversions.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
module_scope_let.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
module_scope_let.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
module_scope_let.wgsl.expected.hlsl writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
module_scope_let.wgsl.expected.msl validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
module_scope_let.wgsl.expected.spvasm validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
module_scope_let.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
module_scope_var.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
module_scope_var.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
module_scope_var.wgsl.expected.hlsl writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
module_scope_var.wgsl.expected.msl validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
module_scope_var.wgsl.expected.spvasm validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
module_scope_var.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
module_scope_var_conversions.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
module_scope_var_conversions.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
module_scope_var_conversions.wgsl.expected.hlsl Add support for converting bool to other types 2021-07-19 17:35:39 +00:00
module_scope_var_conversions.wgsl.expected.msl Add support for converting bool to other types 2021-07-19 17:35:39 +00:00
module_scope_var_conversions.wgsl.expected.spvasm Add support for converting bool to other types 2021-07-19 17:35:39 +00:00
module_scope_var_conversions.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
module_scope_var_initializers.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
module_scope_var_initializers.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
module_scope_var_initializers.wgsl.expected.hlsl writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
module_scope_var_initializers.wgsl.expected.msl validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
module_scope_var_initializers.wgsl.expected.spvasm validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
module_scope_var_initializers.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
parameters.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
parameters.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
parameters.wgsl.expected.hlsl writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
parameters.wgsl.expected.msl validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
parameters.wgsl.expected.spvasm validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
parameters.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
return_types.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
return_types.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
return_types.wgsl.expected.hlsl writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
return_types.wgsl.expected.msl validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
return_types.wgsl.expected.spvasm validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
return_types.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
sampler.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
sampler.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
sampler.wgsl.expected.hlsl Migrate more tests from Ignore() to phony-assignment 2021-10-22 00:21:44 +00:00
sampler.wgsl.expected.msl msl: Handle buffer variables in transform 2021-10-28 15:00:39 +00:00
sampler.wgsl.expected.spvasm Migrate more tests from Ignore() to phony-assignment 2021-10-22 00:21:44 +00:00
sampler.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
struct_members.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00
struct_members.wgsl.expected.glsl GLSL: move entry point handling to CanonicalizeEntryPointIO transform. 2022-01-28 22:36:58 +00:00
struct_members.wgsl.expected.hlsl writer/hlsl: Don't wrap arrays in structures 2021-07-05 15:20:57 +00:00
struct_members.wgsl.expected.msl validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
struct_members.wgsl.expected.spvasm validation: structures cannot be empty 2021-07-01 08:13:41 +00:00
struct_members.wgsl.expected.wgsl wgsl: Replace [[decoration]] with @decoration 2022-01-19 22:46:57 +00:00