dawn-cmake/test/tint/builtins/gen/literal/textureNumLevels/b1b12b.wgsl.expected.glsl

79 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

SKIP: FAILED
#version 310 es
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
uniform highp sampler2D arg_0_1;
void textureNumLevels_b1b12b() {
int res = textureQueryLevels(arg_0_1);
}
vec4 vertex_main() {
textureNumLevels_b1b12b();
return vec4(0.0f);
}
void main() {
gl_PointSize = 1.0;
vec4 inner_result = vertex_main();
gl_Position = inner_result;
gl_Position.y = -(gl_Position.y);
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
return;
}
Error parsing GLSL shader:
ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
ERROR: 0:5: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
#version 310 es
precision mediump float;
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
uniform highp sampler2D arg_0_1;
void textureNumLevels_b1b12b() {
int res = textureQueryLevels(arg_0_1);
}
void fragment_main() {
textureNumLevels_b1b12b();
}
void main() {
fragment_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:6: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:6: '=' : cannot convert from ' const float' to ' temp mediump int'
ERROR: 0:6: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
#version 310 es
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
uniform highp sampler2D arg_0_1;
void textureNumLevels_b1b12b() {
int res = textureQueryLevels(arg_0_1);
}
void compute_main() {
textureNumLevels_b1b12b();
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
compute_main();
return;
}
Error parsing GLSL shader:
ERROR: 0:5: 'textureQueryLevels' : no matching overloaded function found
ERROR: 0:5: '=' : cannot convert from ' const float' to ' temp highp int'
ERROR: 0:5: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.