1.21.5 partial

This commit is contained in:
mcrcortex
2025-04-01 16:10:10 +10:00
parent 7f3be8c1ac
commit 9e442ef854
12 changed files with 530 additions and 24 deletions

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -32,7 +32,7 @@
"common.voxy.mixins.json"
],
"depends": {
"minecraft": "1.21.4",
"minecraft": "1.21.5",
"fabricloader": ">=0.14.22",
"fabric-api": ">=0.91.1",
"cloth-config": ">=13",

View File

@@ -25,4 +25,7 @@ accessible field net/minecraft/world/chunk/PalettedContainer data Lnet/minecraft
accessible field net/minecraft/world/chunk/PalettedContainer$Data storage Lnet/minecraft/util/collection/PaletteStorage;
accessible field net/minecraft/world/chunk/PalettedContainer$Data palette Lnet/minecraft/world/chunk/Palette;
accessible field net/minecraft/client/gl/GlGpuBuffer id I
accessible field net/minecraft/client/gl/GlGpuBuffer id I
accessible field net/minecraft/client/gl/GlResourceManager currentProgram Lnet/minecraft/client/gl/ShaderProgram;
accessible field net/minecraft/client/gl/GlResourceManager currentPipeline Lcom/mojang/blaze3d/pipeline/RenderPipeline;