From: Brian Paul Date: Sat, 7 Feb 2009 18:20:08 +0000 (-0700) Subject: mesa: fix logic error in computing enableBits in update_texture_state() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b46611633c5da6fa23ee17bce22939fe20ef194e;p=mesa.git mesa: fix logic error in computing enableBits in update_texture_state() If we had a vertex shader but no fragment shader (i.e. fixed function) we didn't get the right enabled texture targets. Fixes blank/white texture problem. --- diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index f7a4d8b323b..be6ce186896 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -488,25 +488,27 @@ update_texture_state( GLcontext *ctx ) texUnit->_ReallyEnabled = 0; texUnit->_GenFlags = 0; - /* Get the bitmask of texture enables. + /* Get the bitmask of texture target enables. * enableBits will be a mask of the TEXTURE_*_BIT flags indicating * which texture targets are enabled (fixed function) or referenced * by a fragment shader/program. When multiple flags are set, we'll * settle on the one with highest priority (see texture_override below). */ - if (fprog || vprog) { - enableBits = 0x0; - if (fprog) - enableBits |= fprog->Base.TexturesUsed[unit]; - if (vprog) - enableBits |= vprog->Base.TexturesUsed[unit]; + enableBits = 0x0; + if (vprog) { + enableBits |= vprog->Base.TexturesUsed[unit]; + } + if (fprog) { + enableBits |= fprog->Base.TexturesUsed[unit]; } else { - if (!texUnit->Enabled) - continue; - enableBits = texUnit->Enabled; + /* fixed-function fragment program */ + enableBits |= texUnit->Enabled; } + if (enableBits == 0x0) + continue; + ASSERT(texUnit->Current1D); ASSERT(texUnit->Current2D); ASSERT(texUnit->Current3D);