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/tnl/t_vb_arbshader.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/tnl/t_vb_arbshader.c')
-rw-r--r-- | src/mesa/tnl/t_vb_arbshader.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_vb_arbshader.c b/src/mesa/tnl/t_vb_arbshader.c index 88d7f6ac8cc..b1d024e0cca 100644 --- a/src/mesa/tnl/t_vb_arbshader.c +++ b/src/mesa/tnl/t_vb_arbshader.c @@ -37,6 +37,7 @@ typedef struct
{
GLvector4f outputs[VERT_RESULT_MAX];
+ GLvector4f varyings[MAX_VARYING_VECTORS];
GLvector4f ndc_coords;
GLubyte *clipmask;
GLubyte ormask;
@@ -63,6 +64,11 @@ static GLboolean construct_arb_vertex_shader (GLcontext *ctx, struct tnl_pipelin _mesa_vector4f_alloc (&store->outputs[i], 0, size, 32);
store->outputs[i].size = 4;
}
+ for (i = 0; i < MAX_VARYING_VECTORS; i++)
+ {
+ _mesa_vector4f_alloc (&store->varyings[i], 0, size, 32);
+ store->varyings[i].size = 4;
+ }
_mesa_vector4f_alloc (&store->ndc_coords, 0, size, 32);
store->clipmask = (GLubyte *) ALIGN_MALLOC (size, 32);
@@ -79,6 +85,8 @@ static void destruct_arb_vertex_shader (struct tnl_pipeline_stage *stage) for (i = 0; i < VERT_RESULT_MAX; i++)
_mesa_vector4f_free (&store->outputs[i]);
+ for (i = 0; i < MAX_VARYING_VECTORS; i++)
+ _mesa_vector4f_free (&store->varyings[i]);
_mesa_vector4f_free (&store->ndc_coords);
ALIGN_FREE (store->clipmask);
@@ -206,6 +214,17 @@ static GLboolean run_arb_vertex_shader (GLcontext *ctx, struct tnl_pipeline_stag fetch_output_vec4 (pro, SLANG_VERTEX_FIXED_BACKCOLOR, VERT_RESULT_BFC0, i, 0, store);
fetch_output_vec4 (pro, SLANG_VERTEX_FIXED_BACKSECONDARYCOLOR, VERT_RESULT_BFC1, i, 0, store);
/* XXX: fetch output SLANG_VERTEX_FIXED_CLIPVERTEX */
+
+ for (j = 0; j < MAX_VARYING_VECTORS; j++)
+ {
+ GLuint k;
+
+ for (k = 0; k < VARYINGS_PER_VECTOR; k++)
+ {
+ (**pro).UpdateVarying (pro, j * VARYINGS_PER_VECTOR + k,
+ &store->varyings[j].data[i][k], GL_TRUE);
+ }
+ }
}
vb->ClipPtr = &store->outputs[VERT_RESULT_HPOS];
@@ -218,6 +237,8 @@ static GLboolean run_arb_vertex_shader (GLcontext *ctx, struct tnl_pipeline_stag vb->SecondaryColorPtr[1] = &store->outputs[VERT_RESULT_BFC1];
vb->FogCoordPtr = &store->outputs[VERT_RESULT_FOGC];
vb->PointSizePtr = &store->outputs[VERT_RESULT_PSIZ];
+ for (i = 0; i < MAX_VARYING_VECTORS; i++)
+ vb->VaryingPtr[i] = &store->varyings[i];
vb->AttribPtr[VERT_ATTRIB_COLOR0] = vb->ColorPtr[0];
vb->AttribPtr[VERT_ATTRIB_COLOR1] = vb->SecondaryColorPtr[0];
@@ -225,6 +246,8 @@ static GLboolean run_arb_vertex_shader (GLcontext *ctx, struct tnl_pipeline_stag for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
vb->AttribPtr[VERT_ATTRIB_TEX0 + i] = vb->TexCoordPtr[i];
vb->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->outputs[VERT_RESULT_PSIZ];
+ for (i = 0; i < MAX_VARYING_VECTORS; i++)
+ vb->AttribPtr[_TNL_ATTRIB_ATTRIBUTE0 + i] = vb->VaryingPtr[i];
store->ormask = 0;
store->andmask = CLIP_FRUSTUM_BITS;
|