From bb38cadb1c5f2dc13096a091bdaf61dc3e3cfa4d Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 11 Apr 2006 11:41:11 +0000 Subject: 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; --- src/mesa/main/state.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/mesa/main/state.c') diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 7e452bdfd7..761a45f2bd 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -820,7 +820,11 @@ update_arrays( GLcontext *ctx ) /* find min of _MaxElement values for all enabled arrays */ /* 0 */ - if (ctx->VertexProgram._Enabled + if (ctx->ShaderObjects._VertexShaderPresent + && ctx->Array.VertexAttrib[VERT_ATTRIB_GENERIC0].Enabled) { + min = ctx->Array.VertexAttrib[VERT_ATTRIB_GENERIC0]._MaxElement; + } + else if (ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Enabled) { min = ctx->Array.VertexAttrib[VERT_ATTRIB_POS]._MaxElement; } @@ -888,7 +892,7 @@ update_arrays( GLcontext *ctx ) } /* 8..15 */ - for (i = VERT_ATTRIB_TEX0; i < VERT_ATTRIB_MAX; i++) { + for (i = VERT_ATTRIB_TEX0; i <= VERT_ATTRIB_TEX7; i++) { if (ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[i].Enabled) { min = MIN2(min, ctx->Array.VertexAttrib[i]._MaxElement); @@ -899,6 +903,15 @@ update_arrays( GLcontext *ctx ) } } + /* 16..31 */ + if (ctx->ShaderObjects._VertexShaderPresent) { + for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) { + if (ctx->Array.VertexAttrib[i].Enabled) { + min = MIN2(min, ctx->Array.VertexAttrib[i]._MaxElement); + } + } + } + if (ctx->Array.Index.Enabled) { min = MIN2(min, ctx->Array.Index._MaxElement); } -- cgit v1.2.3