Fix signed % wrong for negative operands on NVIDIA (OpSRem poison without maintenance8) (#9674)

This commit is contained in:
Marc Stampfli authored and GitHub committed 2026-07-01 09:49:30 +00:00
1 parent 7877b766c8
commit a353ba97c9
15 files changed
+2120 -1896

No files matched your search

+1
View File
@@ -286,6 +286,7 @@ By @stuartparmenter in [#9658](https://github.com/gfx-rs/wgpu/pull/9658).
- Fixed loading of `libvulkan.so` on OpenHarmony (`target_env = "ohos"`). By @jschwe in [#9649](https://github.com/gfx-rs/wgpu/pull/9649).
- Fixed `VUID-RuntimeSpirv-vulkanMemoryModel-06265` validation errors by enabling `vulkanMemoryModelDeviceScope` whenever the Vulkan memory model is enabled, since the SPIR-V backend emits storage atomics with `Device` scope. By @francisdb in [#9741](https://github.com/gfx-rs/wgpu/pull/9741).
- Fixed some cases where out-of-memory errors were reported incorrectly. By @andyleiserson in [#9643](https://github.com/gfx-rs/wgpu/pull/9643) and [#9747](https://github.com/gfx-rs/wgpu/pull/9747).
- Fixed signed integer `%` (and `%=`) returning the wrong result for negative operands in the SPIR-V backend, e.g. `-1 % 768` yielding `255` instead of `-1` on NVIDIA. `OpSRem` is poison for negative operands in the Vulkan SPIR-V environment without `VK_KHR_maintenance8`, even though WGSL defines `%` for these operands, so signed remainder is now always lowered as `a - b * (a / b)`. By @mstampfli in [#9674](https://github.com/gfx-rs/wgpu/pull/9674).
#### DX12
+7 -2
View File
@@ -1180,8 +1180,13 @@ impl BlockContext<'_> {
crate::BinaryOperator::Modulo => match left_ty_inner.scalar_kind() {
Some(crate::ScalarKind::Float) => spirv::Op::FRem,
Some(crate::ScalarKind::Sint) => {
assert!(!self.writer.emit_int_div_checks);
spirv::Op::SRem
// Signed `%` is always lowered to `a - b * (a / b)`
// through a wrapper function (see
// `write_wrapped_functions`), because `OpSRem` with a
// negative operand is poison in the Vulkan SPIR-V
// environment without `VK_KHR_maintenance8`. So this raw
// path is never reached for signed modulo.
unreachable!("signed modulo must be lowered via the wrapped path")
}
Some(crate::ScalarKind::Uint) => {
assert!(!self.writer.emit_int_div_checks);
+63 -15
View File
@@ -560,10 +560,22 @@ impl Writer {
// is negative one, or when the divisor is zero. These wrapped
// functions override the divisor to one in these cases,
// matching the WGSL spec.
//
// Signed `%` is additionally always wrapped (even without
// `emit_int_div_checks`) so it can be lowered to
// `a - b * (a / b)`: `OpSRem` produces a poison result for
// negative operands in the Vulkan SPIR-V environment unless
// `VK_KHR_maintenance8` is enabled. See
// <https://github.com/gfx-rs/wgpu/issues/8191>.
(
crate::BinaryOperator::Divide | crate::BinaryOperator::Modulo,
crate::ScalarKind::Sint | crate::ScalarKind::Uint,
) if self.emit_int_div_checks => {
) if self.emit_int_div_checks
|| matches!(
(op, expr_ty.scalar().kind),
(crate::BinaryOperator::Modulo, crate::ScalarKind::Sint)
) =>
{
self.write_wrapped_binary_op(
op,
expr_ty,
@@ -804,21 +816,57 @@ impl Writer {
composite_one_id,
rhs_id,
));
let op = match (op, scalar.kind) {
(crate::BinaryOperator::Divide, crate::ScalarKind::Sint) => spirv::Op::SDiv,
(crate::BinaryOperator::Divide, crate::ScalarKind::Uint) => spirv::Op::UDiv,
(crate::BinaryOperator::Modulo, crate::ScalarKind::Sint) => spirv::Op::SRem,
(crate::BinaryOperator::Modulo, crate::ScalarKind::Uint) => spirv::Op::UMod,
_ => unreachable!(),
let return_id = if matches!(op, crate::BinaryOperator::Modulo)
&& matches!(scalar.kind, crate::ScalarKind::Sint)
{
// `OpSRem` produces a poison result for negative operands in the Vulkan
// environment without the `maintenance8` feature. `OpSDiv` is not poisoned, so
// reconstruct the remainder as `a - b * (a / b)`, which is well-defined for
// negative operands. `divisor_id` is the zero/overflow-guarded divisor selected
// above, so the degenerate cases still match `OpSRem`'s guarded result (0).
let quotient_id = self.id_gen.next();
block.body.push(Instruction::binary(
spirv::Op::SDiv,
return_type_id,
quotient_id,
lhs_id,
divisor_id,
));
let product_id = self.id_gen.next();
block.body.push(Instruction::binary(
spirv::Op::IMul,
return_type_id,
product_id,
quotient_id,
divisor_id,
));
let remainder_id = self.id_gen.next();
block.body.push(Instruction::binary(
spirv::Op::ISub,
return_type_id,
remainder_id,
lhs_id,
product_id,
));
remainder_id
} else {
let spv_op = match (op, scalar.kind) {
(crate::BinaryOperator::Divide, crate::ScalarKind::Sint) => spirv::Op::SDiv,
(crate::BinaryOperator::Divide, crate::ScalarKind::Uint) => spirv::Op::UDiv,
(crate::BinaryOperator::Modulo, crate::ScalarKind::Sint) => spirv::Op::SRem,
(crate::BinaryOperator::Modulo, crate::ScalarKind::Uint) => spirv::Op::UMod,
_ => unreachable!(),
};
let return_id = self.id_gen.next();
block.body.push(Instruction::binary(
spv_op,
return_type_id,
return_id,
lhs_id,
divisor_id,
));
return_id
};
let return_id = self.id_gen.next();
block.body.push(Instruction::binary(
op,
return_type_id,
return_id,
lhs_id,
divisor_id,
));
function.consume(block, Instruction::return_value(return_id));
function.to_words(&mut self.logical_layout.function_definitions);
@@ -0,0 +1 @@
targets = "SPIRV"
@@ -0,0 +1,16 @@
// Regression test for signed `%` lowering in the SPIR-V backend (issue #8191).
// Signed `%` must avoid `OpSRem`, which is poison for negative operands in the
// Vulkan SPIR-V environment without VK_KHR_maintenance8, and instead lower to
// `a - b * (a / b)`. Unsigned `%` (`OpUMod`) is well-defined and unchanged.
@compute @workgroup_size(1)
fn main() {
let a = 5i;
let b = 2i;
let mod_s = a % b;
let mod_s_vec = vec2(a) % vec2(b);
let c = 5u;
let d = 2u;
let mod_u = c % d;
}
File diff suppressed because it is too large. Load diff
+63 -61
View File
@@ -34,15 +34,16 @@ ivec2 naga_mod(ivec2 lhs, ivec2 rhs)
bvec2 _84 = equal(lhs, ivec2(int(0x80000000)));
bvec2 _85 = equal(rhs, ivec2(-1));
bvec2 _86 = bvec2(_84.x && _85.x, _84.y && _85.y);
return lhs - mix(rhs, ivec2(1), bvec2(_79.x || _86.x, _79.y || _86.y)) * (lhs / mix(rhs, ivec2(1), bvec2(_79.x || _86.x, _79.y || _86.y)));
ivec2 _90 = mix(rhs, ivec2(1), bvec2(_79.x || _86.x, _79.y || _86.y));
return lhs - ((lhs / _90) * _90);
}
void main()
{
ivec2 _114 = naga_mod(ivec2(uvec2(imageSize(image_storage_src)) * gl_LocalInvocationID.xy), ivec2(10, 20));
uvec4 _162 = imageLoad(image_storage_src, ivec2(uvec2(_114)));
imageStore(image_dst, _114.x, (((texelFetch(image_mipmapped_src, _114, int(gl_LocalInvocationID.z)) + texelFetch(image_multisampled_src, _114, int(gl_LocalInvocationID.z))) + imageLoad(image_storage_src, _114)) + texelFetch(image_array_src, ivec3(_114, int(gl_LocalInvocationID.z)), int(gl_LocalInvocationID.z) + 1)) + texelFetch(image_array_src, ivec3(_114, int(gl_LocalInvocationID.z)), int(gl_LocalInvocationID.z) + 1));
imageStore(image_dst, int(uint(_114.x)), (((texelFetch(image_mipmapped_src, ivec2(uvec2(_114)), int(gl_LocalInvocationID.z)) + texelFetch(image_multisampled_src, ivec2(uvec2(_114)), int(gl_LocalInvocationID.z))) + _162) + texelFetch(image_array_src, ivec3(uvec3(uvec2(_114), gl_LocalInvocationID.z)), int(gl_LocalInvocationID.z) + 1)) + texelFetch(image_array_src, ivec3(uvec3(uvec2(_114), uint(int(gl_LocalInvocationID.z)))), int(gl_LocalInvocationID.z) + 1));
ivec2 _116 = naga_mod(ivec2(uvec2(imageSize(image_storage_src)) * gl_LocalInvocationID.xy), ivec2(10, 20));
uvec4 _164 = imageLoad(image_storage_src, ivec2(uvec2(_116)));
imageStore(image_dst, _116.x, (((texelFetch(image_mipmapped_src, _116, int(gl_LocalInvocationID.z)) + texelFetch(image_multisampled_src, _116, int(gl_LocalInvocationID.z))) + imageLoad(image_storage_src, _116)) + texelFetch(image_array_src, ivec3(_116, int(gl_LocalInvocationID.z)), int(gl_LocalInvocationID.z) + 1)) + texelFetch(image_array_src, ivec3(_116, int(gl_LocalInvocationID.z)), int(gl_LocalInvocationID.z) + 1));
imageStore(image_dst, int(uint(_116.x)), (((texelFetch(image_mipmapped_src, ivec2(uvec2(_116)), int(gl_LocalInvocationID.z)) + texelFetch(image_multisampled_src, ivec2(uvec2(_116)), int(gl_LocalInvocationID.z))) + _164) + texelFetch(image_array_src, ivec3(uvec3(uvec2(_116), gl_LocalInvocationID.z)), int(gl_LocalInvocationID.z) + 1)) + texelFetch(image_array_src, ivec3(uvec3(uvec2(_116), uint(int(gl_LocalInvocationID.z)))), int(gl_LocalInvocationID.z) + 1));
}
@@ -82,13 +83,14 @@ ivec2 naga_mod(ivec2 lhs, ivec2 rhs)
bvec2 _84 = equal(lhs, ivec2(int(0x80000000)));
bvec2 _85 = equal(rhs, ivec2(-1));
bvec2 _86 = bvec2(_84.x && _85.x, _84.y && _85.y);
return lhs - mix(rhs, ivec2(1), bvec2(_79.x || _86.x, _79.y || _86.y)) * (lhs / mix(rhs, ivec2(1), bvec2(_79.x || _86.x, _79.y || _86.y)));
ivec2 _90 = mix(rhs, ivec2(1), bvec2(_79.x || _86.x, _79.y || _86.y));
return lhs - ((lhs / _90) * _90);
}
void main()
{
ivec2 _206 = naga_mod(ivec2(uvec2(imageSize(image_storage_src)) * gl_LocalInvocationID.xy), ivec2(10, 20));
imageStore(image_dst, _206.x, uvec4(uint(clamp(texelFetch(image_depth_multisampled_src, _206, int(gl_LocalInvocationID.z)).x, 0.0, 4294967040.0))));
ivec2 _208 = naga_mod(ivec2(uvec2(imageSize(image_storage_src)) * gl_LocalInvocationID.xy), ivec2(10, 20));
imageStore(image_dst, _208.x, uvec4(uint(clamp(texelFetch(image_depth_multisampled_src, _208, int(gl_LocalInvocationID.z)).x, 0.0, 4294967040.0))));
}
@@ -123,8 +125,8 @@ layout(set = 1, binding = 4) uniform textureCube image_cube_depth;
void main()
{
uint _230 = uint(textureSize(image_1d, int(0u)));
gl_Position = vec4(float((((((((((_230 + uvec2(textureSize(image_2d, int(0u))).y) + uvec2(textureSize(image_2d, 1)).y) + uvec3(textureSize(image_2d_array, int(0u))).xy.y) + uvec3(textureSize(image_2d_array, 1)).xy.y) + uvec2(textureSize(image_cube, int(0u))).y) + uvec2(textureSize(image_cube, 1)).y) + uvec3(textureSize(image_cube_array, int(0u))).xx.y) + uvec3(textureSize(image_cube_array, 1)).xx.y) + uvec3(textureSize(image_3d, int(0u))).z) + uvec3(textureSize(image_3d, 1)).z));
uint _232 = uint(textureSize(image_1d, int(0u)));
gl_Position = vec4(float((((((((((_232 + uvec2(textureSize(image_2d, int(0u))).y) + uvec2(textureSize(image_2d, 1)).y) + uvec3(textureSize(image_2d_array, int(0u))).xy.y) + uvec3(textureSize(image_2d_array, 1)).xy.y) + uvec2(textureSize(image_cube, int(0u))).y) + uvec2(textureSize(image_cube, 1)).y) + uvec3(textureSize(image_cube_array, int(0u))).xx.y) + uvec3(textureSize(image_cube_array, 1)).xx.y) + uvec3(textureSize(image_3d, int(0u))).z) + uvec3(textureSize(image_3d, 1)).z));
}
@@ -193,7 +195,7 @@ layout(set = 1, binding = 2) uniform texture2D image_2d_depth;
layout(set = 1, binding = 3) uniform texture2DArray image_2d_array_depth;
layout(set = 1, binding = 4) uniform textureCube image_cube_depth;
layout(location = 0) out vec4 _302;
layout(location = 0) out vec4 _304;
spirv_instruction(set = "GLSL.std.450", id = 81) float spvNClamp(float, float, float);
spirv_instruction(set = "GLSL.std.450", id = 81) vec2 spvNClamp(vec2, vec2, vec2);
@@ -209,41 +211,41 @@ void main()
a += textureLod(sampler2D(image_2d, sampler_reg), vec2(0.5), 2.2999999523162841796875);
a += textureLodOffset(sampler2D(image_2d, sampler_reg), vec2(0.5), 2.2999999523162841796875, ivec2(3, 1));
a += textureOffset(sampler2D(image_2d, sampler_reg), vec2(0.5), ivec2(3, 1), 2.0);
vec2 _351 = vec2(0.5) / vec2(uvec2(textureSize(image_2d, int(0u))));
a += textureLod(sampler2D(image_2d, sampler_reg), spvNClamp(vec2(0.5), _351, vec2(1.0) - _351), 0.0);
float _361 = float(0u);
a += texture(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _361));
float _367 = float(0u);
a += textureOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _367), ivec2(3, 1));
float _373 = float(0u);
a += textureLod(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _373), 2.2999999523162841796875);
float _379 = float(0u);
a += textureLodOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _379), 2.2999999523162841796875, ivec2(3, 1));
float _385 = float(0u);
a += textureOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _385), ivec2(3, 1), 2.0);
float _391 = float(0);
a += texture(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _391));
float _397 = float(0);
a += textureOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _397), ivec2(3, 1));
float _403 = float(0);
a += textureLod(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _403), 2.2999999523162841796875);
float _409 = float(0);
a += textureLodOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _409), 2.2999999523162841796875, ivec2(3, 1));
float _415 = float(0);
a += textureOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _415), ivec2(3, 1), 2.0);
float _422 = float(0u);
a += texture(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _422));
float _428 = float(0u);
a += textureLod(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _428), 2.2999999523162841796875);
float _434 = float(0u);
a += texture(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _434), 2.0);
float _440 = float(0);
a += texture(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _440));
float _446 = float(0);
a += textureLod(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _446), 2.2999999523162841796875);
float _452 = float(0);
a += texture(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _452), 2.0);
_302 = a;
vec2 _353 = vec2(0.5) / vec2(uvec2(textureSize(image_2d, int(0u))));
a += textureLod(sampler2D(image_2d, sampler_reg), spvNClamp(vec2(0.5), _353, vec2(1.0) - _353), 0.0);
float _363 = float(0u);
a += texture(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _363));
float _369 = float(0u);
a += textureOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _369), ivec2(3, 1));
float _375 = float(0u);
a += textureLod(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _375), 2.2999999523162841796875);
float _381 = float(0u);
a += textureLodOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _381), 2.2999999523162841796875, ivec2(3, 1));
float _387 = float(0u);
a += textureOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _387), ivec2(3, 1), 2.0);
float _393 = float(0);
a += texture(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _393));
float _399 = float(0);
a += textureOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _399), ivec2(3, 1));
float _405 = float(0);
a += textureLod(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _405), 2.2999999523162841796875);
float _411 = float(0);
a += textureLodOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _411), 2.2999999523162841796875, ivec2(3, 1));
float _417 = float(0);
a += textureOffset(sampler2DArray(image_2d_array, sampler_reg), vec3(vec2(0.5), _417), ivec2(3, 1), 2.0);
float _424 = float(0u);
a += texture(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _424));
float _430 = float(0u);
a += textureLod(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _430), 2.2999999523162841796875);
float _436 = float(0u);
a += texture(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _436), 2.0);
float _442 = float(0);
a += texture(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _442));
float _448 = float(0);
a += textureLod(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _448), 2.2999999523162841796875);
float _454 = float(0);
a += texture(samplerCubeArray(image_cube_array, sampler_reg), vec4(vec3(0.5), _454), 2.0);
_304 = a;
}
@@ -275,24 +277,24 @@ layout(set = 1, binding = 2) uniform texture2D image_2d_depth;
layout(set = 1, binding = 3) uniform texture2DArray image_2d_array_depth;
layout(set = 1, binding = 4) uniform textureCube image_cube_depth;
layout(location = 0) out float _459;
layout(location = 0) out float _461;
void main()
{
float a = 0.0;
a += texture(sampler2DShadow(image_2d_depth, sampler_cmp), vec3(vec2(0.5), 0.5));
float _477 = float(0u);
a += texture(sampler2DArrayShadow(image_2d_array_depth, sampler_cmp), vec4(vec3(vec2(0.5), _477), 0.5));
float _483 = float(0);
a += texture(sampler2DArrayShadow(image_2d_array_depth, sampler_cmp), vec4(vec3(vec2(0.5), _483), 0.5));
float _479 = float(0u);
a += texture(sampler2DArrayShadow(image_2d_array_depth, sampler_cmp), vec4(vec3(vec2(0.5), _479), 0.5));
float _485 = float(0);
a += texture(sampler2DArrayShadow(image_2d_array_depth, sampler_cmp), vec4(vec3(vec2(0.5), _485), 0.5));
a += texture(samplerCubeShadow(image_cube_depth, sampler_cmp), vec4(vec3(0.5), 0.5));
a += textureLod(sampler2DShadow(image_2d_depth, sampler_cmp), vec3(vec2(0.5), 0.5), 0.0);
float _498 = float(0u);
a += textureGrad(sampler2DArrayShadow(image_2d_array_depth, sampler_cmp), vec4(vec3(vec2(0.5), _498), 0.5), vec2(0.0), vec2(0.0));
float _504 = float(0);
a += textureGrad(sampler2DArrayShadow(image_2d_array_depth, sampler_cmp), vec4(vec3(vec2(0.5), _504), 0.5), vec2(0.0), vec2(0.0));
float _500 = float(0u);
a += textureGrad(sampler2DArrayShadow(image_2d_array_depth, sampler_cmp), vec4(vec3(vec2(0.5), _500), 0.5), vec2(0.0), vec2(0.0));
float _506 = float(0);
a += textureGrad(sampler2DArrayShadow(image_2d_array_depth, sampler_cmp), vec4(vec3(vec2(0.5), _506), 0.5), vec2(0.0), vec2(0.0));
a += textureGrad(samplerCubeShadow(image_cube_depth, sampler_cmp), vec4(vec3(0.5), 0.5), vec3(0.0), vec3(0.0));
_459 = a;
_461 = a;
}
@@ -324,11 +326,11 @@ layout(set = 1, binding = 2) uniform texture2D image_2d_depth;
layout(set = 1, binding = 3) uniform texture2DArray image_2d_array_depth;
layout(set = 1, binding = 4) uniform textureCube image_cube_depth;
layout(location = 0) out vec4 _515;
layout(location = 0) out vec4 _517;
void main()
{
_515 = (((textureGather(sampler2D(image_2d, sampler_reg), vec2(0.5), int(1u)) + textureGatherOffset(sampler2D(image_2d, sampler_reg), vec2(0.5), ivec2(3, 1), int(3u))) + textureGather(sampler2DShadow(image_2d_depth, sampler_cmp), vec2(0.5), 0.5)) + textureGatherOffset(sampler2DShadow(image_2d_depth, sampler_cmp), vec2(0.5), 0.5, ivec2(3, 1))) + (vec4(textureGather(usampler2D(image_2d_u32, sampler_reg), vec2(0.5))) + vec4(textureGather(isampler2D(image_2d_i32, sampler_reg), vec2(0.5))));
_517 = (((textureGather(sampler2D(image_2d, sampler_reg), vec2(0.5), int(1u)) + textureGatherOffset(sampler2D(image_2d, sampler_reg), vec2(0.5), ivec2(3, 1), int(3u))) + textureGather(sampler2DShadow(image_2d_depth, sampler_cmp), vec2(0.5), 0.5)) + textureGatherOffset(sampler2DShadow(image_2d_depth, sampler_cmp), vec2(0.5), 0.5, ivec2(3, 1))) + (vec4(textureGather(usampler2D(image_2d_u32, sampler_reg), vec2(0.5))) + vec4(textureGather(isampler2D(image_2d_i32, sampler_reg), vec2(0.5))));
}
@@ -360,11 +362,11 @@ layout(set = 1, binding = 2) uniform texture2D image_2d_depth;
layout(set = 1, binding = 3) uniform texture2DArray image_2d_array_depth;
layout(set = 1, binding = 4) uniform textureCube image_cube_depth;
layout(location = 0) out vec4 _549;
layout(location = 0) out vec4 _551;
void main()
{
float _561 = float(1);
_549 = (vec4(texture(sampler2DShadow(image_2d_depth, sampler_reg), vec2(0.5)).x) + textureGather(sampler2DShadow(image_2d_depth, sampler_reg), vec2(0.5))) + vec4(textureLod(sampler2DShadow(image_2d_depth, sampler_reg), vec2(0.5), _561).x);
float _563 = float(1);
_551 = (vec4(texture(sampler2DShadow(image_2d_depth, sampler_reg), vec2(0.5)).x) + textureGather(sampler2DShadow(image_2d_depth, sampler_reg), vec2(0.5))) + vec4(textureLod(sampler2DShadow(image_2d_depth, sampler_reg), vec2(0.5), _563).x);
}
@@ -1,27 +1,48 @@
; SPIR-V
; Version: 1.1
; Generator: rspirv
; Bound: 17
; Bound: 36
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %4 "main"
OpExecutionMode %4 LocalSize 1 1 1
OpEntryPoint GLCompute %24 "main"
OpExecutionMode %24 LocalSize 1 1 1
%2 = OpTypeVoid
%5 = OpTypeFunction %2
%6 = OpTypeInt 32 1
%7 = OpConstant %6 5
%8 = OpConstant %6 2
%9 = OpTypeInt 32 0
%10 = OpConstant %9 5
%11 = OpConstant %9 2
%4 = OpFunction %2 None %5
%3 = OpLabel
OpBranch %12
%12 = OpLabel
%13 = OpSDiv %6 %7 %8
%14 = OpSRem %6 %7 %8
%15 = OpUDiv %9 %10 %11
%16 = OpUMod %9 %10 %11
%3 = OpTypeInt 32 1
%5 = OpTypeFunction %3 %3 %3
%9 = OpTypeBool
%10 = OpConstant %3 0
%12 = OpConstant %3 -2147483648
%13 = OpConstant %3 -1
%18 = OpConstant %3 1
%25 = OpTypeFunction %2
%26 = OpConstant %3 5
%27 = OpConstant %3 2
%28 = OpTypeInt 32 0
%29 = OpConstant %28 5
%30 = OpConstant %28 2
%4 = OpFunction %3 None %5
%6 = OpFunctionParameter %3
%7 = OpFunctionParameter %3
%8 = OpLabel
%11 = OpIEqual %9 %7 %10
%14 = OpIEqual %9 %6 %12
%15 = OpIEqual %9 %7 %13
%16 = OpLogicalAnd %9 %14 %15
%17 = OpLogicalOr %9 %11 %16
%19 = OpSelect %3 %17 %18 %7
%20 = OpSDiv %3 %6 %19
%21 = OpIMul %3 %20 %19
%22 = OpISub %3 %6 %21
OpReturnValue %22
OpFunctionEnd
%24 = OpFunction %2 None %25
%23 = OpLabel
OpBranch %31
%31 = OpLabel
%32 = OpSDiv %3 %26 %27
%33 = OpFunctionCall %3 %4 %26 %27
%34 = OpUDiv %28 %29 %30
%35 = OpUMod %28 %29 %30
OpReturn
OpFunctionEnd
@@ -1,11 +1,16 @@
#version 460
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main()
int _4(int _6, int _7)
{
int _13 = 5 / 2;
int _14 = 5 - 2 * (5 / 2);
uint _15 = 5u / 2u;
uint _16 = 5u % 2u;
int _19 = ((_7 == 0) || ((_6 == int(0x80000000)) && (_7 == (-1)))) ? 1 : _7;
return _6 - ((_6 / _19) * _19);
}
void main()
{
int _32 = 5 / 2;
uint _34 = 5u / 2u;
uint _35 = 5u % 2u;
}
@@ -0,0 +1,83 @@
; SPIR-V
; Version: 1.1
; Generator: rspirv
; Bound: 67
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %55 "main"
OpExecutionMode %55 LocalSize 1 1 1
%2 = OpTypeVoid
%3 = OpTypeInt 32 1
%5 = OpTypeFunction %3 %3 %3
%9 = OpTypeBool
%10 = OpConstant %3 0
%12 = OpConstant %3 -2147483648
%13 = OpConstant %3 -1
%18 = OpConstant %3 1
%23 = OpTypeVector %3 2
%25 = OpTypeFunction %23 %23 %23
%29 = OpTypeVector %9 2
%30 = OpConstantComposite %23 %10 %10
%32 = OpConstantComposite %23 %12 %12
%33 = OpConstantComposite %23 %13 %13
%38 = OpConstantComposite %23 %18 %18
%43 = OpTypeInt 32 0
%45 = OpTypeFunction %43 %43 %43
%49 = OpConstant %43 0
%51 = OpConstant %43 1
%56 = OpTypeFunction %2
%57 = OpConstant %3 5
%58 = OpConstant %3 2
%59 = OpConstantComposite %23 %57 %57
%60 = OpConstantComposite %23 %58 %58
%61 = OpConstant %43 5
%62 = OpConstant %43 2
%4 = OpFunction %3 None %5
%6 = OpFunctionParameter %3
%7 = OpFunctionParameter %3
%8 = OpLabel
%11 = OpIEqual %9 %7 %10
%14 = OpIEqual %9 %6 %12
%15 = OpIEqual %9 %7 %13
%16 = OpLogicalAnd %9 %14 %15
%17 = OpLogicalOr %9 %11 %16
%19 = OpSelect %3 %17 %18 %7
%20 = OpSDiv %3 %6 %19
%21 = OpIMul %3 %20 %19
%22 = OpISub %3 %6 %21
OpReturnValue %22
OpFunctionEnd
%24 = OpFunction %23 None %25
%26 = OpFunctionParameter %23
%27 = OpFunctionParameter %23
%28 = OpLabel
%31 = OpIEqual %29 %27 %30
%34 = OpIEqual %29 %26 %32
%35 = OpIEqual %29 %27 %33
%36 = OpLogicalAnd %29 %34 %35
%37 = OpLogicalOr %29 %31 %36
%39 = OpSelect %23 %37 %38 %27
%40 = OpSDiv %23 %26 %39
%41 = OpIMul %23 %40 %39
%42 = OpISub %23 %26 %41
OpReturnValue %42
OpFunctionEnd
%44 = OpFunction %43 None %45
%46 = OpFunctionParameter %43
%47 = OpFunctionParameter %43
%48 = OpLabel
%50 = OpIEqual %9 %47 %49
%52 = OpSelect %43 %50 %51 %47
%53 = OpUMod %43 %46 %52
OpReturnValue %53
OpFunctionEnd
%55 = OpFunction %2 None %56
%54 = OpLabel
OpBranch %63
%63 = OpLabel
%64 = OpFunctionCall %3 %4 %57 %58
%65 = OpFunctionCall %23 %24 %59 %60
%66 = OpFunctionCall %43 %44 %61 %62
OpReturn
OpFunctionEnd
@@ -0,0 +1,28 @@
#version 460
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
int _4(int _6, int _7)
{
int _19 = ((_7 == 0) || ((_6 == int(0x80000000)) && (_7 == (-1)))) ? 1 : _7;
return _6 - ((_6 / _19) * _19);
}
ivec2 _24(ivec2 _26, ivec2 _27)
{
bvec2 _31 = equal(_27, ivec2(0));
bvec2 _34 = equal(_26, ivec2(int(0x80000000)));
bvec2 _35 = equal(_27, ivec2(-1));
bvec2 _36 = bvec2(_34.x && _35.x, _34.y && _35.y);
ivec2 _39 = mix(_27, ivec2(1), bvec2(_31.x || _36.x, _31.y || _36.y));
return _26 - ((_26 / _39) * _39);
}
uint _44(uint _46, uint _47)
{
return _46 % ((_47 == 0u) ? 1u : _47);
}
void main()
{
}
+445 -443
View File
@@ -1,7 +1,7 @@
; SPIR-V
; Version: 1.3
; Generator: rspirv
; Bound: 431
; Bound: 433
OpCapability Shader
OpCapability Int16
OpCapability StorageBuffer16BitAccess
@@ -14,8 +14,8 @@ OpCapability GroupNonUniformShuffle
OpExtension "SPV_KHR_16bit_storage"
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint GLCompute %375 "main" %372 %390
OpExecutionMode %375 LocalSize 64 1 1
OpEntryPoint GLCompute %377 "main" %374 %392
OpExecutionMode %377 LocalSize 64 1 1
OpMemberDecorate %14 0 Offset 0
OpMemberDecorate %14 1 Offset 4
OpMemberDecorate %14 2 Offset 8
@@ -55,8 +55,8 @@ OpDecorate %38 DescriptorSet 0
OpDecorate %38 Binding 4
OpDecorate %39 Block
OpMemberDecorate %39 0 Offset 0
OpDecorate %372 BuiltIn SubgroupLocalInvocationId
OpDecorate %390 BuiltIn LocalInvocationIndex
OpDecorate %374 BuiltIn SubgroupLocalInvocationId
OpDecorate %392 BuiltIn LocalInvocationIndex
%2 = OpTypeVoid
%3 = OpTypeInt 16 1
%4 = OpTypeInt 16 0
@@ -103,75 +103,75 @@ OpDecorate %390 BuiltIn LocalInvocationIndex
%49 = OpConstant %3 0
%51 = OpConstant %3 -32768
%52 = OpConstant %3 -1
%73 = OpTypeFunction %3 %3
%74 = OpTypePointer Uniform %14
%75 = OpConstant %5 0
%77 = OpTypePointer StorageBuffer %14
%79 = OpTypePointer StorageBuffer %18
%83 = OpConstant %3 20
%84 = OpConstant %3 5
%85 = OpConstant %3 2
%86 = OpConstant %3 3
%87 = OpConstant %3 4
%88 = OpConstant %3 255
%89 = OpConstant %3 16
%90 = OpConstant %5 1
%91 = OpConstantComposite %19 %21 %85 %86 %87
%92 = OpConstant %4 1
%93 = OpConstantComposite %11 %85 %85
%95 = OpTypePointer Function %3
%97 = OpTypePointer Function %19
%103 = OpTypePointer Uniform %5
%109 = OpTypePointer Uniform %6
%115 = OpTypePointer Uniform %3
%116 = OpConstant %5 7
%122 = OpTypePointer StorageBuffer %3
%129 = OpTypePointer StorageBuffer %11
%130 = OpTypePointer Uniform %11
%131 = OpConstant %5 8
%138 = OpTypePointer StorageBuffer %12
%139 = OpTypePointer Uniform %12
%140 = OpConstant %5 9
%147 = OpTypePointer StorageBuffer %13
%148 = OpTypePointer Uniform %13
%149 = OpConstant %5 10
%156 = OpTypePointer StorageBuffer %17
%214 = OpTypePointer StorageBuffer %5
%218 = OpTypePointer StorageBuffer %6
%222 = OpTypePointer StorageBuffer %7
%241 = OpTypeFunction %4 %4 %4
%245 = OpConstant %4 0
%259 = OpTypeFunction %4 %4
%265 = OpConstant %4 5
%266 = OpConstant %4 2
%267 = OpConstant %4 3
%268 = OpConstant %4 4
%269 = OpConstant %4 255
%270 = OpConstant %4 16
%272 = OpTypePointer Function %4
%287 = OpTypePointer Uniform %4
%288 = OpConstant %5 3
%294 = OpTypePointer StorageBuffer %4
%301 = OpTypePointer StorageBuffer %8
%302 = OpTypePointer Uniform %8
%309 = OpTypePointer StorageBuffer %9
%310 = OpTypePointer Uniform %9
%311 = OpConstant %5 5
%318 = OpTypePointer StorageBuffer %10
%319 = OpTypePointer Uniform %10
%320 = OpConstant %5 6
%327 = OpTypePointer StorageBuffer %15
%373 = OpTypePointer Input %5
%372 = OpVariable %373 Input
%376 = OpTypeFunction %2
%382 = OpConstant %4 67
%383 = OpConstant %3 60
%385 = OpConstantNull %3
%387 = OpConstantNull %4
%75 = OpTypeFunction %3 %3
%76 = OpTypePointer Uniform %14
%77 = OpConstant %5 0
%79 = OpTypePointer StorageBuffer %14
%81 = OpTypePointer StorageBuffer %18
%85 = OpConstant %3 20
%86 = OpConstant %3 5
%87 = OpConstant %3 2
%88 = OpConstant %3 3
%89 = OpConstant %3 4
%90 = OpConstant %3 255
%91 = OpConstant %3 16
%92 = OpConstant %5 1
%93 = OpConstantComposite %19 %21 %87 %88 %89
%94 = OpConstant %4 1
%95 = OpConstantComposite %11 %87 %87
%97 = OpTypePointer Function %3
%99 = OpTypePointer Function %19
%105 = OpTypePointer Uniform %5
%111 = OpTypePointer Uniform %6
%117 = OpTypePointer Uniform %3
%118 = OpConstant %5 7
%124 = OpTypePointer StorageBuffer %3
%131 = OpTypePointer StorageBuffer %11
%132 = OpTypePointer Uniform %11
%133 = OpConstant %5 8
%140 = OpTypePointer StorageBuffer %12
%141 = OpTypePointer Uniform %12
%142 = OpConstant %5 9
%149 = OpTypePointer StorageBuffer %13
%150 = OpTypePointer Uniform %13
%151 = OpConstant %5 10
%158 = OpTypePointer StorageBuffer %17
%216 = OpTypePointer StorageBuffer %5
%220 = OpTypePointer StorageBuffer %6
%224 = OpTypePointer StorageBuffer %7
%243 = OpTypeFunction %4 %4 %4
%247 = OpConstant %4 0
%261 = OpTypeFunction %4 %4
%267 = OpConstant %4 5
%268 = OpConstant %4 2
%269 = OpConstant %4 3
%270 = OpConstant %4 4
%271 = OpConstant %4 255
%272 = OpConstant %4 16
%274 = OpTypePointer Function %4
%289 = OpTypePointer Uniform %4
%290 = OpConstant %5 3
%296 = OpTypePointer StorageBuffer %4
%303 = OpTypePointer StorageBuffer %8
%304 = OpTypePointer Uniform %8
%311 = OpTypePointer StorageBuffer %9
%312 = OpTypePointer Uniform %9
%313 = OpConstant %5 5
%320 = OpTypePointer StorageBuffer %10
%321 = OpTypePointer Uniform %10
%322 = OpConstant %5 6
%329 = OpTypePointer StorageBuffer %15
%375 = OpTypePointer Input %5
%374 = OpVariable %375 Input
%378 = OpTypeFunction %2
%384 = OpConstant %4 67
%385 = OpConstant %3 60
%387 = OpConstantNull %3
%389 = OpConstantNull %4
%390 = OpVariable %373 Input
%395 = OpConstant %5 264
%401 = OpConstant %5 11
%391 = OpConstantNull %4
%392 = OpVariable %375 Input
%397 = OpConstant %5 264
%403 = OpConstant %5 11
%43 = OpFunction %3 None %44
%45 = OpFunctionParameter %3
%46 = OpFunctionParameter %3
@@ -195,392 +195,394 @@ OpFunctionEnd
%66 = OpLogicalAnd %48 %64 %65
%67 = OpLogicalOr %48 %63 %66
%68 = OpSelect %3 %67 %21 %61
%69 = OpSRem %3 %60 %68
OpReturnValue %69
%69 = OpSDiv %3 %60 %68
%70 = OpIMul %3 %69 %68
%71 = OpISub %3 %60 %70
OpReturnValue %71
OpFunctionEnd
%72 = OpFunction %3 None %73
%71 = OpFunctionParameter %3
%70 = OpLabel
%94 = OpVariable %95 Function %83
%96 = OpVariable %97 Function %91
%76 = OpAccessChain %74 %26 %75
%78 = OpAccessChain %77 %29 %75
%80 = OpAccessChain %79 %32 %75
%81 = OpAccessChain %77 %35 %75
%82 = OpAccessChain %79 %38 %75
OpBranch %98
%98 = OpLabel
%99 = OpLoad %3 %24
%100 = OpLoad %3 %94
%101 = OpIAdd %3 %100 %84
OpStore %94 %101
%102 = OpLoad %3 %94
%104 = OpAccessChain %103 %76 %75
%105 = OpLoad %5 %104
%106 = OpSConvert %3 %105
%107 = OpIAdd %3 %102 %106
OpStore %94 %107
%108 = OpLoad %3 %94
%110 = OpAccessChain %109 %76 %90
%111 = OpLoad %6 %110
%112 = OpSConvert %3 %111
%113 = OpIAdd %3 %108 %112
OpStore %94 %113
%114 = OpLoad %3 %94
%117 = OpAccessChain %115 %76 %116
%118 = OpLoad %3 %117
%119 = OpCompositeConstruct %12 %118 %118 %118
%120 = OpCompositeExtract %3 %119 2
%121 = OpIAdd %3 %114 %120
OpStore %94 %121
%123 = OpAccessChain %115 %76 %116
%124 = OpLoad %3 %123
%125 = OpAccessChain %122 %78 %116
%74 = OpFunction %3 None %75
%73 = OpFunctionParameter %3
%72 = OpLabel
%96 = OpVariable %97 Function %85
%98 = OpVariable %99 Function %93
%78 = OpAccessChain %76 %26 %77
%80 = OpAccessChain %79 %29 %77
%82 = OpAccessChain %81 %32 %77
%83 = OpAccessChain %79 %35 %77
%84 = OpAccessChain %81 %38 %77
OpBranch %100
%100 = OpLabel
%101 = OpLoad %3 %24
%102 = OpLoad %3 %96
%103 = OpIAdd %3 %102 %86
OpStore %96 %103
%104 = OpLoad %3 %96
%106 = OpAccessChain %105 %78 %77
%107 = OpLoad %5 %106
%108 = OpSConvert %3 %107
%109 = OpIAdd %3 %104 %108
OpStore %96 %109
%110 = OpLoad %3 %96
%112 = OpAccessChain %111 %78 %92
%113 = OpLoad %6 %112
%114 = OpSConvert %3 %113
%115 = OpIAdd %3 %110 %114
OpStore %96 %115
%116 = OpLoad %3 %96
%119 = OpAccessChain %117 %78 %118
%120 = OpLoad %3 %119
%121 = OpCompositeConstruct %12 %120 %120 %120
%122 = OpCompositeExtract %3 %121 2
%123 = OpIAdd %3 %116 %122
OpStore %96 %123
%125 = OpAccessChain %117 %78 %118
%126 = OpLoad %3 %125
%127 = OpIAdd %3 %124 %126
%128 = OpAccessChain %122 %81 %116
OpStore %128 %127
%132 = OpAccessChain %130 %76 %131
%133 = OpLoad %11 %132
%134 = OpAccessChain %129 %78 %131
%127 = OpAccessChain %124 %80 %118
%128 = OpLoad %3 %127
%129 = OpIAdd %3 %126 %128
%130 = OpAccessChain %124 %83 %118
OpStore %130 %129
%134 = OpAccessChain %132 %78 %133
%135 = OpLoad %11 %134
%136 = OpIAdd %11 %133 %135
%137 = OpAccessChain %129 %81 %131
OpStore %137 %136
%141 = OpAccessChain %139 %76 %140
%142 = OpLoad %12 %141
%143 = OpAccessChain %138 %78 %140
%136 = OpAccessChain %131 %80 %133
%137 = OpLoad %11 %136
%138 = OpIAdd %11 %135 %137
%139 = OpAccessChain %131 %83 %133
OpStore %139 %138
%143 = OpAccessChain %141 %78 %142
%144 = OpLoad %12 %143
%145 = OpIAdd %12 %142 %144
%146 = OpAccessChain %138 %81 %140
OpStore %146 %145
%150 = OpAccessChain %148 %76 %149
%151 = OpLoad %13 %150
%152 = OpAccessChain %147 %78 %149
%145 = OpAccessChain %140 %80 %142
%146 = OpLoad %12 %145
%147 = OpIAdd %12 %144 %146
%148 = OpAccessChain %140 %83 %142
OpStore %148 %147
%152 = OpAccessChain %150 %78 %151
%153 = OpLoad %13 %152
%154 = OpIAdd %13 %151 %153
%155 = OpAccessChain %147 %81 %149
OpStore %155 %154
%157 = OpAccessChain %156 %80 %90
%158 = OpLoad %17 %157
%159 = OpAccessChain %156 %82 %90
OpStore %159 %158
%160 = OpLoad %3 %94
%161 = OpExtInst %3 %1 SAbs %160
OpStore %94 %161
%162 = OpLoad %3 %94
%163 = OpLoad %3 %94
%164 = OpExtInst %3 %1 SMax %162 %163
OpStore %94 %164
%165 = OpLoad %3 %94
%166 = OpLoad %3 %94
%167 = OpExtInst %3 %1 SMin %165 %166
OpStore %94 %167
%168 = OpLoad %3 %94
%169 = OpLoad %3 %94
%170 = OpLoad %3 %94
%172 = OpExtInst %3 %1 SMax %168 %169
%171 = OpExtInst %3 %1 SMin %172 %170
OpStore %94 %171
%173 = OpLoad %3 %94
%174 = OpExtInst %3 %1 SSign %173
OpStore %94 %174
%175 = OpLoad %3 %94
%176 = OpISub %3 %175 %21
OpStore %94 %176
%177 = OpLoad %3 %94
%178 = OpIMul %3 %177 %85
OpStore %94 %178
%179 = OpLoad %3 %94
%180 = OpFunctionCall %3 %43 %179 %86
OpStore %94 %180
%181 = OpLoad %3 %94
%182 = OpFunctionCall %3 %59 %181 %87
OpStore %94 %182
%183 = OpLoad %3 %94
%184 = OpBitwiseAnd %3 %183 %88
OpStore %94 %184
%185 = OpLoad %3 %94
%186 = OpBitwiseOr %3 %185 %89
OpStore %94 %186
%187 = OpLoad %3 %94
%188 = OpBitwiseXor %3 %187 %21
OpStore %94 %188
%189 = OpLoad %3 %94
%190 = OpShiftLeftLogical %3 %189 %16
OpStore %94 %190
%191 = OpLoad %3 %94
%192 = OpShiftRightArithmetic %3 %191 %90
OpStore %94 %192
%193 = OpLoad %3 %94
%194 = OpSNegate %3 %193
OpStore %94 %194
%195 = OpLoad %3 %94
%196 = OpSLessThan %48 %195 %49
%197 = OpLoad %3 %94
%198 = OpSLessThanEqual %48 %197 %49
%199 = OpLoad %3 %94
%200 = OpSGreaterThan %48 %199 %49
%201 = OpLoad %3 %94
%202 = OpSGreaterThanEqual %48 %201 %49
%203 = OpLoad %3 %94
%204 = OpIEqual %48 %203 %49
%205 = OpLoad %3 %94
%206 = OpINotEqual %48 %205 %49
%207 = OpSelect %3 %196 %85 %21
OpStore %94 %207
%208 = OpLoad %3 %94
%209 = OpAccessChain %95 %96 %75
OpStore %209 %208
%210 = OpAccessChain %95 %96 %90
%211 = OpLoad %3 %210
OpStore %94 %211
%212 = OpAccessChain %95 %96 %90
%154 = OpAccessChain %149 %80 %151
%155 = OpLoad %13 %154
%156 = OpIAdd %13 %153 %155
%157 = OpAccessChain %149 %83 %151
OpStore %157 %156
%159 = OpAccessChain %158 %82 %92
%160 = OpLoad %17 %159
%161 = OpAccessChain %158 %84 %92
OpStore %161 %160
%162 = OpLoad %3 %96
%163 = OpExtInst %3 %1 SAbs %162
OpStore %96 %163
%164 = OpLoad %3 %96
%165 = OpLoad %3 %96
%166 = OpExtInst %3 %1 SMax %164 %165
OpStore %96 %166
%167 = OpLoad %3 %96
%168 = OpLoad %3 %96
%169 = OpExtInst %3 %1 SMin %167 %168
OpStore %96 %169
%170 = OpLoad %3 %96
%171 = OpLoad %3 %96
%172 = OpLoad %3 %96
%174 = OpExtInst %3 %1 SMax %170 %171
%173 = OpExtInst %3 %1 SMin %174 %172
OpStore %96 %173
%175 = OpLoad %3 %96
%176 = OpExtInst %3 %1 SSign %175
OpStore %96 %176
%177 = OpLoad %3 %96
%178 = OpISub %3 %177 %21
OpStore %96 %178
%179 = OpLoad %3 %96
%180 = OpIMul %3 %179 %87
OpStore %96 %180
%181 = OpLoad %3 %96
%182 = OpFunctionCall %3 %43 %181 %88
OpStore %96 %182
%183 = OpLoad %3 %96
%184 = OpFunctionCall %3 %59 %183 %89
OpStore %96 %184
%185 = OpLoad %3 %96
%186 = OpBitwiseAnd %3 %185 %90
OpStore %96 %186
%187 = OpLoad %3 %96
%188 = OpBitwiseOr %3 %187 %91
OpStore %96 %188
%189 = OpLoad %3 %96
%190 = OpBitwiseXor %3 %189 %21
OpStore %96 %190
%191 = OpLoad %3 %96
%192 = OpShiftLeftLogical %3 %191 %16
OpStore %96 %192
%193 = OpLoad %3 %96
%194 = OpShiftRightArithmetic %3 %193 %92
OpStore %96 %194
%195 = OpLoad %3 %96
%196 = OpSNegate %3 %195
OpStore %96 %196
%197 = OpLoad %3 %96
%198 = OpSLessThan %48 %197 %49
%199 = OpLoad %3 %96
%200 = OpSLessThanEqual %48 %199 %49
%201 = OpLoad %3 %96
%202 = OpSGreaterThan %48 %201 %49
%203 = OpLoad %3 %96
%204 = OpSGreaterThanEqual %48 %203 %49
%205 = OpLoad %3 %96
%206 = OpIEqual %48 %205 %49
%207 = OpLoad %3 %96
%208 = OpINotEqual %48 %207 %49
%209 = OpSelect %3 %198 %87 %21
OpStore %96 %209
%210 = OpLoad %3 %96
%211 = OpAccessChain %97 %98 %77
OpStore %211 %210
%212 = OpAccessChain %97 %98 %92
%213 = OpLoad %3 %212
OpStore %94 %213
%215 = OpLoad %3 %94
%216 = OpUConvert %5 %215
%217 = OpAccessChain %214 %81 %75
OpStore %217 %216
%219 = OpLoad %3 %94
%220 = OpSConvert %6 %219
%221 = OpAccessChain %218 %81 %90
OpStore %221 %220
%223 = OpLoad %3 %94
%224 = OpConvertSToF %7 %223
%225 = OpAccessChain %222 %81 %16
OpStore %225 %224
%226 = OpAccessChain %214 %81 %75
%227 = OpLoad %5 %226
%228 = OpSConvert %3 %227
OpStore %94 %228
%229 = OpLoad %3 %94
%230 = OpBitcast %4 %229
%231 = OpBitcast %3 %230
OpStore %94 %231
%232 = OpAccessChain %130 %76 %131
%233 = OpLoad %11 %232
%234 = OpAccessChain %130 %76 %131
OpStore %96 %213
%214 = OpAccessChain %97 %98 %92
%215 = OpLoad %3 %214
OpStore %96 %215
%217 = OpLoad %3 %96
%218 = OpUConvert %5 %217
%219 = OpAccessChain %216 %83 %77
OpStore %219 %218
%221 = OpLoad %3 %96
%222 = OpSConvert %6 %221
%223 = OpAccessChain %220 %83 %92
OpStore %223 %222
%225 = OpLoad %3 %96
%226 = OpConvertSToF %7 %225
%227 = OpAccessChain %224 %83 %16
OpStore %227 %226
%228 = OpAccessChain %216 %83 %77
%229 = OpLoad %5 %228
%230 = OpSConvert %3 %229
OpStore %96 %230
%231 = OpLoad %3 %96
%232 = OpBitcast %4 %231
%233 = OpBitcast %3 %232
OpStore %96 %233
%234 = OpAccessChain %132 %78 %133
%235 = OpLoad %11 %234
%236 = OpIAdd %11 %233 %235
%237 = OpIMul %11 %236 %93
%238 = OpAccessChain %129 %81 %131
OpStore %238 %237
%239 = OpLoad %3 %94
OpReturnValue %239
%236 = OpAccessChain %132 %78 %133
%237 = OpLoad %11 %236
%238 = OpIAdd %11 %235 %237
%239 = OpIMul %11 %238 %95
%240 = OpAccessChain %131 %83 %133
OpStore %240 %239
%241 = OpLoad %3 %96
OpReturnValue %241
OpFunctionEnd
%240 = OpFunction %4 None %241
%242 = OpFunctionParameter %4
%243 = OpFunctionParameter %4
%244 = OpLabel
%246 = OpIEqual %48 %243 %245
%247 = OpSelect %4 %246 %92 %243
%248 = OpUDiv %4 %242 %247
OpReturnValue %248
%242 = OpFunction %4 None %243
%244 = OpFunctionParameter %4
%245 = OpFunctionParameter %4
%246 = OpLabel
%248 = OpIEqual %48 %245 %247
%249 = OpSelect %4 %248 %94 %245
%250 = OpUDiv %4 %244 %249
OpReturnValue %250
OpFunctionEnd
%249 = OpFunction %4 None %241
%250 = OpFunctionParameter %4
%251 = OpFunctionParameter %4
%252 = OpLabel
%253 = OpIEqual %48 %251 %245
%254 = OpSelect %4 %253 %92 %251
%255 = OpUMod %4 %250 %254
OpReturnValue %255
%251 = OpFunction %4 None %243
%252 = OpFunctionParameter %4
%253 = OpFunctionParameter %4
%254 = OpLabel
%255 = OpIEqual %48 %253 %247
%256 = OpSelect %4 %255 %94 %253
%257 = OpUMod %4 %252 %256
OpReturnValue %257
OpFunctionEnd
%258 = OpFunction %4 None %259
%257 = OpFunctionParameter %4
%256 = OpLabel
%271 = OpVariable %272 Function %22
%260 = OpAccessChain %74 %26 %75
%261 = OpAccessChain %77 %29 %75
%262 = OpAccessChain %79 %32 %75
%263 = OpAccessChain %77 %35 %75
%264 = OpAccessChain %79 %38 %75
OpBranch %273
%273 = OpLabel
%274 = OpLoad %4 %271
%275 = OpIAdd %4 %274 %265
OpStore %271 %275
%276 = OpLoad %4 %271
%277 = OpAccessChain %103 %260 %75
%278 = OpLoad %5 %277
%279 = OpUConvert %4 %278
%280 = OpIAdd %4 %276 %279
OpStore %271 %280
%281 = OpLoad %4 %271
%282 = OpAccessChain %109 %260 %90
%283 = OpLoad %6 %282
%284 = OpUConvert %4 %283
%285 = OpIAdd %4 %281 %284
OpStore %271 %285
%286 = OpLoad %4 %271
%289 = OpAccessChain %287 %260 %288
%290 = OpLoad %4 %289
%291 = OpCompositeConstruct %9 %290 %290 %290
%292 = OpCompositeExtract %4 %291 2
%293 = OpIAdd %4 %286 %292
OpStore %271 %293
%295 = OpAccessChain %287 %260 %288
%296 = OpLoad %4 %295
%297 = OpAccessChain %294 %261 %288
%260 = OpFunction %4 None %261
%259 = OpFunctionParameter %4
%258 = OpLabel
%273 = OpVariable %274 Function %22
%262 = OpAccessChain %76 %26 %77
%263 = OpAccessChain %79 %29 %77
%264 = OpAccessChain %81 %32 %77
%265 = OpAccessChain %79 %35 %77
%266 = OpAccessChain %81 %38 %77
OpBranch %275
%275 = OpLabel
%276 = OpLoad %4 %273
%277 = OpIAdd %4 %276 %267
OpStore %273 %277
%278 = OpLoad %4 %273
%279 = OpAccessChain %105 %262 %77
%280 = OpLoad %5 %279
%281 = OpUConvert %4 %280
%282 = OpIAdd %4 %278 %281
OpStore %273 %282
%283 = OpLoad %4 %273
%284 = OpAccessChain %111 %262 %92
%285 = OpLoad %6 %284
%286 = OpUConvert %4 %285
%287 = OpIAdd %4 %283 %286
OpStore %273 %287
%288 = OpLoad %4 %273
%291 = OpAccessChain %289 %262 %290
%292 = OpLoad %4 %291
%293 = OpCompositeConstruct %9 %292 %292 %292
%294 = OpCompositeExtract %4 %293 2
%295 = OpIAdd %4 %288 %294
OpStore %273 %295
%297 = OpAccessChain %289 %262 %290
%298 = OpLoad %4 %297
%299 = OpIAdd %4 %296 %298
%300 = OpAccessChain %294 %263 %288
OpStore %300 %299
%303 = OpAccessChain %302 %260 %20
%304 = OpLoad %8 %303
%305 = OpAccessChain %301 %261 %20
%299 = OpAccessChain %296 %263 %290
%300 = OpLoad %4 %299
%301 = OpIAdd %4 %298 %300
%302 = OpAccessChain %296 %265 %290
OpStore %302 %301
%305 = OpAccessChain %304 %262 %20
%306 = OpLoad %8 %305
%307 = OpIAdd %8 %304 %306
%308 = OpAccessChain %301 %263 %20
OpStore %308 %307
%312 = OpAccessChain %310 %260 %311
%313 = OpLoad %9 %312
%314 = OpAccessChain %309 %261 %311
%307 = OpAccessChain %303 %263 %20
%308 = OpLoad %8 %307
%309 = OpIAdd %8 %306 %308
%310 = OpAccessChain %303 %265 %20
OpStore %310 %309
%314 = OpAccessChain %312 %262 %313
%315 = OpLoad %9 %314
%316 = OpIAdd %9 %313 %315
%317 = OpAccessChain %309 %263 %311
OpStore %317 %316
%321 = OpAccessChain %319 %260 %320
%322 = OpLoad %10 %321
%323 = OpAccessChain %318 %261 %320
%316 = OpAccessChain %311 %263 %313
%317 = OpLoad %9 %316
%318 = OpIAdd %9 %315 %317
%319 = OpAccessChain %311 %265 %313
OpStore %319 %318
%323 = OpAccessChain %321 %262 %322
%324 = OpLoad %10 %323
%325 = OpIAdd %10 %322 %324
%326 = OpAccessChain %318 %263 %320
OpStore %326 %325
%328 = OpAccessChain %327 %262 %75
%329 = OpLoad %15 %328
%330 = OpAccessChain %327 %264 %75
OpStore %330 %329
%331 = OpLoad %4 %271
%332 = OpCopyObject %4 %331
OpStore %271 %332
%333 = OpLoad %4 %271
%334 = OpLoad %4 %271
%335 = OpExtInst %4 %1 UMax %333 %334
OpStore %271 %335
%336 = OpLoad %4 %271
%337 = OpLoad %4 %271
%338 = OpExtInst %4 %1 UMin %336 %337
OpStore %271 %338
%339 = OpLoad %4 %271
%340 = OpLoad %4 %271
%341 = OpLoad %4 %271
%343 = OpExtInst %4 %1 UMax %339 %340
%342 = OpExtInst %4 %1 UMin %343 %341
OpStore %271 %342
%344 = OpLoad %4 %271
%345 = OpISub %4 %344 %92
OpStore %271 %345
%346 = OpLoad %4 %271
%347 = OpIMul %4 %346 %266
OpStore %271 %347
%348 = OpLoad %4 %271
%349 = OpFunctionCall %4 %240 %348 %267
OpStore %271 %349
%350 = OpLoad %4 %271
%351 = OpFunctionCall %4 %249 %350 %268
OpStore %271 %351
%352 = OpLoad %4 %271
%353 = OpBitwiseAnd %4 %352 %269
OpStore %271 %353
%354 = OpLoad %4 %271
%355 = OpBitwiseOr %4 %354 %270
OpStore %271 %355
%356 = OpLoad %4 %271
%357 = OpBitwiseXor %4 %356 %92
OpStore %271 %357
%358 = OpLoad %4 %271
%359 = OpUConvert %5 %358
%360 = OpAccessChain %214 %263 %75
OpStore %360 %359
%361 = OpLoad %4 %271
%362 = OpSConvert %6 %361
%363 = OpAccessChain %218 %263 %90
OpStore %363 %362
%364 = OpLoad %4 %271
%365 = OpConvertUToF %7 %364
%366 = OpAccessChain %222 %263 %16
OpStore %366 %365
%367 = OpAccessChain %214 %263 %75
%368 = OpLoad %5 %367
%369 = OpUConvert %4 %368
OpStore %271 %369
%370 = OpLoad %4 %271
OpReturnValue %370
%325 = OpAccessChain %320 %263 %322
%326 = OpLoad %10 %325
%327 = OpIAdd %10 %324 %326
%328 = OpAccessChain %320 %265 %322
OpStore %328 %327
%330 = OpAccessChain %329 %264 %77
%331 = OpLoad %15 %330
%332 = OpAccessChain %329 %266 %77
OpStore %332 %331
%333 = OpLoad %4 %273
%334 = OpCopyObject %4 %333
OpStore %273 %334
%335 = OpLoad %4 %273
%336 = OpLoad %4 %273
%337 = OpExtInst %4 %1 UMax %335 %336
OpStore %273 %337
%338 = OpLoad %4 %273
%339 = OpLoad %4 %273
%340 = OpExtInst %4 %1 UMin %338 %339
OpStore %273 %340
%341 = OpLoad %4 %273
%342 = OpLoad %4 %273
%343 = OpLoad %4 %273
%345 = OpExtInst %4 %1 UMax %341 %342
%344 = OpExtInst %4 %1 UMin %345 %343
OpStore %273 %344
%346 = OpLoad %4 %273
%347 = OpISub %4 %346 %94
OpStore %273 %347
%348 = OpLoad %4 %273
%349 = OpIMul %4 %348 %268
OpStore %273 %349
%350 = OpLoad %4 %273
%351 = OpFunctionCall %4 %242 %350 %269
OpStore %273 %351
%352 = OpLoad %4 %273
%353 = OpFunctionCall %4 %251 %352 %270
OpStore %273 %353
%354 = OpLoad %4 %273
%355 = OpBitwiseAnd %4 %354 %271
OpStore %273 %355
%356 = OpLoad %4 %273
%357 = OpBitwiseOr %4 %356 %272
OpStore %273 %357
%358 = OpLoad %4 %273
%359 = OpBitwiseXor %4 %358 %94
OpStore %273 %359
%360 = OpLoad %4 %273
%361 = OpUConvert %5 %360
%362 = OpAccessChain %216 %265 %77
OpStore %362 %361
%363 = OpLoad %4 %273
%364 = OpSConvert %6 %363
%365 = OpAccessChain %220 %265 %92
OpStore %365 %364
%366 = OpLoad %4 %273
%367 = OpConvertUToF %7 %366
%368 = OpAccessChain %224 %265 %16
OpStore %368 %367
%369 = OpAccessChain %216 %265 %77
%370 = OpLoad %5 %369
%371 = OpUConvert %4 %370
OpStore %273 %371
%372 = OpLoad %4 %273
OpReturnValue %372
OpFunctionEnd
%375 = OpFunction %2 None %376
%371 = OpLabel
%384 = OpVariable %95 Function %385
%386 = OpVariable %272 Function %387
%374 = OpLoad %5 %372
%377 = OpAccessChain %74 %26 %75
%378 = OpAccessChain %77 %29 %75
%379 = OpAccessChain %79 %32 %75
%380 = OpAccessChain %77 %35 %75
%381 = OpAccessChain %79 %38 %75
OpBranch %388
%388 = OpLabel
%391 = OpLoad %5 %390
%392 = OpIEqual %48 %391 %75
OpSelectionMerge %393 None
OpBranchConditional %392 %394 %393
%394 = OpLabel
OpStore %41 %389
OpBranch %393
%393 = OpLabel
OpControlBarrier %16 %16 %395
OpBranch %396
%377 = OpFunction %2 None %378
%373 = OpLabel
%386 = OpVariable %97 Function %387
%388 = OpVariable %274 Function %389
%376 = OpLoad %5 %374
%379 = OpAccessChain %76 %26 %77
%380 = OpAccessChain %79 %29 %77
%381 = OpAccessChain %81 %32 %77
%382 = OpAccessChain %79 %35 %77
%383 = OpAccessChain %81 %38 %77
OpBranch %390
%390 = OpLabel
%393 = OpLoad %5 %392
%394 = OpIEqual %48 %393 %77
OpSelectionMerge %395 None
OpBranchConditional %394 %396 %395
%396 = OpLabel
OpStore %41 %245
%397 = OpFunctionCall %4 %258 %382
%398 = OpFunctionCall %3 %72 %383
%399 = OpBitcast %4 %398
%400 = OpIAdd %4 %397 %399
%402 = OpAccessChain %294 %380 %401
OpStore %402 %400
%403 = OpSConvert %3 %374
OpStore %384 %403
%404 = OpLoad %3 %384
%405 = OpGroupNonUniformIAdd %3 %288 Reduce %404
OpStore %384 %405
%406 = OpLoad %3 %384
%407 = OpGroupNonUniformIMul %3 %288 Reduce %406
OpStore %384 %407
%408 = OpLoad %3 %384
%409 = OpGroupNonUniformSMin %3 %288 Reduce %408
OpStore %384 %409
%410 = OpLoad %3 %384
%411 = OpGroupNonUniformSMax %3 %288 Reduce %410
OpStore %384 %411
%412 = OpLoad %3 %384
%413 = OpGroupNonUniformIAdd %3 %288 ExclusiveScan %412
OpStore %384 %413
%414 = OpLoad %3 %384
%415 = OpGroupNonUniformIAdd %3 %288 InclusiveScan %414
OpStore %384 %415
%416 = OpLoad %3 %384
%417 = OpGroupNonUniformBroadcastFirst %3 %288 %416
OpStore %384 %417
%418 = OpLoad %3 %384
%419 = OpGroupNonUniformShuffle %3 %288 %418 %20
OpStore %384 %419
%420 = OpUConvert %4 %374
OpStore %386 %420
%421 = OpLoad %4 %386
%422 = OpGroupNonUniformIAdd %4 %288 Reduce %421
OpStore %386 %422
%423 = OpLoad %4 %386
%424 = OpGroupNonUniformUMin %4 %288 Reduce %423
OpStore %386 %424
%425 = OpLoad %4 %386
%426 = OpGroupNonUniformUMax %4 %288 Reduce %425
OpStore %386 %426
%427 = OpLoad %3 %384
%428 = OpAccessChain %122 %380 %116
OpStore %428 %427
%429 = OpLoad %4 %386
%430 = OpAccessChain %294 %380 %288
OpStore %41 %391
OpBranch %395
%395 = OpLabel
OpControlBarrier %16 %16 %397
OpBranch %398
%398 = OpLabel
OpStore %41 %247
%399 = OpFunctionCall %4 %260 %384
%400 = OpFunctionCall %3 %74 %385
%401 = OpBitcast %4 %400
%402 = OpIAdd %4 %399 %401
%404 = OpAccessChain %296 %382 %403
OpStore %404 %402
%405 = OpSConvert %3 %376
OpStore %386 %405
%406 = OpLoad %3 %386
%407 = OpGroupNonUniformIAdd %3 %290 Reduce %406
OpStore %386 %407
%408 = OpLoad %3 %386
%409 = OpGroupNonUniformIMul %3 %290 Reduce %408
OpStore %386 %409
%410 = OpLoad %3 %386
%411 = OpGroupNonUniformSMin %3 %290 Reduce %410
OpStore %386 %411
%412 = OpLoad %3 %386
%413 = OpGroupNonUniformSMax %3 %290 Reduce %412
OpStore %386 %413
%414 = OpLoad %3 %386
%415 = OpGroupNonUniformIAdd %3 %290 ExclusiveScan %414
OpStore %386 %415
%416 = OpLoad %3 %386
%417 = OpGroupNonUniformIAdd %3 %290 InclusiveScan %416
OpStore %386 %417
%418 = OpLoad %3 %386
%419 = OpGroupNonUniformBroadcastFirst %3 %290 %418
OpStore %386 %419
%420 = OpLoad %3 %386
%421 = OpGroupNonUniformShuffle %3 %290 %420 %20
OpStore %386 %421
%422 = OpUConvert %4 %376
OpStore %388 %422
%423 = OpLoad %4 %388
%424 = OpGroupNonUniformIAdd %4 %290 Reduce %423
OpStore %388 %424
%425 = OpLoad %4 %388
%426 = OpGroupNonUniformUMin %4 %290 Reduce %425
OpStore %388 %426
%427 = OpLoad %4 %388
%428 = OpGroupNonUniformUMax %4 %290 Reduce %427
OpStore %388 %428
%429 = OpLoad %3 %386
%430 = OpAccessChain %124 %382 %118
OpStore %430 %429
%431 = OpLoad %4 %388
%432 = OpAccessChain %296 %382 %290
OpStore %432 %431
OpReturn
OpFunctionEnd
+78 -77
View File
@@ -58,45 +58,45 @@ layout(set = 0, binding = 4, std430) buffer _39_38
int16_t _24 = 1s;
shared uint16_t _41;
uint16_t _240(uint16_t _242, uint16_t _243)
uint16_t _242(uint16_t _244, uint16_t _245)
{
return _242 / ((_243 == 0us) ? 1us : _243);
return _244 / ((_245 == 0us) ? 1us : _245);
}
uint16_t _249(uint16_t _250, uint16_t _251)
uint16_t _251(uint16_t _252, uint16_t _253)
{
return _250 % ((_251 == 0us) ? 1us : _251);
return _252 % ((_253 == 0us) ? 1us : _253);
}
uint16_t _258(uint16_t _257)
uint16_t _260(uint16_t _259)
{
uint16_t _271 = 20us;
_271 += 5us;
_271 += uint16_t(_26._m0._m0);
_271 += uint16_t(_26._m0._m1);
_271 += u16vec3(_26._m0._m3).z;
uint16_t _273 = 20us;
_273 += 5us;
_273 += uint16_t(_26._m0._m0);
_273 += uint16_t(_26._m0._m1);
_273 += u16vec3(_26._m0._m3).z;
_35._m0._m3 = _26._m0._m3 + _29._m0._m3;
_35._m0._m4 = _26._m0._m4 + _29._m0._m4;
_35._m0._m5 = _26._m0._m5 + _29._m0._m5;
_35._m0._m6 = _26._m0._m6 + _29._m0._m6;
_38._m0._m0 = _32._m0._m0;
uint16_t _332 = _271;
_271 = _332;
_271 = max(_271, _271);
_271 = min(_271, _271);
_271 = min(max(_271, _271), _271);
_271 -= 1us;
_271 *= 2us;
_271 = _240(_271, 3us);
_271 = _249(_271, 4us);
_271 &= 255us;
_271 |= 16us;
_271 ^= 1us;
_35._m0._m0 = uint(_271);
_35._m0._m1 = int(int16_t(_271));
_35._m0._m2 = float(_271);
_271 = uint16_t(_35._m0._m0);
return _271;
uint16_t _334 = _273;
_273 = _334;
_273 = max(_273, _273);
_273 = min(_273, _273);
_273 = min(max(_273, _273), _273);
_273 -= 1us;
_273 *= 2us;
_273 = _242(_273, 3us);
_273 = _251(_273, 4us);
_273 &= 255us;
_273 |= 16us;
_273 ^= 1us;
_35._m0._m0 = uint(_273);
_35._m0._m1 = int(int16_t(_273));
_35._m0._m2 = float(_273);
_273 = uint16_t(_35._m0._m0);
return _273;
}
int16_t _43(int16_t _45, int16_t _46)
@@ -106,77 +106,78 @@ int16_t _43(int16_t _45, int16_t _46)
int16_t _59(int16_t _60, int16_t _61)
{
return _60 - (((_61 == 0s) || ((_60 == (-32768s)) && (_61 == (-1s)))) ? 1s : _61) * (_60 / (((_61 == 0s) || ((_60 == (-32768s)) && (_61 == (-1s)))) ? 1s : _61));
int16_t _68 = ((_61 == 0s) || ((_60 == (-32768s)) && (_61 == (-1s)))) ? 1s : _61;
return _60 - ((_60 / _68) * _68);
}
int16_t _72(int16_t _71)
int16_t _74(int16_t _73)
{
int16_t _94 = 20s;
int16_t _96[4] = int16_t[](1s, 2s, 3s, 4s);
_94 += 5s;
_94 += int16_t(_26._m0._m0);
_94 += int16_t(_26._m0._m1);
_94 += i16vec3(_26._m0._m7).z;
int16_t _96 = 20s;
int16_t _98[4] = int16_t[](1s, 2s, 3s, 4s);
_96 += 5s;
_96 += int16_t(_26._m0._m0);
_96 += int16_t(_26._m0._m1);
_96 += i16vec3(_26._m0._m7).z;
_35._m0._m7 = _26._m0._m7 + _29._m0._m7;
_35._m0._m8 = _26._m0._m8 + _29._m0._m8;
_35._m0._m9 = _26._m0._m9 + _29._m0._m9;
_35._m0._m10 = _26._m0._m10 + _29._m0._m10;
_38._m0._m1 = _32._m0._m1;
_94 = abs(_94);
_94 = max(_94, _94);
_94 = min(_94, _94);
_94 = min(max(_94, _94), _94);
_94 = sign(_94);
_94 -= 1s;
_94 *= 2s;
_94 = _43(_94, 3s);
_94 = _59(_94, 4s);
_94 &= 255s;
_94 |= 16s;
_94 ^= 1s;
_94 = _94 << 2u;
_94 = _94 >> 1u;
_94 = -_94;
_94 = (_94 < 0s) ? 2s : 1s;
_96[0u] = _94;
_94 = _96[1u];
_94 = _96[1u];
_35._m0._m0 = uint(uint16_t(_94));
_35._m0._m1 = int(_94);
_35._m0._m2 = float(_94);
_94 = int16_t(_35._m0._m0);
_94 = int16_t(uint16_t(_94));
_96 = abs(_96);
_96 = max(_96, _96);
_96 = min(_96, _96);
_96 = min(max(_96, _96), _96);
_96 = sign(_96);
_96 -= 1s;
_96 *= 2s;
_96 = _43(_96, 3s);
_96 = _59(_96, 4s);
_96 &= 255s;
_96 |= 16s;
_96 ^= 1s;
_96 = _96 << 2u;
_96 = _96 >> 1u;
_96 = -_96;
_96 = (_96 < 0s) ? 2s : 1s;
_98[0u] = _96;
_96 = _98[1u];
_96 = _98[1u];
_35._m0._m0 = uint(uint16_t(_96));
_35._m0._m1 = int(_96);
_35._m0._m2 = float(_96);
_96 = int16_t(_35._m0._m0);
_96 = int16_t(uint16_t(_96));
_35._m0._m8 = (_26._m0._m8 + _26._m0._m8) * i16vec2(2);
return _94;
return _96;
}
void main()
{
int16_t _384 = 0s;
uint16_t _386 = 0us;
int16_t _386 = 0s;
uint16_t _388 = 0us;
if (gl_LocalInvocationIndex == 0u)
{
_41 = 0us;
}
barrier();
_41 = 0us;
uint16_t _397 = _258(67us);
int16_t _398 = _72(60s);
_35._m0._m11 = _397 + uint16_t(_398);
_384 = int16_t(gl_SubgroupInvocationID);
_384 = subgroupAdd(_384);
_384 = subgroupMul(_384);
_384 = subgroupMin(_384);
_384 = subgroupMax(_384);
_384 = subgroupExclusiveAdd(_384);
_384 = subgroupInclusiveAdd(_384);
_384 = subgroupBroadcastFirst(_384);
_384 = subgroupShuffle(_384, 4u);
_386 = uint16_t(gl_SubgroupInvocationID);
uint16_t _399 = _260(67us);
int16_t _400 = _74(60s);
_35._m0._m11 = _399 + uint16_t(_400);
_386 = int16_t(gl_SubgroupInvocationID);
_386 = subgroupAdd(_386);
_386 = subgroupMul(_386);
_386 = subgroupMin(_386);
_386 = subgroupMax(_386);
_35._m0._m7 = _384;
_35._m0._m3 = _386;
_386 = subgroupExclusiveAdd(_386);
_386 = subgroupInclusiveAdd(_386);
_386 = subgroupBroadcastFirst(_386);
_386 = subgroupShuffle(_386, 4u);
_388 = uint16_t(gl_SubgroupInvocationID);
_388 = subgroupAdd(_388);
_388 = subgroupMin(_388);
_388 = subgroupMax(_388);
_35._m0._m7 = _386;
_35._m0._m3 = _388;
}
File diff suppressed because it is too large. Load diff
+165 -162
View File
@@ -13,283 +13,286 @@ ivec4 _50(ivec4 _52, ivec4 _53)
bvec4 _61 = equal(_52, ivec4(int(0x80000000)));
bvec4 _62 = equal(_53, ivec4(-1));
bvec4 _63 = bvec4(_61.x && _62.x, _61.y && _62.y, _61.z && _62.z, _61.w && _62.w);
return _52 - mix(_53, ivec4(1), bvec4(_56.x || _63.x, _56.y || _63.y, _56.z || _63.z, _56.w || _63.w)) * (_52 / mix(_53, ivec4(1), bvec4(_56.x || _63.x, _56.y || _63.y, _56.z || _63.z, _56.w || _63.w)));
ivec4 _66 = mix(_53, ivec4(1), bvec4(_56.x || _63.x, _56.y || _63.y, _56.z || _63.z, _56.w || _63.w));
return _52 - ((_52 / _66) * _66);
}
vec4 _71(float _69, int _70)
vec4 _73(float _71, int _72)
{
return (((vec2(2.0) + vec2(_69)) - vec2(4.0)) / vec2(8.0)).xyxy + vec4(_50(ivec4(_70), ivec4(2)));
return (((vec2(2.0) + vec2(_71)) - vec2(4.0)) / vec2(8.0)).xyxy + vec4(_50(ivec4(_72), ivec4(2)));
}
vec2 _92()
vec2 _94()
{
vec2 _97 = vec2(2.0);
_97 += vec2(1.0);
_97 -= vec2(3.0);
_97 /= vec2(4.0);
return _97;
vec2 _99 = vec2(2.0);
_99 += vec2(1.0);
_99 -= vec2(3.0);
_99 /= vec2(4.0);
return _99;
}
vec3 _109(vec3 _108)
vec3 _111(vec3 _110)
{
return vec3(notEqual(_108, vec3(0.0)));
return vec3(notEqual(_110, vec3(0.0)));
}
bool _118()
bool _120()
{
return true;
}
bool _122()
bool _124()
{
return false;
}
bool _125()
bool _127()
{
return true;
}
bool _128()
bool _130()
{
return false;
}
void _131()
void _133()
{
bool _148 = false;
bool _142 = false;
bool _152 = false;
bool _146 = false;
bool _139 = false;
bool _150 = false;
bool _144 = false;
bool _154 = false;
bool _148 = false;
bool _141 = false;
bool _152 = false;
bool _146 = false;
if (!true)
{
_139 = false;
_141 = false;
}
else
{
_139 = true;
_141 = true;
}
if (true)
{
_142 = false;
}
else
{
_142 = false;
}
if (!false)
{
_144 = false;
}
else
{
_144 = true;
_144 = false;
}
if (!_118())
if (!false)
{
_146 = _122();
_146 = false;
}
else
{
_146 = true;
}
if (_146)
if (!_120())
{
if (!_125())
_148 = _124();
}
else
{
_148 = true;
}
if (_148)
{
if (!_127())
{
_150 = _128();
_152 = _130();
}
else
{
_150 = true;
_152 = true;
}
_148 = _150;
_150 = _152;
}
else
{
_148 = false;
_150 = false;
}
if (false)
{
_152 = _122();
_154 = _124();
}
else
{
_152 = true;
_154 = true;
}
}
int _199(int _201, int _202)
int _201(int _203, int _204)
{
return _201 / (((_202 == 0) || ((_201 == int(0x80000000)) && (_202 == (-1)))) ? 1 : _202);
return _203 / (((_204 == 0) || ((_203 == int(0x80000000)) && (_204 == (-1)))) ? 1 : _204);
}
uint _211(uint _213, uint _214)
uint _213(uint _215, uint _216)
{
return _213 / ((_214 == 0u) ? 1u : _214);
return _215 / ((_216 == 0u) ? 1u : _216);
}
ivec2 _222(ivec2 _224, ivec2 _225)
ivec2 _224(ivec2 _226, ivec2 _227)
{
bvec2 _228 = equal(_225, ivec2(0));
bvec2 _231 = equal(_224, ivec2(int(0x80000000)));
bvec2 _232 = equal(_225, ivec2(-1));
bvec2 _233 = bvec2(_231.x && _232.x, _231.y && _232.y);
return _224 / mix(_225, ivec2(1), bvec2(_228.x || _233.x, _228.y || _233.y));
bvec2 _230 = equal(_227, ivec2(0));
bvec2 _233 = equal(_226, ivec2(int(0x80000000)));
bvec2 _234 = equal(_227, ivec2(-1));
bvec2 _235 = bvec2(_233.x && _234.x, _233.y && _234.y);
return _226 / mix(_227, ivec2(1), bvec2(_230.x || _235.x, _230.y || _235.y));
}
uvec3 _238(uvec3 _240, uvec3 _241)
uvec3 _240(uvec3 _242, uvec3 _243)
{
return _240 / mix(_241, uvec3(1u), equal(_241, uvec3(0u)));
return _242 / mix(_243, uvec3(1u), equal(_243, uvec3(0u)));
}
int _248(int _249, int _250)
int _250(int _251, int _252)
{
return _249 - (((_250 == 0) || ((_249 == int(0x80000000)) && (_250 == (-1)))) ? 1 : _250) * (_249 / (((_250 == 0) || ((_249 == int(0x80000000)) && (_250 == (-1)))) ? 1 : _250));
int _259 = ((_252 == 0) || ((_251 == int(0x80000000)) && (_252 == (-1)))) ? 1 : _252;
return _251 - ((_251 / _259) * _259);
}
uint _259(uint _260, uint _261)
uint _263(uint _264, uint _265)
{
return _260 % ((_261 == 0u) ? 1u : _261);
return _264 % ((_265 == 0u) ? 1u : _265);
}
ivec2 _266(ivec2 _267, ivec2 _268)
ivec2 _270(ivec2 _271, ivec2 _272)
{
bvec2 _270 = equal(_268, ivec2(0));
bvec2 _271 = equal(_267, ivec2(int(0x80000000)));
bvec2 _272 = equal(_268, ivec2(-1));
bvec2 _273 = bvec2(_271.x && _272.x, _271.y && _272.y);
return _267 - mix(_268, ivec2(1), bvec2(_270.x || _273.x, _270.y || _273.y)) * (_267 / mix(_268, ivec2(1), bvec2(_270.x || _273.x, _270.y || _273.y)));
bvec2 _274 = equal(_272, ivec2(0));
bvec2 _275 = equal(_271, ivec2(int(0x80000000)));
bvec2 _276 = equal(_272, ivec2(-1));
bvec2 _277 = bvec2(_275.x && _276.x, _275.y && _276.y);
ivec2 _279 = mix(_272, ivec2(1), bvec2(_274.x || _277.x, _274.y || _277.y));
return _271 - ((_271 / _279) * _279);
}
uvec3 _277(uvec3 _278, uvec3 _279)
uvec3 _283(uvec3 _284, uvec3 _285)
{
return _278 % mix(_279, uvec3(1u), equal(_279, uvec3(0u)));
return _284 % mix(_285, uvec3(1u), equal(_285, uvec3(0u)));
}
uvec2 _285(uvec2 _287, uvec2 _288)
uvec2 _291(uvec2 _293, uvec2 _294)
{
return _287 / mix(_288, uvec2(1u), equal(_288, uvec2(0u)));
return _293 / mix(_294, uvec2(1u), equal(_294, uvec2(0u)));
}
uvec2 _295(uvec2 _296, uvec2 _297)
uvec2 _301(uvec2 _302, uvec2 _303)
{
return _296 % mix(_297, uvec2(1u), equal(_297, uvec2(0u)));
return _302 % mix(_303, uvec2(1u), equal(_303, uvec2(0u)));
}
void _303()
void _309()
{
int _315 = 0;
int _318 = 0;
float _321 = -1.0;
ivec2 _322 = -ivec2(1);
vec2 _323 = -vec2(1.0);
int _324 = 2 + 1;
uint _325 = 2u + 1u;
float _326 = 2.0 + 1.0;
ivec2 _327 = ivec2(2) + ivec2(1);
uvec3 _328 = uvec3(2u) + uvec3(1u);
vec4 _329 = vec4(2.0) + vec4(1.0);
int _330 = 2 - 1;
uint _331 = 2u - 1u;
float _332 = 2.0 - 1.0;
ivec2 _333 = ivec2(2) - ivec2(1);
uvec3 _334 = uvec3(2u) - uvec3(1u);
vec4 _335 = vec4(2.0) - vec4(1.0);
int _336 = 2 * 1;
uint _337 = 2u * 1u;
float _338 = 2.0 * 1.0;
ivec2 _339 = ivec2(2) * ivec2(1);
uvec3 _340 = uvec3(2u) * uvec3(1u);
vec4 _341 = vec4(2.0) * vec4(1.0);
float _344 = 2.0 / 1.0;
vec4 _347 = vec4(2.0) / vec4(1.0);
float _350 = 2.0 - 1.0 * trunc(2.0 / 1.0);
vec4 _353 = vec4(2.0) - vec4(1.0) * trunc(vec4(2.0) / vec4(1.0));
ivec2 _356 = ivec2(2) + ivec2(1);
ivec2 _357 = ivec2(2) + ivec2(1);
uvec2 _358 = uvec2(2u) + uvec2(1u);
uvec2 _359 = uvec2(2u) + uvec2(1u);
vec2 _360 = vec2(2.0) + vec2(1.0);
vec2 _361 = vec2(2.0) + vec2(1.0);
ivec2 _362 = ivec2(2) - ivec2(1);
ivec2 _363 = ivec2(2) - ivec2(1);
uvec2 _364 = uvec2(2u) - uvec2(1u);
uvec2 _365 = uvec2(2u) - uvec2(1u);
vec2 _366 = vec2(2.0) - vec2(1.0);
vec2 _367 = vec2(2.0) - vec2(1.0);
vec2 _376 = vec2(2.0) * 1.0;
vec2 _377 = vec2(1.0) * 2.0;
vec2 _382 = vec2(2.0) / vec2(1.0);
vec2 _383 = vec2(2.0) / vec2(1.0);
vec2 _388 = vec2(2.0) - vec2(1.0) * trunc(vec2(2.0) / vec2(1.0));
vec2 _389 = vec2(2.0) - vec2(1.0) * trunc(vec2(2.0) / vec2(1.0));
mat3 _390 = mat3(vec3(0.0), vec3(0.0), vec3(0.0)) * 1.0;
mat3 _391 = mat3(vec3(0.0), vec3(0.0), vec3(0.0)) * 2.0;
vec3 _392 = mat4x3(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0)) * vec4(1.0);
vec4 _393 = vec3(2.0) * mat4x3(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));
_318 = _315 + int(0x80000000);
int _321 = 0;
int _324 = 0;
float _327 = -1.0;
ivec2 _328 = -ivec2(1);
vec2 _329 = -vec2(1.0);
int _330 = 2 + 1;
uint _331 = 2u + 1u;
float _332 = 2.0 + 1.0;
ivec2 _333 = ivec2(2) + ivec2(1);
uvec3 _334 = uvec3(2u) + uvec3(1u);
vec4 _335 = vec4(2.0) + vec4(1.0);
int _336 = 2 - 1;
uint _337 = 2u - 1u;
float _338 = 2.0 - 1.0;
ivec2 _339 = ivec2(2) - ivec2(1);
uvec3 _340 = uvec3(2u) - uvec3(1u);
vec4 _341 = vec4(2.0) - vec4(1.0);
int _342 = 2 * 1;
uint _343 = 2u * 1u;
float _344 = 2.0 * 1.0;
ivec2 _345 = ivec2(2) * ivec2(1);
uvec3 _346 = uvec3(2u) * uvec3(1u);
vec4 _347 = vec4(2.0) * vec4(1.0);
float _350 = 2.0 / 1.0;
vec4 _353 = vec4(2.0) / vec4(1.0);
float _356 = 2.0 - 1.0 * trunc(2.0 / 1.0);
vec4 _359 = vec4(2.0) - vec4(1.0) * trunc(vec4(2.0) / vec4(1.0));
ivec2 _362 = ivec2(2) + ivec2(1);
ivec2 _363 = ivec2(2) + ivec2(1);
uvec2 _364 = uvec2(2u) + uvec2(1u);
uvec2 _365 = uvec2(2u) + uvec2(1u);
vec2 _366 = vec2(2.0) + vec2(1.0);
vec2 _367 = vec2(2.0) + vec2(1.0);
ivec2 _368 = ivec2(2) - ivec2(1);
ivec2 _369 = ivec2(2) - ivec2(1);
uvec2 _370 = uvec2(2u) - uvec2(1u);
uvec2 _371 = uvec2(2u) - uvec2(1u);
vec2 _372 = vec2(2.0) - vec2(1.0);
vec2 _373 = vec2(2.0) - vec2(1.0);
vec2 _382 = vec2(2.0) * 1.0;
vec2 _383 = vec2(1.0) * 2.0;
vec2 _388 = vec2(2.0) / vec2(1.0);
vec2 _389 = vec2(2.0) / vec2(1.0);
vec2 _394 = vec2(2.0) - vec2(1.0) * trunc(vec2(2.0) / vec2(1.0));
vec2 _395 = vec2(2.0) - vec2(1.0) * trunc(vec2(2.0) / vec2(1.0));
mat3 _396 = mat3(vec3(0.0), vec3(0.0), vec3(0.0)) * 1.0;
mat3 _397 = mat3(vec3(0.0), vec3(0.0), vec3(0.0)) * 2.0;
vec3 _398 = mat4x3(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0)) * vec4(1.0);
vec4 _399 = vec3(2.0) * mat4x3(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));
_324 = _321 + int(0x80000000);
}
void _397()
void _403()
{
}
void _424()
void _430()
{
}
void _463()
void _469()
{
int _465 = 0;
ivec3 _467 = ivec3(0);
_465 = 1;
_465++;
_465--;
_465 *= _465;
_465 = _199(_465, _465);
_465 = _248(_465, 1);
_465 &= 0;
_465 |= 0;
_465 ^= 0;
_465 = _465 << int(2u);
_465 = _465 >> int(1u);
_465++;
_465--;
_467.y++;
_467.y--;
int _471 = 0;
ivec3 _473 = ivec3(0);
_471 = 1;
_471++;
_471--;
_471 *= _471;
_471 = _201(_471, _471);
_471 = _250(_471, 1);
_471 &= 0;
_471 |= 0;
_471 ^= 0;
_471 = _471 << int(2u);
_471 = _471 >> int(1u);
_471++;
_471--;
_473.y++;
_473.y--;
}
void _505()
void _511()
{
int _507 = -1;
int _508 = -1;
int _510 = -1;
int _512 = -1;
int _513 = -1;
int _514 = -1;
int _517 = -1;
int _521 = -1;
int _526 = -1;
float _531 = -1.0;
float _532 = -1.0;
float _534 = -1.0;
float _536 = -1.0;
int _516 = -1;
int _518 = -1;
int _520 = -1;
int _523 = -1;
int _527 = -1;
int _532 = -1;
float _537 = -1.0;
float _538 = -1.0;
float _541 = -1.0;
float _545 = -1.0;
float _550 = -1.0;
float _540 = -1.0;
float _542 = -1.0;
float _544 = -1.0;
float _547 = -1.0;
float _551 = -1.0;
float _556 = -1.0;
}
void main()
{
_131();
_303();
_397();
_424();
_463();
_505();
_133();
_309();
_403();
_430();
_469();
_511();
}