From: Brian Date: Tue, 10 Jul 2007 17:03:51 +0000 (-0600) Subject: Comments, minor clean-up. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=17b86cfa4e9403b2d887d832556dc4f1a1271ce0;p=mesa.git Comments, minor clean-up. --- diff --git a/src/mesa/pipe/softpipe/sp_state_derived.c b/src/mesa/pipe/softpipe/sp_state_derived.c index dd8a490f3b5..429ae55397e 100644 --- a/src/mesa/pipe/softpipe/sp_state_derived.c +++ b/src/mesa/pipe/softpipe/sp_state_derived.c @@ -36,18 +36,18 @@ #include "sp_state.h" -#define EMIT_ATTR( ATTR, FRAG_ATTR, INTERP ) \ -do { \ - slot_to_vf_attr[softpipe->nr_attrs] = ATTR; \ - softpipe->vf_attr_to_slot[ATTR] = softpipe->nr_attrs; \ +#define EMIT_ATTR( VF_ATTR, FRAG_ATTR, INTERP ) \ +do { \ + slot_to_vf_attr[softpipe->nr_attrs] = VF_ATTR; \ + softpipe->vf_attr_to_slot[VF_ATTR] = softpipe->nr_attrs; \ softpipe->fp_attr_to_slot[FRAG_ATTR] = softpipe->nr_attrs; \ - softpipe->interp[softpipe->nr_attrs] = INTERP; \ - softpipe->nr_attrs++; \ - attr_mask |= (1<interp[softpipe->nr_attrs] = INTERP; \ + softpipe->nr_attrs++; \ + attr_mask |= (1 << (VF_ATTR)); \ } while (0) -static GLuint frag_to_vf[FRAG_ATTRIB_MAX] = +static const GLuint frag_to_vf[FRAG_ATTRIB_MAX] = { VF_ATTRIB_POS, VF_ATTRIB_COLOR0, @@ -71,7 +71,7 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) struct gl_fragment_program *fp = softpipe->fs.fp; const GLuint inputsRead = fp->Base.InputsRead; GLuint slot_to_vf_attr[VF_ATTRIB_MAX]; - GLuint attr_mask = 0; + GLbitfield attr_mask = 0x0; GLuint i; softpipe->nr_attrs = 0; @@ -116,6 +116,9 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) } } + /* If the attributes have changed, tell the draw module (which in turn + * tells the vf module) about the new vertex layout. + */ if (attr_mask != softpipe->attr_mask) { softpipe->attr_mask = attr_mask;