mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
When validating IR, verify that all `Binding`s for vertex shader outputs and fragment shader inputs, whether directly in the argument or result, or applied to a struct member, has specified an interpolation and sampling, not `None`. This ensures that front ends explicitly state their policies, rather than coasting through on back ends' default behavior. In practice, all our front ends have very similar defaults, so provide a utility function on `Module` to apply these rules. Use this utility function in the SPIR-V and WGSL front ends; GLSL seems to already fill in interpolation as required.
25 lines
462 B
GLSL
25 lines
462 B
GLSL
#version 310 es
|
|
|
|
precision highp float;
|
|
|
|
struct VertexOutput {
|
|
vec2 uv;
|
|
vec4 position;
|
|
};
|
|
|
|
uniform highp sampler2D _group_0_binding_0;
|
|
|
|
smooth layout(location = 0) in vec2 _vs2fs_location0;
|
|
layout(location = 0) out vec4 _fs2p_location0;
|
|
|
|
void main() {
|
|
vec2 uv2 = _vs2fs_location0;
|
|
vec4 _expr4 = texture(_group_0_binding_0, vec2(uv2));
|
|
if((_expr4[3] == 0.0)) {
|
|
discard;
|
|
}
|
|
_fs2p_location0 = (_expr4[3] * _expr4);
|
|
return;
|
|
}
|
|
|