summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200/r200_cmdbuf.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2004-05-27 16:56:47 +0000
committerRoland Scheidegger <[email protected]>2004-05-27 16:56:47 +0000
commitaaaf38d37215aa1536ff34ec370ecfc04111af22 (patch)
tree3eafbe589892dbc2e1525fa722704e432f6e0623 /src/mesa/drivers/dri/r200/r200_cmdbuf.c
parentd44e9e39da2663bc2fc610ba1a117ac3ea0b4c8a (diff)
change some explicit references to texture units 0/1 to unit < MaxTextureUnits (Andreas Stenglein, Ronny Vindenes)
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_cmdbuf.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_cmdbuf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c
index edea2df5721..26812d50b62 100644
--- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c
+++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c
@@ -63,7 +63,7 @@ static void r200_emit_state_list( r200ContextPtr rmesa,
{
struct r200_state_atom *state, *tmp;
char *dest;
- int i, size;
+ int i, size, mtu;
size = 0;
foreach_s( state, tmp, list ) {
@@ -84,6 +84,7 @@ static void r200_emit_state_list( r200ContextPtr rmesa,
return;
dest = r200AllocCmdBuf( rmesa, size * 4, __FUNCTION__);
+ mtu = rmesa->glCtx->Const.MaxTextureUnits;
#define EMIT_ATOM(ATOM) \
do { \
@@ -112,13 +113,13 @@ do { \
EMIT_ATOM (fog);
EMIT_ATOM (tam);
EMIT_ATOM (tf);
- for (i = 0; i < 2; ++i) {
+ for (i = 0; i < mtu; ++i) {
EMIT_ATOM (tex[i]);
}
- for (i = 0; i < 2; ++i) {
+ for (i = 0; i < mtu; ++i) {
EMIT_ATOM (cube[i]);
}
- for (i = 0; i < 5; ++i)
+ for (i = 0; i < 3 + mtu; ++i)
EMIT_ATOM (mat[i]);
EMIT_ATOM (eye);
EMIT_ATOM (glt);