31 lines
732 B
Plaintext
31 lines
732 B
Plaintext
#ifndef REVERT
|
|
#define INPUT_TYPE FLOAT4
|
|
#define OUTPUT_TYPE ivec4
|
|
#else
|
|
#define INPUT_TYPE ivec4
|
|
#define OUTPUT_TYPE FLOAT4
|
|
#endif
|
|
|
|
layout(set=0, binding=0) writeonly buffer destBuffer{
|
|
OUTPUT_TYPE data[];
|
|
} uOutput;
|
|
|
|
layout(set=0, binding=1) readonly buffer sourceBuffer0{
|
|
INPUT_TYPE data[];
|
|
} uInput;
|
|
layout(set=0, binding=2) uniform constBuffer{
|
|
ivec4 size; // x: limit, y: channelC4*b, z:height, w:width
|
|
vec4 slope;
|
|
} uConstant;
|
|
|
|
layout(local_size_x = 256, local_size_y = 1, local_size_z = 1) in;
|
|
|
|
void main()
|
|
{
|
|
ivec3 posTmp = ivec3(gl_GlobalInvocationID);
|
|
if (posTmp.x < uConstant.size.x) {
|
|
INPUT_TYPE value = uInput.data[posTmp.x];
|
|
uOutput.data[posTmp.x] = OUTPUT_TYPE(value);
|
|
}
|
|
}
|