summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-05-01 22:44:02 +0000
committerBrian Paul <[email protected]>2003-05-01 22:44:02 +0000
commit92f9785c727ea10ff5f8dc9770f0e8f388fcea70 (patch)
tree10335899a8205128723f6b459d827e918bbc2d86 /src/mesa/tnl
parent09b00c5ded8e6211c9c79be600bb8c8ecad0d8fc (diff)
Use ctx->Const.MaxTextureImageUnits and MaxTextureCoordUnits in more places.
Misc vertex array / vertex program changes.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_imm_dlist.c2
-rw-r--r--src/mesa/tnl/t_imm_elt.c2
-rw-r--r--src/mesa/tnl/t_imm_exec.c8
-rw-r--r--src/mesa/tnl/t_vb_texgen.c10
-rw-r--r--src/mesa/tnl/t_vb_texmat.c10
5 files changed, 13 insertions, 19 deletions
diff --git a/src/mesa/tnl/t_imm_dlist.c b/src/mesa/tnl/t_imm_dlist.c
index 5d7cd47499e..3efe61592f2 100644
--- a/src/mesa/tnl/t_imm_dlist.c
+++ b/src/mesa/tnl/t_imm_dlist.c
@@ -597,7 +597,7 @@ loopback_compiled_cassette( GLcontext *ctx, struct immediate *IM )
vertex = (void (GLAPIENTRY *)(const GLfloat *)) glVertex3fv;
if (orflag & VERT_BITS_TEX_ANY) {
- for (j = 0 ; j < ctx->Const.MaxTextureUnits ; j++) {
+ for (j = 0 ; j < ctx->Const.MaxTextureCoordUnits ; j++) {
if (orflag & VERT_BIT_TEX(j)) {
maxtex = j+1;
if ((IM->TexSize & TEX_SIZE_4(j)) == TEX_SIZE_4(j))
diff --git a/src/mesa/tnl/t_imm_elt.c b/src/mesa/tnl/t_imm_elt.c
index 74958649c5a..08b74a139b3 100644
--- a/src/mesa/tnl/t_imm_elt.c
+++ b/src/mesa/tnl/t_imm_elt.c
@@ -855,7 +855,7 @@ void _tnl_translate_array_elts( GLcontext *ctx, struct immediate *IM,
if (translateConventional & VERT_BITS_TEX_ANY) {
GLuint i;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
if (translateConventional & VERT_BIT_TEX(i)) {
_tnl_trans_elt_4f( IM->Attrib[VERT_ATTRIB_TEX0 + i],
&ctx->Array.TexCoord[i],
diff --git a/src/mesa/tnl/t_imm_exec.c b/src/mesa/tnl/t_imm_exec.c
index a50922330f0..4cf95bb896a 100644
--- a/src/mesa/tnl/t_imm_exec.c
+++ b/src/mesa/tnl/t_imm_exec.c
@@ -1,5 +1,3 @@
-/* $Id: t_imm_exec.c,v 1.46 2003/04/08 02:27:20 brianp Exp $ */
-
/*
* Mesa 3-D graphics library
* Version: 5.1
@@ -166,7 +164,7 @@ void _tnl_copy_to_current( GLcontext *ctx, struct immediate *IM,
if (flag & VERT_BITS_TEX_ANY) {
GLuint i;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) {
if (flag & VERT_BIT_TEX(i)) {
COPY_4FV( ctx->Current.Attrib[VERT_ATTRIB_TEX0 + i],
IM->Attrib[VERT_ATTRIB_TEX0 + i][count]);
@@ -344,7 +342,7 @@ static void _tnl_vb_bind_immediate( GLcontext *ctx, struct immediate *IM )
if (inputs & VERT_BITS_TEX_ANY) {
GLuint i;
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
VB->TexCoordPtr[i] = NULL;
if (inputs & VERT_BIT_TEX(i)) {
tmp->TexCoord[i].count = count;
@@ -569,7 +567,7 @@ void _tnl_imm_init( GLcontext *ctx )
_mesa_vector1ui_init( &tmp->Index, 0, 0 );
_mesa_vector1ub_init( &tmp->EdgeFlag, 0, 0 );
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
+ for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++)
_mesa_vector4f_init( &tmp->TexCoord[i], 0, 0);
/* Install the first immediate. Intially outside begin/end.
diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c
index 9a954bf4851..22cb07edf30 100644
--- a/src/mesa/tnl/t_vb_texgen.c
+++ b/src/mesa/tnl/t_vb_texgen.c
@@ -1,5 +1,3 @@
-/* $Id: t_vb_texgen.c,v 1.19 2003/03/31 16:48:35 brianp Exp $ */
-
/*
* Mesa 3-D graphics library
* Version: 5.1
@@ -527,7 +525,7 @@ static GLboolean run_texgen_stage( GLcontext *ctx,
struct texgen_stage_data *store = TEXGEN_STAGE_DATA( stage );
GLuint i;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
if (ctx->Texture._TexGenEnabled & ENABLE_TEXGEN(i)) {
if (stage->changed_inputs & (VERT_BIT_EYE | VERT_BIT_NORMAL | VERT_BIT_TEX(i)))
store->TexgenFunc[i]( ctx, store, i );
@@ -547,7 +545,7 @@ static GLboolean run_validate_texgen_stage( GLcontext *ctx,
struct texgen_stage_data *store = TEXGEN_STAGE_DATA(stage);
GLuint i;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) {
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++) {
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
if (texUnit->TexGenEnabled) {
@@ -604,7 +602,7 @@ static void check_texgen( GLcontext *ctx, struct gl_pipeline_stage *stage )
if (ctx->Texture._GenFlags & TEXGEN_NEED_NORMALS)
inputs |= VERT_BIT_NORMAL;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
if (ctx->Texture._TexGenEnabled & ENABLE_TEXGEN(i))
{
outputs |= VERT_BIT_TEX(i);
@@ -642,7 +640,7 @@ static GLboolean alloc_texgen_data( GLcontext *ctx,
if (!store)
return GL_FALSE;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
_mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
store->tmp_f = (GLfloat (*)[3]) MALLOC(VB->Size * sizeof(GLfloat) * 3);
diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c
index b92eaae53f2..3d5c43dd637 100644
--- a/src/mesa/tnl/t_vb_texmat.c
+++ b/src/mesa/tnl/t_vb_texmat.c
@@ -1,10 +1,8 @@
-/* $Id: t_vb_texmat.c,v 1.12 2003/03/01 01:50:28 brianp Exp $ */
-
/*
* Mesa 3-D graphics library
* Version: 5.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -62,7 +60,7 @@ static void check_texmat( GLcontext *ctx, struct gl_pipeline_stage *stage )
if (ctx->Texture._TexMatEnabled && !ctx->VertexProgram.Enabled) {
GLuint flags = 0;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i))
flags |= VERT_BIT_TEX(i);
@@ -82,7 +80,7 @@ static GLboolean run_texmat_stage( GLcontext *ctx,
/* ENABLE_TEXMAT implies that the texture matrix is not the
* identity, so we don't have to check that here.
*/
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
if (ctx->Texture._TexMatEnabled & ENABLE_TEXMAT(i)) {
if (stage->changed_inputs & VERT_BIT_TEX(i))
(void) TransformRaw( &store->texcoord[i],
@@ -109,7 +107,7 @@ static GLboolean alloc_texmat_data( GLcontext *ctx,
if (!store)
return GL_FALSE;
- for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
+ for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
_mesa_vector4f_alloc( &store->texcoord[i], 0, VB->Size, 32 );
/* Now run the stage.