diff options
author | Michal Krol <[email protected]> | 2006-04-11 11:41:11 +0000 |
---|---|---|
committer | Michal Krol <[email protected]> | 2006-04-11 11:41:11 +0000 |
commit | bb38cadb1c5f2dc13096a091bdaf61dc3e3cfa4d (patch) | |
tree | 8474881f1f529e1217d3442a98defb1a667b8403 /src/mesa/drivers/dri/sis | |
parent | d90ad3fd876860b7a2ba763c031e46f76e4c47c6 (diff) |
More GLSL code:
- use macros to access and modify render inputs bit-field;
- un-alias generic vertex attributes for ARB vertex calls;
- use MAX_VERTEX_PROGRAM_ATTRIBS (NV code) or MAX_VERTEX_ATTRIBS
(ARB code) in place of VERT_ATTRIB_MAX;
- define VERT_ATTRIB_GENERIC0..15 for un-aliased vertex
attributes for ARB_vertex_shader;
- fix generic attribute index range check in arbprogparse.c;
- interface GLSL varyings between vertex and fragment shader;
- use 64-bit optimised bitset (bitset.h) for render inputs;
Diffstat (limited to 'src/mesa/drivers/dri/sis')
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_context.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_tris.c | 19 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_context.h b/src/mesa/drivers/dri/sis/sis_context.h index ead4a26678e..c349bf96ed2 100644 --- a/src/mesa/drivers/dri/sis/sis_context.h +++ b/src/mesa/drivers/dri/sis/sis_context.h @@ -332,7 +332,7 @@ struct sis_context GLint drawableID; GLint GlobalFlag; - GLuint last_tcl_state; + DECLARE_RENDERINPUTS(last_tcl_state_bitset); /* Stereo */ GLboolean useStereo; diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index 24f6cb9aa87..a0e39dcd3c9 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -842,10 +842,12 @@ static void sisRenderStart( GLcontext *ctx ) TNLcontext *tnl = TNL_CONTEXT(ctx); sisContextPtr smesa = SIS_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - GLuint index = tnl->render_inputs; + DECLARE_RENDERINPUTS(index_bitset); GLuint AGPParseSet = smesa->AGPParseSet; GLboolean tex_fallback = GL_FALSE; + RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); + if (ctx->DrawBuffer->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT && smesa->driDrawable->numClipRects != 0) { @@ -869,7 +871,7 @@ static void sisRenderStart( GLcontext *ctx ) AGPParseSet &= ~(MASK_VertexDWSize | MASK_VertexDataFormat); AGPParseSet |= SiS_PS_HAS_XYZ | SiS_PS_HAS_DIFFUSE; - if (index & _TNL_BITS_TEX_ANY) { + if (RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_FIRST_TEX, _TNL_LAST_TEX )) { EMIT_ATTR(_TNL_ATTRIB_POS, EMIT_4F_VIEWPORT); AGPParseSet |= SiS_PS_HAS_W; smesa->coloroffset = 4; @@ -881,17 +883,18 @@ static void sisRenderStart( GLcontext *ctx ) EMIT_ATTR(_TNL_ATTRIB_COLOR0, EMIT_4UB_4F_BGRA); smesa->specoffset = 0; - if (index & (_TNL_BIT_COLOR1|_TNL_BIT_FOG)) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 ) || + RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { AGPParseSet |= SiS_PS_HAS_SPECULAR; - if (index & _TNL_BIT_COLOR1) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_COLOR1 )) { EMIT_ATTR(_TNL_ATTRIB_COLOR1, EMIT_3UB_3F_BGR); smesa->specoffset = smesa->coloroffset + 1; } else { EMIT_PAD(3); } - if (index & _TNL_BIT_FOG) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_FOG )) { EMIT_ATTR(_TNL_ATTRIB_FOG, EMIT_1UB_1F); } else { EMIT_PAD(1); @@ -899,14 +902,14 @@ static void sisRenderStart( GLcontext *ctx ) } /* projective textures are not supported by the hardware */ - if (index & _TNL_BIT_TEX(0)) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 )) { if (VB->TexCoordPtr[0]->size > 2) tex_fallback = GL_TRUE; EMIT_ATTR(_TNL_ATTRIB_TEX0, EMIT_2F); AGPParseSet |= SiS_PS_HAS_UV0; } /* Will only hit tex1 on SiS300 */ - if (index & _TNL_BIT_TEX(1)) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 )) { if (VB->TexCoordPtr[1]->size > 2) tex_fallback = GL_TRUE; EMIT_ATTR(_TNL_ATTRIB_TEX1, EMIT_2F); @@ -914,7 +917,7 @@ static void sisRenderStart( GLcontext *ctx ) } FALLBACK(smesa, SIS_FALLBACK_TEXTURE, tex_fallback); - if (smesa->last_tcl_state != index) { + if (!RENDERINPUTS_EQUAL( smesa->last_tcl_state_bitset, index_bitset )) { smesa->AGPParseSet = AGPParseSet; smesa->vertex_size = _tnl_install_attrs( ctx, smesa->vertex_attrs, |