summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-01-04 14:33:42 -0700
committerBrian <[email protected]>2007-01-04 14:33:42 -0700
commit602045fd7bfb80a7a06c1fda5ffe66d9e4cc02b0 (patch)
treed6497e218c3f9b640a8f2e6c28e7b4847a2bb559
parent439758353aea3ede1f6d7fc1be14777df8697db5 (diff)
update_texture_state() updated for new shaders
-rw-r--r--src/mesa/main/texstate.c39
1 files changed, 10 insertions, 29 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
index e089de93104..97cc0cf4fb2 100644
--- a/src/mesa/main/texstate.c
+++ b/src/mesa/main/texstate.c
@@ -2920,13 +2920,6 @@ update_texture_state( GLcontext *ctx )
{
GLuint unit;
-#if 0 /** XXX NEW_SLANG */
-#if FEATURE_ARB_fragment_shader
- struct gl2_program_intf **prog = ctx->ShaderObjects.CurrentProgram;
- GLbitfield progteximageusage[MAX_TEXTURE_IMAGE_UNITS];
-#endif
-#endif
-
ctx->NewState |= _NEW_TEXTURE; /* TODO: only set this if there are
* actual changes.
*/
@@ -2936,19 +2929,6 @@ update_texture_state( GLcontext *ctx )
ctx->Texture._TexMatEnabled = 0;
ctx->Texture._TexGenEnabled = 0;
-#if 00 /* XXX NEW_SLANG */
-#if FEATURE_ARB_fragment_shader
- /*
- * Grab texture image usage state from shader program. It must be
- * grabbed every time uniform sampler changes, so maybe there is a
- * better place to perform these rather expensive computations.
- */
- if (ctx->ShaderObjects._FragmentShaderPresent) {
- (**prog).GetTextureImageUsage (prog, progteximageusage);
- }
-#endif /* FEATURE_ARB_fragment_shader */
-#endif
-
/*
* Update texture unit state.
*/
@@ -2960,16 +2940,17 @@ update_texture_state( GLcontext *ctx )
texUnit->_ReallyEnabled = 0;
texUnit->_GenFlags = 0;
- /* Get the bitmask of texture enables */
-#if 000 /* XXX NEW_SLANG */
-#if FEATURE_ARB_fragment_shader
- if (ctx->ShaderObjects._FragmentShaderPresent) {
- enableBits = progteximageusage[unit];
+ /* Get the bitmask of texture 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 (ctx->Shader.CurrentProgram &&
+ ctx->Shader.CurrentProgram->LinkStatus) {
+ enableBits = ctx->Shader.CurrentProgram->FragmentProgram->TexturesUsed[unit];
}
- else
-#endif
-#endif
- if (ctx->FragmentProgram._Enabled) {
+ else if (ctx->FragmentProgram._Enabled) {
enableBits = ctx->FragmentProgram.Current->TexturesUsed[unit];
}
else {