mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
[glsl-out] Add stage postfix to generated global name (#1616)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,3 +12,4 @@ Cargo.lock
|
||||
/*.vert
|
||||
/*.frag
|
||||
/*.comp
|
||||
/*.wgsl
|
||||
|
||||
@@ -305,6 +305,16 @@ impl fmt::Display for VaryingName<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
impl ShaderStage {
|
||||
fn to_str(self) -> &'static str {
|
||||
match self {
|
||||
ShaderStage::Compute => "cs",
|
||||
ShaderStage::Fragment => "fs",
|
||||
ShaderStage::Vertex => "vs",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Shorthand result used internally by the backend
|
||||
type BackendResult<T = ()> = Result<T, Error>;
|
||||
|
||||
@@ -961,7 +971,12 @@ impl<'a, W: Write> Writer<'a, W> {
|
||||
) -> String {
|
||||
match global.binding {
|
||||
Some(ref br) => {
|
||||
format!("_group_{}_binding_{}", br.group, br.binding)
|
||||
format!(
|
||||
"_group_{}_binding_{}_{}",
|
||||
br.group,
|
||||
br.binding,
|
||||
self.entry_point.stage.to_str()
|
||||
)
|
||||
}
|
||||
None => self.names[&NameKey::GlobalVariable(handle)].clone(),
|
||||
}
|
||||
@@ -974,7 +989,13 @@ impl<'a, W: Write> Writer<'a, W> {
|
||||
global: &crate::GlobalVariable,
|
||||
) -> BackendResult {
|
||||
match global.binding {
|
||||
Some(ref br) => write!(self.out, "_group_{}_binding_{}", br.group, br.binding)?,
|
||||
Some(ref br) => write!(
|
||||
self.out,
|
||||
"_group_{}_binding_{}_{}",
|
||||
br.group,
|
||||
br.binding,
|
||||
self.entry_point.stage.to_str()
|
||||
)?,
|
||||
None => write!(
|
||||
self.out,
|
||||
"{}",
|
||||
|
||||
@@ -10,7 +10,7 @@ layout(std430) buffer Bar_block_0Compute {
|
||||
int atom;
|
||||
uvec2 arr[2];
|
||||
int data[];
|
||||
} _group_0_binding_0;
|
||||
} _group_0_binding_0_cs;
|
||||
|
||||
|
||||
float read_from_private(inout float foo_2) {
|
||||
@@ -20,24 +20,24 @@ float read_from_private(inout float foo_2) {
|
||||
|
||||
void main() {
|
||||
int tmp = 0;
|
||||
int value = _group_0_binding_0.atom;
|
||||
int _e6 = atomicAdd(_group_0_binding_0.atom, 5);
|
||||
int value = _group_0_binding_0_cs.atom;
|
||||
int _e6 = atomicAdd(_group_0_binding_0_cs.atom, 5);
|
||||
tmp = _e6;
|
||||
int _e9 = atomicAdd(_group_0_binding_0.atom, -5);
|
||||
int _e9 = atomicAdd(_group_0_binding_0_cs.atom, -5);
|
||||
tmp = _e9;
|
||||
int _e12 = atomicAnd(_group_0_binding_0.atom, 5);
|
||||
int _e12 = atomicAnd(_group_0_binding_0_cs.atom, 5);
|
||||
tmp = _e12;
|
||||
int _e15 = atomicOr(_group_0_binding_0.atom, 5);
|
||||
int _e15 = atomicOr(_group_0_binding_0_cs.atom, 5);
|
||||
tmp = _e15;
|
||||
int _e18 = atomicXor(_group_0_binding_0.atom, 5);
|
||||
int _e18 = atomicXor(_group_0_binding_0_cs.atom, 5);
|
||||
tmp = _e18;
|
||||
int _e21 = atomicMin(_group_0_binding_0.atom, 5);
|
||||
int _e21 = atomicMin(_group_0_binding_0_cs.atom, 5);
|
||||
tmp = _e21;
|
||||
int _e24 = atomicMax(_group_0_binding_0.atom, 5);
|
||||
int _e24 = atomicMax(_group_0_binding_0_cs.atom, 5);
|
||||
tmp = _e24;
|
||||
int _e27 = atomicExchange(_group_0_binding_0.atom, 5);
|
||||
int _e27 = atomicExchange(_group_0_binding_0_cs.atom, 5);
|
||||
tmp = _e27;
|
||||
_group_0_binding_0.atom = value;
|
||||
_group_0_binding_0_cs.atom = value;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ layout(std430) buffer Bar_block_0Vertex {
|
||||
int atom;
|
||||
uvec2 arr[2];
|
||||
int data[];
|
||||
} _group_0_binding_0;
|
||||
} _group_0_binding_0_vs;
|
||||
|
||||
|
||||
float read_from_private(inout float foo_2) {
|
||||
@@ -22,15 +22,15 @@ void main() {
|
||||
int c[5];
|
||||
float baz = foo_1;
|
||||
foo_1 = 1.0;
|
||||
mat4x4 matrix = _group_0_binding_0.matrix;
|
||||
uvec2 arr[2] = _group_0_binding_0.arr;
|
||||
float b = _group_0_binding_0.matrix[3][0];
|
||||
int a = _group_0_binding_0.data[(uint(_group_0_binding_0.data.length()) - 2u)];
|
||||
mat4x4 matrix = _group_0_binding_0_vs.matrix;
|
||||
uvec2 arr[2] = _group_0_binding_0_vs.arr;
|
||||
float b = _group_0_binding_0_vs.matrix[3][0];
|
||||
int a = _group_0_binding_0_vs.data[(uint(_group_0_binding_0_vs.data.length()) - 2u)];
|
||||
float _e25 = read_from_private(foo_1);
|
||||
_group_0_binding_0.matrix[1][2] = 1.0;
|
||||
_group_0_binding_0.matrix = mat4x4(vec4(0.0), vec4(1.0), vec4(2.0), vec4(3.0));
|
||||
_group_0_binding_0.arr = uvec2[2](uvec2(0u), uvec2(1u));
|
||||
_group_0_binding_0.data[1] = 1;
|
||||
_group_0_binding_0_vs.matrix[1][2] = 1.0;
|
||||
_group_0_binding_0_vs.matrix = mat4x4(vec4(0.0), vec4(1.0), vec4(2.0), vec4(3.0));
|
||||
_group_0_binding_0_vs.arr = uvec2[2](uvec2(0u), uvec2(1u));
|
||||
_group_0_binding_0_vs.data[1] = 1;
|
||||
c = int[5](a, int(b), 3, 4, 5);
|
||||
c[(vi + 1u)] = 42;
|
||||
int value = c[vi];
|
||||
|
||||
@@ -18,15 +18,15 @@ struct SimParams {
|
||||
float rule2Scale;
|
||||
float rule3Scale;
|
||||
};
|
||||
uniform SimParams_block_0Compute { SimParams _group_0_binding_0; };
|
||||
uniform SimParams_block_0Compute { SimParams _group_0_binding_0_cs; };
|
||||
|
||||
layout(std430) readonly buffer Particles_block_1Compute {
|
||||
Particle particles[];
|
||||
} _group_0_binding_1;
|
||||
} _group_0_binding_1_cs;
|
||||
|
||||
layout(std430) buffer Particles_block_2Compute {
|
||||
Particle particles[];
|
||||
} _group_0_binding_2;
|
||||
} _group_0_binding_2_cs;
|
||||
|
||||
|
||||
void main() {
|
||||
@@ -45,9 +45,9 @@ void main() {
|
||||
if ((index >= 1500u)) {
|
||||
return;
|
||||
}
|
||||
vec2 _e10 = _group_0_binding_1.particles[index].pos;
|
||||
vec2 _e10 = _group_0_binding_1_cs.particles[index].pos;
|
||||
vPos = _e10;
|
||||
vec2 _e15 = _group_0_binding_1.particles[index].vel;
|
||||
vec2 _e15 = _group_0_binding_1_cs.particles[index].vel;
|
||||
vVel = _e15;
|
||||
cMass = vec2(0.0, 0.0);
|
||||
cVel = vec2(0.0, 0.0);
|
||||
@@ -68,14 +68,14 @@ void main() {
|
||||
continue;
|
||||
}
|
||||
uint _e42 = i;
|
||||
vec2 _e45 = _group_0_binding_1.particles[_e42].pos;
|
||||
vec2 _e45 = _group_0_binding_1_cs.particles[_e42].pos;
|
||||
pos = _e45;
|
||||
uint _e47 = i;
|
||||
vec2 _e50 = _group_0_binding_1.particles[_e47].vel;
|
||||
vec2 _e50 = _group_0_binding_1_cs.particles[_e47].vel;
|
||||
vel = _e50;
|
||||
vec2 _e51 = pos;
|
||||
vec2 _e52 = vPos;
|
||||
float _e55 = _group_0_binding_0.rule1Distance;
|
||||
float _e55 = _group_0_binding_0_cs.rule1Distance;
|
||||
if ((distance(_e51, _e52) < _e55)) {
|
||||
vec2 _e57 = cMass;
|
||||
vec2 _e58 = pos;
|
||||
@@ -85,7 +85,7 @@ void main() {
|
||||
}
|
||||
vec2 _e63 = pos;
|
||||
vec2 _e64 = vPos;
|
||||
float _e67 = _group_0_binding_0.rule2Distance;
|
||||
float _e67 = _group_0_binding_0_cs.rule2Distance;
|
||||
if ((distance(_e63, _e64) < _e67)) {
|
||||
vec2 _e69 = colVel;
|
||||
vec2 _e70 = pos;
|
||||
@@ -94,7 +94,7 @@ void main() {
|
||||
}
|
||||
vec2 _e74 = pos;
|
||||
vec2 _e75 = vPos;
|
||||
float _e78 = _group_0_binding_0.rule3Distance;
|
||||
float _e78 = _group_0_binding_0_cs.rule3Distance;
|
||||
if ((distance(_e74, _e75) < _e78)) {
|
||||
vec2 _e80 = cVel;
|
||||
vec2 _e81 = vel;
|
||||
@@ -118,18 +118,18 @@ void main() {
|
||||
}
|
||||
vec2 _e107 = vVel;
|
||||
vec2 _e108 = cMass;
|
||||
float _e110 = _group_0_binding_0.rule1Scale;
|
||||
float _e110 = _group_0_binding_0_cs.rule1Scale;
|
||||
vec2 _e113 = colVel;
|
||||
float _e115 = _group_0_binding_0.rule2Scale;
|
||||
float _e115 = _group_0_binding_0_cs.rule2Scale;
|
||||
vec2 _e118 = cVel;
|
||||
float _e120 = _group_0_binding_0.rule3Scale;
|
||||
float _e120 = _group_0_binding_0_cs.rule3Scale;
|
||||
vVel = (((_e107 + (_e108 * _e110)) + (_e113 * _e115)) + (_e118 * _e120));
|
||||
vec2 _e123 = vVel;
|
||||
vec2 _e125 = vVel;
|
||||
vVel = (normalize(_e123) * clamp(length(_e125), 0.0, 0.10000000149011612));
|
||||
vec2 _e131 = vPos;
|
||||
vec2 _e132 = vVel;
|
||||
float _e134 = _group_0_binding_0.deltaT;
|
||||
float _e134 = _group_0_binding_0_cs.deltaT;
|
||||
vPos = (_e131 + (_e132 * _e134));
|
||||
float _e138 = vPos.x;
|
||||
if ((_e138 < -1.0)) {
|
||||
@@ -148,9 +148,9 @@ void main() {
|
||||
vPos.y = -1.0;
|
||||
}
|
||||
vec2 _e164 = vPos;
|
||||
_group_0_binding_2.particles[index].pos = _e164;
|
||||
_group_0_binding_2_cs.particles[index].pos = _e164;
|
||||
vec2 _e168 = vVel;
|
||||
_group_0_binding_2.particles[index].vel = _e168;
|
||||
_group_0_binding_2_cs.particles[index].vel = _e168;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
uniform highp samplerCubeArrayShadow _group_0_binding_4;
|
||||
uniform highp samplerCubeArrayShadow _group_0_binding_4_fs;
|
||||
|
||||
layout(location = 0) out vec4 _fs2p_location0;
|
||||
|
||||
void main() {
|
||||
vec3 frag_ls = vec4(1.0, 1.0, 2.0, 1.0).xyz;
|
||||
float a = texture(_group_0_binding_4, vec4(frag_ls, int(1)), 1.0);
|
||||
float a = texture(_group_0_binding_4_fs, vec4(frag_ls, int(1)), 1.0);
|
||||
_fs2p_location0 = vec4(a, 1.0, 1.0, 1.0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4,18 +4,18 @@
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
uniform highp sampler2D _group_0_binding_1;
|
||||
uniform highp sampler2D _group_0_binding_1_fs;
|
||||
|
||||
uniform highp sampler2DShadow _group_1_binding_2;
|
||||
uniform highp sampler2DShadow _group_1_binding_2_fs;
|
||||
|
||||
layout(location = 0) out vec4 _fs2p_location0;
|
||||
|
||||
void main() {
|
||||
vec2 tc = vec2(0.5);
|
||||
vec4 s2d = textureGather(_group_0_binding_1, vec2(tc), 1);
|
||||
vec4 s2d_offset = textureGatherOffset(_group_0_binding_1, vec2(tc), ivec2(3, 1), 3);
|
||||
vec4 s2d_depth = textureGather(_group_1_binding_2, vec2(tc), 0.5);
|
||||
vec4 s2d_depth_offset = textureGatherOffset(_group_1_binding_2, vec2(tc), 0.5, ivec2(3, 1));
|
||||
vec4 s2d = textureGather(_group_0_binding_1_fs, vec2(tc), 1);
|
||||
vec4 s2d_offset = textureGatherOffset(_group_0_binding_1_fs, vec2(tc), ivec2(3, 1), 3);
|
||||
vec4 s2d_depth = textureGather(_group_1_binding_2_fs, vec2(tc), 0.5);
|
||||
vec4 s2d_depth_offset = textureGatherOffset(_group_1_binding_2_fs, vec2(tc), 0.5, ivec2(3, 1));
|
||||
_fs2p_location0 = (((s2d + s2d_offset) + s2d_depth) + s2d_depth_offset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -6,26 +6,26 @@ precision highp int;
|
||||
|
||||
layout(local_size_x = 16, local_size_y = 1, local_size_z = 1) in;
|
||||
|
||||
uniform highp usampler2D _group_0_binding_0;
|
||||
uniform highp usampler2D _group_0_binding_0_cs;
|
||||
|
||||
uniform highp usampler2DMS _group_0_binding_3;
|
||||
uniform highp usampler2DMS _group_0_binding_3_cs;
|
||||
|
||||
layout(rgba8ui) readonly uniform highp uimage2D _group_0_binding_1;
|
||||
layout(rgba8ui) readonly uniform highp uimage2D _group_0_binding_1_cs;
|
||||
|
||||
uniform highp usampler2DArray _group_0_binding_5;
|
||||
uniform highp usampler2DArray _group_0_binding_5_cs;
|
||||
|
||||
layout(r32ui) writeonly uniform highp uimage2D _group_0_binding_2;
|
||||
layout(r32ui) writeonly uniform highp uimage2D _group_0_binding_2_cs;
|
||||
|
||||
|
||||
void main() {
|
||||
uvec3 local_id = gl_LocalInvocationID;
|
||||
ivec2 dim = imageSize(_group_0_binding_1).xy;
|
||||
ivec2 dim = imageSize(_group_0_binding_1_cs).xy;
|
||||
ivec2 itc = ((dim * ivec2(local_id.xy)) % ivec2(10, 20));
|
||||
uvec4 value1_ = texelFetch(_group_0_binding_0, itc, int(local_id.z));
|
||||
uvec4 value2_ = texelFetch(_group_0_binding_3, itc, int(local_id.z));
|
||||
uvec4 value4_ = imageLoad(_group_0_binding_1, itc);
|
||||
uvec4 value5_ = texelFetch(_group_0_binding_5, ivec3(itc, int(local_id.z)), (int(local_id.z) + 1));
|
||||
imageStore(_group_0_binding_2, ivec2(itc.x, 0.0), (((value1_ + value2_) + value4_) + value5_));
|
||||
uvec4 value1_ = texelFetch(_group_0_binding_0_cs, itc, int(local_id.z));
|
||||
uvec4 value2_ = texelFetch(_group_0_binding_3_cs, itc, int(local_id.z));
|
||||
uvec4 value4_ = imageLoad(_group_0_binding_1_cs, itc);
|
||||
uvec4 value5_ = texelFetch(_group_0_binding_5_cs, ivec3(itc, int(local_id.z)), (int(local_id.z) + 1));
|
||||
imageStore(_group_0_binding_2_cs, ivec2(itc.x, 0.0), (((value1_ + value2_) + value4_) + value5_));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,31 +4,31 @@
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
uniform highp sampler2D _group_0_binding_0;
|
||||
uniform highp sampler2D _group_0_binding_0_vs;
|
||||
|
||||
uniform highp sampler2D _group_0_binding_1;
|
||||
uniform highp sampler2D _group_0_binding_1_vs;
|
||||
|
||||
uniform highp sampler2DArray _group_0_binding_2;
|
||||
uniform highp sampler2DArray _group_0_binding_2_vs;
|
||||
|
||||
uniform highp samplerCube _group_0_binding_3;
|
||||
uniform highp samplerCube _group_0_binding_3_vs;
|
||||
|
||||
uniform highp samplerCubeArray _group_0_binding_4;
|
||||
uniform highp samplerCubeArray _group_0_binding_4_vs;
|
||||
|
||||
uniform highp sampler3D _group_0_binding_5;
|
||||
uniform highp sampler3D _group_0_binding_5_vs;
|
||||
|
||||
|
||||
void main() {
|
||||
int dim_1d = textureSize(_group_0_binding_0, 0).x;
|
||||
ivec2 dim_2d = textureSize(_group_0_binding_1, 0).xy;
|
||||
ivec2 dim_2d_lod = textureSize(_group_0_binding_1, 1).xy;
|
||||
ivec2 dim_2d_array = textureSize(_group_0_binding_2, 0).xy;
|
||||
ivec2 dim_2d_array_lod = textureSize(_group_0_binding_2, 1).xy;
|
||||
ivec2 dim_cube = textureSize(_group_0_binding_3, 0).xy;
|
||||
ivec2 dim_cube_lod = textureSize(_group_0_binding_3, 1).xy;
|
||||
ivec2 dim_cube_array = textureSize(_group_0_binding_4, 0).xy;
|
||||
ivec2 dim_cube_array_lod = textureSize(_group_0_binding_4, 1).xy;
|
||||
ivec3 dim_3d = textureSize(_group_0_binding_5, 0).xyz;
|
||||
ivec3 dim_3d_lod = textureSize(_group_0_binding_5, 1).xyz;
|
||||
int dim_1d = textureSize(_group_0_binding_0_vs, 0).x;
|
||||
ivec2 dim_2d = textureSize(_group_0_binding_1_vs, 0).xy;
|
||||
ivec2 dim_2d_lod = textureSize(_group_0_binding_1_vs, 1).xy;
|
||||
ivec2 dim_2d_array = textureSize(_group_0_binding_2_vs, 0).xy;
|
||||
ivec2 dim_2d_array_lod = textureSize(_group_0_binding_2_vs, 1).xy;
|
||||
ivec2 dim_cube = textureSize(_group_0_binding_3_vs, 0).xy;
|
||||
ivec2 dim_cube_lod = textureSize(_group_0_binding_3_vs, 1).xy;
|
||||
ivec2 dim_cube_array = textureSize(_group_0_binding_4_vs, 0).xy;
|
||||
ivec2 dim_cube_array_lod = textureSize(_group_0_binding_4_vs, 1).xy;
|
||||
ivec3 dim_3d = textureSize(_group_0_binding_5_vs, 0).xyz;
|
||||
ivec3 dim_3d_lod = textureSize(_group_0_binding_5_vs, 1).xyz;
|
||||
int sum = ((((((((((dim_1d + dim_2d.y) + dim_2d_lod.y) + dim_2d_array.y) + dim_2d_array_lod.y) + dim_cube.y) + dim_cube_lod.y) + dim_cube_array.y) + dim_cube_array_lod.y) + dim_3d.z) + dim_3d_lod.z);
|
||||
gl_Position = vec4(float(sum));
|
||||
gl_Position.yz = vec2(-gl_Position.y, gl_Position.z * 2.0 - gl_Position.w);
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
uniform highp sampler2D _group_0_binding_0;
|
||||
uniform highp sampler2D _group_0_binding_0_fs;
|
||||
|
||||
uniform highp sampler2D _group_0_binding_1;
|
||||
uniform highp sampler2D _group_0_binding_1_fs;
|
||||
|
||||
layout(location = 0) out vec4 _fs2p_location0;
|
||||
|
||||
void main() {
|
||||
vec2 tc = vec2(0.5);
|
||||
vec4 s1d = texture(_group_0_binding_0, vec2(tc.x, 0.0));
|
||||
vec4 s2d = texture(_group_0_binding_1, vec2(tc));
|
||||
vec4 s2d_offset = textureOffset(_group_0_binding_1, vec2(tc), ivec2(3, 1));
|
||||
vec4 s2d_level = textureLod(_group_0_binding_1, vec2(tc), 2.299999952316284);
|
||||
vec4 s2d_level_offset = textureLodOffset(_group_0_binding_1, vec2(tc), 2.299999952316284, ivec2(3, 1));
|
||||
vec4 s1d = texture(_group_0_binding_0_fs, vec2(tc.x, 0.0));
|
||||
vec4 s2d = texture(_group_0_binding_1_fs, vec2(tc));
|
||||
vec4 s2d_offset = textureOffset(_group_0_binding_1_fs, vec2(tc), ivec2(3, 1));
|
||||
vec4 s2d_level = textureLod(_group_0_binding_1_fs, vec2(tc), 2.299999952316284);
|
||||
vec4 s2d_level_offset = textureLodOffset(_group_0_binding_1_fs, vec2(tc), 2.299999952316284, ivec2(3, 1));
|
||||
_fs2p_location0 = ((((s1d + s2d) + s2d_offset) + s2d_level) + s2d_level_offset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4,14 +4,14 @@
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
uniform highp sampler2DShadow _group_1_binding_2;
|
||||
uniform highp sampler2DShadow _group_1_binding_2_fs;
|
||||
|
||||
layout(location = 0) out float _fs2p_location0;
|
||||
|
||||
void main() {
|
||||
vec2 tc = vec2(0.5);
|
||||
float s2d_depth = texture(_group_1_binding_2, vec3(tc, 0.5));
|
||||
float s2d_depth_level = textureLod(_group_1_binding_2, vec3(tc, 0.5), 0.0);
|
||||
float s2d_depth = texture(_group_1_binding_2_fs, vec3(tc, 0.5));
|
||||
float s2d_depth_level = textureLod(_group_1_binding_2_fs, vec3(tc, 0.5), 0.0);
|
||||
_fs2p_location0 = (s2d_depth + s2d_depth_level);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ struct VertexOutput {
|
||||
vec2 uv;
|
||||
vec4 position;
|
||||
};
|
||||
uniform highp sampler2D _group_0_binding_0;
|
||||
uniform highp sampler2D _group_0_binding_0_fs;
|
||||
|
||||
smooth in vec2 _vs2fs_location0;
|
||||
layout(location = 0) out vec4 _fs2p_location0;
|
||||
|
||||
void main() {
|
||||
vec2 uv_1 = _vs2fs_location0;
|
||||
vec4 color = texture(_group_0_binding_0, vec2(uv_1));
|
||||
vec4 color = texture(_group_0_binding_0_fs, vec2(uv_1));
|
||||
if ((color.w == 0.0)) {
|
||||
discard;
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@ struct Light {
|
||||
vec4 pos;
|
||||
vec4 color;
|
||||
};
|
||||
uniform Globals_block_0Fragment { Globals _group_0_binding_0; };
|
||||
uniform Globals_block_0Fragment { Globals _group_0_binding_0_fs; };
|
||||
|
||||
layout(std430) readonly buffer Lights_block_1Fragment {
|
||||
Light data[];
|
||||
} _group_0_binding_1;
|
||||
} _group_0_binding_1_fs;
|
||||
|
||||
uniform highp sampler2DArrayShadow _group_0_binding_2;
|
||||
uniform highp sampler2DArrayShadow _group_0_binding_2_fs;
|
||||
|
||||
layout(location = 0) smooth in vec3 _vs2fs_location0;
|
||||
layout(location = 1) smooth in vec4 _vs2fs_location1;
|
||||
@@ -29,7 +29,7 @@ float fetch_shadow(uint light_id, vec4 homogeneous_coords) {
|
||||
}
|
||||
vec2 flip_correction = vec2(0.5, -0.5);
|
||||
vec2 light_local = (((homogeneous_coords.xy * flip_correction) / vec2(homogeneous_coords.w)) + vec2(0.5, 0.5));
|
||||
float _e26 = textureGrad(_group_0_binding_2, vec4(light_local, int(light_id), (homogeneous_coords.z / homogeneous_coords.w)), vec2(0,0), vec2(0,0));
|
||||
float _e26 = textureGrad(_group_0_binding_2_fs, vec4(light_local, int(light_id), (homogeneous_coords.z / homogeneous_coords.w)), vec2(0,0), vec2(0,0));
|
||||
return _e26;
|
||||
}
|
||||
|
||||
@@ -47,12 +47,12 @@ void main() {
|
||||
}
|
||||
loop_init = false;
|
||||
uint _e12 = i;
|
||||
uint _e15 = _group_0_binding_0.num_lights.x;
|
||||
uint _e15 = _group_0_binding_0_fs.num_lights.x;
|
||||
if ((_e12 >= min(_e15, 10u))) {
|
||||
break;
|
||||
}
|
||||
uint _e19 = i;
|
||||
Light light = _group_0_binding_1.data[_e19];
|
||||
Light light = _group_0_binding_1_fs.data[_e19];
|
||||
uint _e22 = i;
|
||||
float _e25 = fetch_shadow(_e22, (light.proj * position));
|
||||
vec3 light_dir = normalize((light.pos.xyz - position.xyz));
|
||||
|
||||
@@ -11,14 +11,14 @@ struct Data {
|
||||
mat4x4 proj_inv;
|
||||
mat4x4 view;
|
||||
};
|
||||
layout(binding = 0) uniform highp samplerCube _group_0_binding_1;
|
||||
layout(binding = 0) uniform highp samplerCube _group_0_binding_1_fs;
|
||||
|
||||
layout(location = 0) smooth in vec3 _vs2fs_location0;
|
||||
layout(location = 0) out vec4 _fs2p_location0;
|
||||
|
||||
void main() {
|
||||
VertexOutput in_ = VertexOutput(gl_FragCoord, _vs2fs_location0);
|
||||
vec4 _e5 = texture(_group_0_binding_1, vec3(in_.uv));
|
||||
vec4 _e5 = texture(_group_0_binding_1_fs, vec3(in_.uv));
|
||||
_fs2p_location0 = _e5;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ struct Data {
|
||||
mat4x4 proj_inv;
|
||||
mat4x4 view;
|
||||
};
|
||||
layout(std140, binding = 0) uniform Data_block_0Vertex { Data _group_0_binding_0; };
|
||||
layout(std140, binding = 0) uniform Data_block_0Vertex { Data _group_0_binding_0_vs; };
|
||||
|
||||
layout(location = 0) smooth out vec3 _vs2fs_location0;
|
||||
|
||||
@@ -24,11 +24,11 @@ void main() {
|
||||
int _e10 = tmp1_;
|
||||
int _e16 = tmp2_;
|
||||
vec4 pos = vec4(((float(_e10) * 4.0) - 1.0), ((float(_e16) * 4.0) - 1.0), 0.0, 1.0);
|
||||
vec4 _e27 = _group_0_binding_0.view[0];
|
||||
vec4 _e31 = _group_0_binding_0.view[1];
|
||||
vec4 _e35 = _group_0_binding_0.view[2];
|
||||
vec4 _e27 = _group_0_binding_0_vs.view[0];
|
||||
vec4 _e31 = _group_0_binding_0_vs.view[1];
|
||||
vec4 _e35 = _group_0_binding_0_vs.view[2];
|
||||
mat3x3 inv_model_view = transpose(mat3x3(_e27.xyz, _e31.xyz, _e35.xyz));
|
||||
mat4x4 _e40 = _group_0_binding_0.proj_inv;
|
||||
mat4x4 _e40 = _group_0_binding_0_vs.proj_inv;
|
||||
vec4 unprojected = (_e40 * pos);
|
||||
VertexOutput _tmp_return = VertexOutput(pos, (inv_model_view * unprojected.xyz));
|
||||
gl_Position = _tmp_return.position;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
uniform highp sampler2D _group_0_binding_0;
|
||||
uniform highp sampler2D _group_0_binding_0_fs;
|
||||
|
||||
layout(location = 0) out vec4 _fs2p_location0;
|
||||
|
||||
@@ -13,7 +13,7 @@ vec4 test(highp sampler2D Passed_Texture) {
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 _e2 = test(_group_0_binding_0);
|
||||
vec4 _e2 = test(_group_0_binding_0_fs);
|
||||
_fs2p_location0 = _e2;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user