2022-05-11 22:05:15 +00:00
|
|
|
bug/dawn/947.wgsl:59:20 warning: 'textureSample' must only be called from uniform control flow
|
|
|
|
var srcColor = textureSample(myTexture, mySampler, texcoord);
|
|
|
|
^^^^^^^^^^^^^
|
|
|
|
|
2022-05-16 11:53:25 +00:00
|
|
|
bug/dawn/947.wgsl:55:5 note: control flow depends on non-uniform value
|
|
|
|
if (!all(clampedTexcoord == texcoord)) {
|
|
|
|
^^
|
|
|
|
|
2022-05-16 11:53:25 +00:00
|
|
|
bug/dawn/947.wgsl:55:33 note: reading from user-defined input 'texcoord' may result in a non-uniform value
|
|
|
|
if (!all(clampedTexcoord == texcoord)) {
|
|
|
|
^^^^^^^^
|
2022-05-11 22:05:15 +00:00
|
|
|
|
2021-11-16 15:15:36 +00:00
|
|
|
#version 310 es
|
|
|
|
|
2022-01-28 22:36:58 +00:00
|
|
|
layout(location = 0) out vec2 texcoords_1;
|
2022-09-02 19:19:10 +00:00
|
|
|
layout(binding = 0) uniform Uniforms_ubo {
|
2021-11-16 15:15:36 +00:00
|
|
|
vec2 u_scale;
|
|
|
|
vec2 u_offset;
|
|
|
|
} uniforms;
|
|
|
|
|
|
|
|
struct VertexOutputs {
|
|
|
|
vec2 texcoords;
|
|
|
|
vec4 position;
|
|
|
|
};
|
2022-01-26 16:48:55 +00:00
|
|
|
|
2022-01-28 22:36:58 +00:00
|
|
|
VertexOutputs vs_main(uint VertexIndex) {
|
2021-11-16 15:15:36 +00:00
|
|
|
vec2 texcoord[3] = vec2[3](vec2(-0.5f, 0.0f), vec2(1.5f, 0.0f), vec2(0.5f, 2.0f));
|
|
|
|
VertexOutputs tint_symbol = VertexOutputs(vec2(0.0f, 0.0f), vec4(0.0f, 0.0f, 0.0f, 0.0f));
|
2022-06-01 01:11:59 +00:00
|
|
|
tint_symbol.position = vec4(((texcoord[VertexIndex] * 2.0f) - vec2(1.0f)), 0.0f, 1.0f);
|
2021-11-16 15:15:36 +00:00
|
|
|
bool flipY = (uniforms.u_scale.y < 0.0f);
|
|
|
|
if (flipY) {
|
|
|
|
tint_symbol.texcoords = ((((texcoord[VertexIndex] * uniforms.u_scale) + uniforms.u_offset) * vec2(1.0f, -1.0f)) + vec2(0.0f, 1.0f));
|
|
|
|
} else {
|
|
|
|
tint_symbol.texcoords = ((((texcoord[VertexIndex] * vec2(1.0f, -1.0f)) + vec2(0.0f, 1.0f)) * uniforms.u_scale) + uniforms.u_offset);
|
|
|
|
}
|
|
|
|
return tint_symbol;
|
|
|
|
}
|
|
|
|
|
|
|
|
void main() {
|
2022-04-22 21:25:02 +00:00
|
|
|
gl_PointSize = 1.0;
|
2022-01-28 22:36:58 +00:00
|
|
|
VertexOutputs inner_result = vs_main(uint(gl_VertexID));
|
|
|
|
texcoords_1 = inner_result.texcoords;
|
|
|
|
gl_Position = inner_result.position;
|
|
|
|
gl_Position.y = -(gl_Position.y);
|
|
|
|
gl_Position.z = ((2.0f * gl_Position.z) - gl_Position.w);
|
|
|
|
return;
|
2021-11-16 15:15:36 +00:00
|
|
|
}
|
|
|
|
#version 310 es
|
|
|
|
precision mediump float;
|
|
|
|
|
2022-01-28 22:36:58 +00:00
|
|
|
layout(location = 0) in vec2 texcoord_1;
|
|
|
|
layout(location = 0) out vec4 value;
|
2021-12-09 15:45:03 +00:00
|
|
|
struct Uniforms {
|
|
|
|
vec2 u_scale;
|
|
|
|
vec2 u_offset;
|
|
|
|
};
|
2022-01-26 16:48:55 +00:00
|
|
|
|
2021-11-16 15:15:36 +00:00
|
|
|
struct VertexOutputs {
|
|
|
|
vec2 texcoords;
|
|
|
|
vec4 position;
|
|
|
|
};
|
2022-01-26 16:48:55 +00:00
|
|
|
|
2022-03-28 20:51:32 +00:00
|
|
|
bool tint_discard = false;
|
2022-01-24 17:17:22 +00:00
|
|
|
uniform highp sampler2D myTexture_mySampler;
|
|
|
|
|
2022-01-28 22:36:58 +00:00
|
|
|
vec4 fs_main(vec2 texcoord) {
|
2022-06-01 01:11:59 +00:00
|
|
|
vec2 clampedTexcoord = clamp(texcoord, vec2(0.0f), vec2(1.0f));
|
2021-11-16 16:16:56 +00:00
|
|
|
if (!(all(equal(clampedTexcoord, texcoord)))) {
|
2022-03-28 20:51:32 +00:00
|
|
|
tint_discard = true;
|
2022-06-01 01:11:59 +00:00
|
|
|
return vec4(0.0f);
|
2021-11-16 15:15:36 +00:00
|
|
|
}
|
2022-01-24 17:17:22 +00:00
|
|
|
vec4 srcColor = texture(myTexture_mySampler, texcoord);
|
2021-11-16 15:15:36 +00:00
|
|
|
return srcColor;
|
|
|
|
}
|
|
|
|
|
2022-03-28 20:51:32 +00:00
|
|
|
void tint_discard_func() {
|
|
|
|
discard;
|
|
|
|
}
|
|
|
|
|
2021-11-16 15:15:36 +00:00
|
|
|
void main() {
|
2022-01-28 22:36:58 +00:00
|
|
|
vec4 inner_result = fs_main(texcoord_1);
|
2022-03-28 20:51:32 +00:00
|
|
|
if (tint_discard) {
|
|
|
|
tint_discard_func();
|
|
|
|
return;
|
|
|
|
}
|
2022-01-28 22:36:58 +00:00
|
|
|
value = inner_result;
|
|
|
|
return;
|
2021-11-16 15:15:36 +00:00
|
|
|
}
|