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/main/state.c | |
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/main/state.c')
-rw-r--r-- | src/mesa/main/state.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 7e452bdfd7f..761a45f2bd8 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); } |