summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-10-01 08:27:46 -0600
committerBrian Paul <[email protected]>2011-10-01 08:29:34 -0600
commitdd9574d7a585bd470f2fe28f73e6d31430293dc9 (patch)
treef353729572ad17f9586187ad7d9a66f8a64abdd1
parent9520f483b8f1e45fa474674b415554988de5d8d3 (diff)
mesa: number of combiner terms to pop depends on GL_NV_texture_env_combine4
If GL_NV_texture_env_combine4 is not supported, setting the fourth combiner term would generate a GL error. Of course, I noticed this right after committing the previous patch to use a loop in the first place. <sigh> Note that GL_EXT_texture_env_combine is always supported so the first three combiner terms are always accepted.
-rw-r--r--src/mesa/main/attrib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index df7116eec1e..e67957d4d18 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -720,8 +720,9 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate)
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA,
unit->Combine.ModeA);
{
+ const GLuint n = ctx->Extensions.NV_texture_env_combine4 ? 4 : 3;
GLuint i;
- for (i = 0; i < MAX_COMBINER_TERMS; i++) {
+ for (i = 0; i < n; i++) {
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB + i,
unit->Combine.SourceRGB[i]);
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA + i,