summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-07-24 15:39:41 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-07-24 15:39:41 -0600
commit496ee38b7130c55cbdddb1456f8ad618897bd711 (patch)
treedaba733f3eb75bda87712341d01868d29362a05b
parent5c2cff44d22c09e018a4b43a51cf6781ce4ca5b9 (diff)
Add VF_ATTRIB_VAR0..7 for varying variables.
The demos/fslight.c demo runs now.
-rw-r--r--src/mesa/pipe/softpipe/sp_state_derived.c10
-rw-r--r--src/mesa/vf/vf.h20
2 files changed, 24 insertions, 6 deletions
diff --git a/src/mesa/pipe/softpipe/sp_state_derived.c b/src/mesa/pipe/softpipe/sp_state_derived.c
index 84a1ec79f8..26083c2962 100644
--- a/src/mesa/pipe/softpipe/sp_state_derived.c
+++ b/src/mesa/pipe/softpipe/sp_state_derived.c
@@ -60,6 +60,14 @@ static const GLuint frag_to_vf[FRAG_ATTRIB_MAX] =
VF_ATTRIB_TEX5,
VF_ATTRIB_TEX6,
VF_ATTRIB_TEX7,
+ VF_ATTRIB_VAR0,
+ VF_ATTRIB_VAR1,
+ VF_ATTRIB_VAR2,
+ VF_ATTRIB_VAR3,
+ VF_ATTRIB_VAR4,
+ VF_ATTRIB_VAR5,
+ VF_ATTRIB_VAR6,
+ VF_ATTRIB_VAR7,
};
@@ -109,6 +117,7 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
*/
for (i = 1; i < FRAG_ATTRIB_TEX0; i++) {
if (inputsRead & (1 << i)) {
+ assert(i < sizeof(frag_to_vf) / sizeof(frag_to_vf[0]));
if (softpipe->setup.flatshade
&& (i == FRAG_ATTRIB_COL0 || i == FRAG_ATTRIB_COL1))
EMIT_ATTR(frag_to_vf[i], i, INTERP_CONSTANT);
@@ -119,6 +128,7 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
for (i = FRAG_ATTRIB_TEX0; i < FRAG_ATTRIB_MAX; i++) {
if (inputsRead & (1 << i)) {
+ assert(i < sizeof(frag_to_vf) / sizeof(frag_to_vf[0]));
EMIT_ATTR(frag_to_vf[i], i, INTERP_PERSPECTIVE);
softpipe->need_w = GL_TRUE;
}
diff --git a/src/mesa/vf/vf.h b/src/mesa/vf/vf.h
index fcbf490ce1..fc988b9fb9 100644
--- a/src/mesa/vf/vf.h
+++ b/src/mesa/vf/vf.h
@@ -48,12 +48,20 @@ enum {
VF_ATTRIB_TEX5 = 13,
VF_ATTRIB_TEX6 = 14,
VF_ATTRIB_TEX7 = 15,
- VF_ATTRIB_POINTSIZE = 16,
- VF_ATTRIB_BFC0 = 17,
- VF_ATTRIB_BFC1 = 18,
- VF_ATTRIB_CLIP_POS = 19,
- VF_ATTRIB_VERTEX_HEADER = 20,
- VF_ATTRIB_MAX = 21
+ VF_ATTRIB_VAR0 = 16,
+ VF_ATTRIB_VAR1 = 17,
+ VF_ATTRIB_VAR2 = 18,
+ VF_ATTRIB_VAR3 = 19,
+ VF_ATTRIB_VAR4 = 20,
+ VF_ATTRIB_VAR5 = 21,
+ VF_ATTRIB_VAR6 = 22,
+ VF_ATTRIB_VAR7 = 23,
+ VF_ATTRIB_POINTSIZE = 24,
+ VF_ATTRIB_BFC0 = 25,
+ VF_ATTRIB_BFC1 = 26,
+ VF_ATTRIB_CLIP_POS = 27,
+ VF_ATTRIB_VERTEX_HEADER = 28,
+ VF_ATTRIB_MAX = 29
};