mirror of
https://github.com/libretro/RetroArch
synced 2025-02-03 17:54:04 +00:00
501fd33b68
git-subtree-dir: deps/SPIRV-Cross git-subtree-split: d4b0625cbd7377e720b4fa1d63e6a3c09da5db63
33 lines
1.1 KiB
Plaintext
33 lines
1.1 KiB
Plaintext
#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 outputData
|
|
{
|
|
float outputDataArray[];
|
|
} _74;
|
|
|
|
void main()
|
|
{
|
|
float thisLaneData = _12.inputDataArray[gl_LocalInvocationID.x];
|
|
bool laneActive = thisLaneData > 0.0;
|
|
uint thisLaneOutputSlot = mbcntAMD(packUint2x32(uvec2(unpackUint2x32(ballotARB(laneActive)).xy)));
|
|
int firstInvocation = readFirstInvocationARB(1);
|
|
int invocation = readInvocationARB(1, 0u);
|
|
vec3 swizzleInvocations = swizzleInvocationsAMD(vec3(0.0, 2.0, 1.0), uvec4(3u));
|
|
vec3 swizzelInvocationsMasked = swizzleInvocationsMaskedAMD(vec3(0.0, 2.0, 1.0), uvec3(2u));
|
|
vec3 writeInvocation = writeInvocationAMD(swizzleInvocations, swizzelInvocationsMasked, 0u);
|
|
if (laneActive)
|
|
{
|
|
_74.outputDataArray[thisLaneOutputSlot] = thisLaneData;
|
|
}
|
|
}
|
|
|