1.21.5 partial
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#version 450
|
||||
|
||||
layout(local_size_x = WIDTH, local_size_y = HEIGHT) in;
|
||||
|
||||
layout(binding = COLOUR_IN_BINDING) uniform sampler2D colourTexIn;
|
||||
layout(binding = DEPTH_IN_BINDING) uniform sampler2D depthTexIn;
|
||||
layout(binding = STENCIL_IN_BINDING) uniform usampler2D stencilTexIn;
|
||||
layout(binding = BUFFER_OUT_BINDING, std430) writeonly restrict buffer OutBuffer {
|
||||
uvec2[] outBuffer;
|
||||
};
|
||||
|
||||
void main() {
|
||||
uint localOutIndex = gl_LocalInvocationID.x + gl_LocalInvocationID.y*WIDTH;
|
||||
uint groupOutIndex = (gl_WorkGroupID.x + gl_WorkGroupID.y*3)*(WIDTH*HEIGHT);
|
||||
uint globalOutIndex = groupOutIndex+localOutIndex;
|
||||
|
||||
ivec2 samplePoint = ivec2(gl_GlobalInvocationID.xy);
|
||||
|
||||
uvec2 outPoint = uvec2(0);
|
||||
|
||||
uvec4 colour = clamp(uvec4(texelFetch(colourTexIn, samplePoint, 0)*255), uvec4(0), uvec4(255));//TODO: check that this actually gets to the range of 255
|
||||
colour <<= uvec4(0,8,16,24);//ABGR format!!!
|
||||
outPoint.x = colour.r|colour.g|colour.b|colour.a;
|
||||
|
||||
float depth = clamp(texelFetch(depthTexIn, samplePoint, 0).r, 0, 1);//Opengl grumble grumble
|
||||
uint stencil = texelFetch(stencilTexIn, samplePoint, 0).r;
|
||||
uint value = uint(depth*((1<<24)-1))<<8;
|
||||
value |= stencil;
|
||||
outPoint.y = value;
|
||||
|
||||
outBuffer[globalOutIndex] = outPoint;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ layout(location=0) in vec3 pos;
|
||||
layout(location=1) in vec2 uv;
|
||||
layout(location=2) in vec4 _metadata;
|
||||
|
||||
layout(location=1) uniform mat4 transform;
|
||||
uniform mat4 transform;
|
||||
out vec2 texCoord;
|
||||
out flat uint metadata;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user