mirror of https://github.com/alibaba/MNN.git
30 lines
728 B
Plaintext
30 lines
728 B
Plaintext
#version 450 core
|
|
layout(std430) buffer;
|
|
layout(std430) uniform;
|
|
layout(set=0, binding=0) uniform mediump sampler3D uInput;
|
|
|
|
layout(set=0, binding=1) writeonly buffer destBuffer{
|
|
vec4 data[];
|
|
} uOutBuffer;
|
|
|
|
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)
|
|
{
|
|
vec4 color = texelFetch(uInput, pos, 0);
|
|
int basicOffset = pos.z*uConstant.width*uConstant.height+uConstant.width*pos.y+pos.x;
|
|
uOutBuffer.data[basicOffset] = color;
|
|
}
|
|
}
|