SPIRV-Cross/reference/opt/shaders/amd/shader_ballot.comp

29 lines
656 B
Plaintext
Raw Normal View History

2017-11-23 08:57:30 +00:00
#version 450
#extension GL_ARB_gpu_shader_int64 : require
#extension GL_ARB_shader_ballot : require
#extension GL_AMD_shader_ballot : require
layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in;
layout(binding = 0, std430) buffer inputData
{
float inputDataArray[];
} _12;
layout(binding = 1, std430) buffer _10_74
2017-11-23 08:57:30 +00:00
{
float inputDataArray[];
2017-11-23 08:57:30 +00:00
} _74;
void main()
{
float _25 = _12.inputDataArray[gl_LocalInvocationID.x];
bool _31 = _25 > 0.0;
uvec4 _37 = uvec4(unpackUint2x32(ballotARB(_31)), 0u, 0u);
uint _44 = mbcntAMD(packUint2x32(uvec2(_37.xy)));
2017-11-23 08:57:30 +00:00
if (_31)
{
_74.inputDataArray[_44] = _25;
2017-11-23 08:57:30 +00:00
}
}