diff options
author | Brian Paul <[email protected]> | 2009-02-07 11:20:08 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-02-07 11:20:08 -0700 |
commit | b46611633c5da6fa23ee17bce22939fe20ef194e (patch) | |
tree | d9a53f74246e03201b372deafdd01f12ad0901f9 | |
parent | f6d23943cd289ed2b60ec01006fb155f22969749 (diff) |
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.
-rw-r--r-- | src/mesa/main/texstate.c | 22 |
1 files changed, 12 insertions, 10 deletions
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); |