summaryrefslogtreecommitdiffstats
path: root/src/mesa/vbo/vbo_exec.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2006-10-30 16:44:13 +0000
committerKeith Whitwell <[email protected]>2006-10-30 16:44:13 +0000
commit99efde461d3b8615863bdb7308e05289e0db0422 (patch)
tree95b9e3f4f612957a93547892f3559cfaa44dccb7 /src/mesa/vbo/vbo_exec.c
parentefef291dc71eb57f90785a26957f4b3e01733156 (diff)
better handling of current attributes. Trivial dlist and varray tests work
Diffstat (limited to 'src/mesa/vbo/vbo_exec.c')
-rw-r--r--src/mesa/vbo/vbo_exec.c117
1 files changed, 0 insertions, 117 deletions
diff --git a/src/mesa/vbo/vbo_exec.c b/src/mesa/vbo/vbo_exec.c
index 4499803b8c7..270e5201d35 100644
--- a/src/mesa/vbo/vbo_exec.c
+++ b/src/mesa/vbo/vbo_exec.c
@@ -38,119 +38,6 @@
#include "vbo_context.h"
-#define NR_LEGACY_ATTRIBS 16
-#define NR_GENERIC_ATTRIBS 16
-#define NR_MAT_ATTRIBS 12
-
-static void init_legacy_currval(GLcontext *ctx)
-{
- struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
- struct gl_client_array *arrays = exec->legacy_currval;
- GLuint i;
-
- memset(arrays, 0, sizeof(*arrays) * NR_LEGACY_ATTRIBS);
-
- /* Set up a constant (StrideB == 0) array for each current
- * attribute:
- */
- for (i = 0; i < NR_LEGACY_ATTRIBS; i++) {
- struct gl_client_array *cl = &arrays[i];
-
- switch (i) {
- case VBO_ATTRIB_EDGEFLAG:
- cl->Type = GL_UNSIGNED_BYTE;
- cl->Ptr = (const void *)&ctx->Current.EdgeFlag;
- break;
- case VBO_ATTRIB_INDEX:
- cl->Type = GL_FLOAT;
- cl->Ptr = (const void *)&ctx->Current.Index;
- break;
- default:
- cl->Type = GL_FLOAT;
- cl->Ptr = (const void *)ctx->Current.Attrib[i];
- break;
- }
-
- /* This will have to be determined at runtime:
- */
- cl->Size = 1;
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Enabled = 1;
- cl->BufferObj = ctx->Array.NullBufferObj;
- }
-}
-
-
-static void init_generic_currval(GLcontext *ctx)
-{
- struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
- struct gl_client_array *arrays = exec->generic_currval;
- GLuint i;
-
- memset(arrays, 0, sizeof(*arrays) * NR_GENERIC_ATTRIBS);
-
- for (i = 0; i < NR_GENERIC_ATTRIBS; i++) {
- struct gl_client_array *cl = &arrays[i];
-
- /* This will have to be determined at runtime:
- */
- cl->Size = 1;
-
- cl->Type = GL_FLOAT;
- cl->Ptr = (const void *)ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + i];
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Enabled = 1;
- cl->BufferObj = ctx->Array.NullBufferObj;
- }
-}
-
-
-static void init_mat_currval(GLcontext *ctx)
-{
- struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
- struct gl_client_array *arrays = exec->mat_currval;
- GLuint i;
-
- memset(arrays, 0, sizeof(*arrays) * NR_GENERIC_ATTRIBS);
-
- /* Set up a constant (StrideB == 0) array for each current
- * attribute:
- */
- for (i = 0; i < NR_GENERIC_ATTRIBS; i++) {
- struct gl_client_array *cl = &arrays[i];
-
- /* Size is fixed for the material attributes, for others will
- * be determined at runtime:
- */
- switch (i - VERT_ATTRIB_GENERIC0) {
- case MAT_ATTRIB_FRONT_SHININESS:
- case MAT_ATTRIB_BACK_SHININESS:
- cl->Size = 1;
- break;
- case MAT_ATTRIB_FRONT_INDEXES:
- case MAT_ATTRIB_BACK_INDEXES:
- cl->Size = 3;
- break;
- default:
- cl->Size = 4;
- break;
- }
-
- if (i < MAT_ATTRIB_MAX)
- cl->Ptr = (const void *)ctx->Light.Material.Attrib[i];
- else
- cl->Ptr = (const void *)ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + i];
-
- cl->Type = GL_FLOAT;
- cl->Stride = 0;
- cl->StrideB = 0;
- cl->Enabled = 1;
- cl->BufferObj = ctx->Array.NullBufferObj;
- }
-}
-
void vbo_exec_init( GLcontext *ctx )
{
@@ -167,10 +54,6 @@ void vbo_exec_init( GLcontext *ctx )
vbo_exec_vtx_init( exec );
vbo_exec_array_init( exec );
- init_legacy_currval( ctx );
- init_generic_currval( ctx );
- init_mat_currval( ctx );
-
ctx->Driver.NeedFlush = 0;
ctx->Driver.CurrentExecPrimitive = PRIM_OUTSIDE_BEGIN_END;
ctx->Driver.FlushVertices = vbo_exec_FlushVertices;