Set the right depth mode when autosort is on

This commit is contained in:
Luke Benstead 2021-05-23 13:19:54 +01:00
parent cde0abd18d
commit a79c1dd753
3 changed files with 8 additions and 0 deletions

View File

@ -1138,6 +1138,9 @@ GL_FORCE_INLINE void push(PolyHeader* header, GLboolean multiTextureHeader, Poly
cxt.blend.src = GPU_BLEND_SRCALPHA;
cxt.blend.dst = GPU_BLEND_INVSRCALPHA;
cxt.depth.comparison = GPU_DEPTHCMP_LEQUAL;
} else if(cxt.list_type == GPU_LIST_TR_POLY && AUTOSORT_ENABLED) {
/* Autosort mode requires this mode for transparent polys */
cxt.depth.comparison = GPU_DEPTHCMP_GEQUAL;
}
_glUpdatePVRTextureContext(&cxt, textureUnit);

View File

@ -15,6 +15,8 @@ PolyList TR_LIST;
#define FAST_MODE GL_FALSE
GLboolean AUTOSORT_ENABLED = GL_FALSE;
PolyList* _glOpaquePolyList() {
return &OP_LIST;
}
@ -54,6 +56,8 @@ void APIENTRY glKosInitEx(GLdcConfig* config) {
InitGPU(config->autosort_enabled, config->fsaa_enabled);
AUTOSORT_ENABLED = config->autosort_enabled;
_glInitMatrices();
_glInitAttributePointers();
_glInitContext();

View File

@ -339,6 +339,7 @@ void _glApplyColorTable(TexturePalette *palette);
extern GLboolean BLEND_ENABLED;
extern GLboolean ALPHA_TEST_ENABLED;
extern GLboolean AUTOSORT_ENABLED;
GL_FORCE_INLINE GLboolean _glIsBlendingEnabled() {
return BLEND_ENABLED;