From 0bdf216dd06d5136b8529297297aa962bab548c2 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 23 Apr 2007 21:21:52 -0600 Subject: Improve the code for interpolating fragment attributes a little. More to come... --- src/mesa/swrast/s_context.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/mesa/swrast/s_context.h') diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index dfe311a40b..c8333b8e0a 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -138,12 +138,10 @@ typedef struct GLbitfield _ColorOutputsMask; GLuint _NumColorOutputs; - /** Fragment attributes to compute during rasterization. - * Mask of FRAG_BIT_* flags. - */ - GLbitfield _FragmentAttribs; - GLuint _MinFragmentAttrib; /**< Lowest bit set in _FragmentAttribs */ - GLuint _MaxFragmentAttrib; /**< Highest bit set in _FragmentAttribs + 1 */ + /** List/array of the fragment attributes to interpolate */ + GLuint _ActiveAttribs[FRAG_ATTRIB_MAX]; + /** Number of fragment attributes to interpolate */ + GLuint _NumActiveAttribs; /* Accum buffer temporaries. */ @@ -277,4 +275,19 @@ _swrast_update_texture_samplers(GLcontext *ctx); #define FixedToChan(X) FixedToInt(X) #endif + +/** + * For looping over fragment attributes in the pointe, line + * triangle rasterizers. + */ +#define ATTRIB_LOOP_BEGIN \ + { \ + GLuint a; \ + for (a = 0; a < swrast->_NumActiveAttribs; a++) { \ + const GLuint attr = swrast->_ActiveAttribs[a]; + +#define ATTRIB_LOOP_END } } + + + #endif -- cgit v1.2.3