32 lines
767 B
Plaintext
32 lines
767 B
Plaintext
#version 450 core
|
|
layout(std430) buffer;
|
|
layout(std430) uniform;
|
|
layout(set=0, binding=0, rgba8ui) writeonly restrict mediump uniform uimage3D uOutput;
|
|
|
|
layout(set=0, binding=1) readonly buffer destBuffer{
|
|
uvec4 data[];
|
|
} uInBuffer;
|
|
|
|
layout(set=0, binding=2) uniform constBuffer{
|
|
int width;
|
|
int height;
|
|
int channel;
|
|
int batch;
|
|
} uConstant;
|
|
|
|
layout (local_size_x = 16, local_size_y = 16, local_size_z = 1) in;
|
|
|
|
void main()
|
|
{
|
|
ivec3 pos = ivec3(gl_GlobalInvocationID);
|
|
|
|
if (pos.x < uConstant.width && pos.y < uConstant.height)
|
|
{
|
|
int basicOffset = 0
|
|
+ pos.z*uConstant.width*uConstant.height
|
|
+ uConstant.width*pos.y
|
|
+ pos.x;
|
|
imageStore(uOutput, pos, uInBuffer.data[basicOffset]);
|
|
}
|
|
}
|