From 93c71cb74a7f056861cbfae909a806b63904c14e Mon Sep 17 00:00:00 2001 From: nillerusr Date: Thu, 8 Sep 2022 20:41:35 +0300 Subject: [PATCH] togles: fix alpha test on some GPUs( fixes #119 ) --- togles/linuxwin/cglmprogram.cpp | 1 + togles/linuxwin/glmgr_flush.inl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/togles/linuxwin/cglmprogram.cpp b/togles/linuxwin/cglmprogram.cpp index 28d24f91..9a7dcfaa 100644 --- a/togles/linuxwin/cglmprogram.cpp +++ b/togles/linuxwin/cglmprogram.cpp @@ -693,6 +693,7 @@ CGLMShaderPair::CGLMShaderPair( GLMContext *ctx ) m_program = gGL->glCreateProgram(); m_locVertexParams = -1; + m_locAlphaRef = -1; m_locVertexBoneParams = -1; m_locVertexScreenParams = -1; m_nScreenWidthHeight = 0xFFFFFFFF; diff --git a/togles/linuxwin/glmgr_flush.inl b/togles/linuxwin/glmgr_flush.inl index 126d08b1..21e2f0c0 100644 --- a/togles/linuxwin/glmgr_flush.inl +++ b/togles/linuxwin/glmgr_flush.inl @@ -480,7 +480,7 @@ FORCEINLINE void GLMContext::FlushDrawStates( uint nStartIndex, uint nEndIndex, } - if( !gGL->m_bHave_GL_QCOM_alpha_test && m_pBoundPair->m_locAlphaRef ) + if( !gGL->m_bHave_GL_QCOM_alpha_test && m_pBoundPair->m_locAlphaRef != -1 ) { if( !m_AlphaTestEnable.GetData().enable ) gGL->glUniform1f( m_pBoundPair->m_locAlphaRef, 0.0 );