diff --git a/GL/draw.c b/GL/draw.c index d130336..0e5c87c 100644 --- a/GL/draw.c +++ b/GL/draw.c @@ -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); diff --git a/GL/flush.c b/GL/flush.c index bcc9c6f..6aab22f 100644 --- a/GL/flush.c +++ b/GL/flush.c @@ -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(); diff --git a/GL/private.h b/GL/private.h index c810872..0df8150 100644 --- a/GL/private.h +++ b/GL/private.h @@ -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;