Assign textures in depth-only pass (fixed state desync bug)

This commit is contained in:
Mid 2025-12-01 23:55:17 +02:00
parent b532ccd68f
commit 8207743308

View File

@ -1749,6 +1749,7 @@ void k3PassDepthOnly(mat4 projection, mat4 cam, int clear, int cull) {
setup_core_projection(glslp, projection);
bind_mat_textures(mat, 0);
setup_glsl_mat_uniforms(glslp, mat, 0);
setup_glsl_model_uniforms(glslp, modelmat);
@ -1783,6 +1784,15 @@ void k3PassDepthOnly(mat4 projection, mat4 cam, int clear, int cull) {
glLoadMatrixf((float*) modelview);
}
if(!k3IsCore) {
if(mat->passes[0].alphatest) {
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0.9f);
} else {
glDisable(GL_ALPHA_TEST);
}
}
glBindBufferARB(GL_ARRAY_BUFFER_ARB, mdl->vstore->gl);
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mdl->estore->gl);