From cde0abd18d75f1a6cc2863f938c0d3d927e506a4 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Sun, 23 May 2021 13:15:07 +0100 Subject: [PATCH] Force the correct depth and blend modes with PT polys --- GL/draw.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GL/draw.c b/GL/draw.c index 99a668d..d130336 100644 --- a/GL/draw.c +++ b/GL/draw.c @@ -1133,6 +1133,13 @@ GL_FORCE_INLINE void push(PolyHeader* header, GLboolean multiTextureHeader, Poly PolyContext cxt = *_glGetPVRContext(); cxt.list_type = activePolyList->list_type; + /* Punch-through polys require fixed blending and depth modes */ + if(cxt.list_type == GPU_LIST_PT_POLY) { + cxt.blend.src = GPU_BLEND_SRCALPHA; + cxt.blend.dst = GPU_BLEND_INVSRCALPHA; + cxt.depth.comparison = GPU_DEPTHCMP_LEQUAL; + } + _glUpdatePVRTextureContext(&cxt, textureUnit); if(multiTextureHeader) {