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;
This commit is contained in:
Michal Krol
2006-04-11 11:41:11 +00:00
parent d90ad3fd87
commit bb38cadb1c
39 changed files with 879 additions and 580 deletions

View File

@@ -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);
}