Model fixes (namely on intel)

This commit is contained in:
mcrcortex
2025-05-17 11:33:35 +10:00
parent 2618c6a978
commit 95fbd77a0e
4 changed files with 10 additions and 10 deletions

View File

@@ -100,6 +100,7 @@ public class ModelBakerySubsystem {
this.factory.tick(); this.factory.tick();
start = System.nanoTime();
while (!this.factory.resultJobs.isEmpty()) { while (!this.factory.resultJobs.isEmpty()) {
this.factory.resultJobs.poll().run(); this.factory.resultJobs.poll().run();
if (totalBudget<(System.nanoTime()-start)) if (totalBudget<(System.nanoTime()-start))

View File

@@ -21,11 +21,10 @@ import net.minecraft.world.chunk.light.LightingProvider;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.joml.Matrix4f; import org.joml.Matrix4f;
import static org.lwjgl.opengl.ARBShaderImageLoadStore.*;
import static org.lwjgl.opengl.GL11.*; import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL14C.glBlendFuncSeparate; import static org.lwjgl.opengl.GL14C.glBlendFuncSeparate;
import static org.lwjgl.opengl.GL30.*; import static org.lwjgl.opengl.GL30.*;
import static org.lwjgl.opengl.GL45.glClearNamedFramebufferfv; import static org.lwjgl.opengl.GL45.glTextureBarrier;
public class ModelTextureBakery { public class ModelTextureBakery {
//Note: the first bit of metadata is if alpha discard is enabled //Note: the first bit of metadata is if alpha discard is enabled
@@ -188,7 +187,8 @@ public class ModelTextureBakery {
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFuncSeparate(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glBlendFuncSeparate(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
} else { } else {
glDisable(GL_BLEND); glDisable(GL_BLEND);//FUCK YOU INTEL (screams), for _some reason_ discard or something... JUST DOESNT WORK??
//glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ONE);
} }
glStencilOp(GL_KEEP, GL_KEEP, GL_INCR); glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
@@ -281,7 +281,7 @@ public class ModelTextureBakery {
glDisable(GL_BLEND); glDisable(GL_BLEND);
//Finish and download //Finish and download
glMemoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT|GL_TEXTURE_UPDATE_BARRIER_BIT|GL_PIXEL_BUFFER_BARRIER_BIT|GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);//Am not sure if barriers are right glTextureBarrier();
this.capture.emitToStream(streamBuffer, streamOffset); this.capture.emitToStream(streamBuffer, streamOffset);
glBindFramebuffer(GL_FRAMEBUFFER, this.capture.framebuffer.id); glBindFramebuffer(GL_FRAMEBUFFER, this.capture.framebuffer.id);

View File

@@ -1,8 +1,8 @@
#version 430 #version 430
layout(location=0) uniform sampler2D tex; layout(location=0) uniform sampler2D tex;
in flat uint metadata;
in vec2 texCoord; in vec2 texCoord;
in flat uint metadata;
out vec4 colour; out vec4 colour;
void main() { void main() {

View File

@@ -1,16 +1,15 @@
#version 430 #version 430
layout(location=0) in vec3 pos; layout(location=0) in vec4 pos;
layout(location=1) in uint _metadata; layout(location=1) in vec2 uv;
layout(location=2) in vec2 uv;
layout(location=1) uniform mat4 transform; layout(location=1) uniform mat4 transform;
out vec2 texCoord; out vec2 texCoord;
out flat uint metadata; out flat uint metadata;
void main() { void main() {
metadata = _metadata; metadata = floatBitsToUint(pos.w);//Fuck you intel
gl_Position = transform * vec4(pos, 1.0); gl_Position = transform * vec4(pos.xyz, 1.0);
texCoord = uv; texCoord = uv;
} }