diff options
author | Brian Paul <[email protected]> | 2011-01-15 10:32:34 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-01-15 17:37:41 -0700 |
commit | 1d1eb9578716913f4133786b30c6e6edc69a8a0c (patch) | |
tree | 4ba7959743ab71b82b8d37b39d1759d6f7a19a54 /src/mesa/main/dlist.c | |
parent | 1250e2330b913d3e90bd0b28e46bf565a827b5bf (diff) |
mesa: support for GL_ARB_instanced_arrays
Diffstat (limited to 'src/mesa/main/dlist.c')
-rw-r--r-- | src/mesa/main/dlist.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 6c0c556ad8d..b28e36ac096 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -421,6 +421,9 @@ typedef enum OPCODE_ACTIVE_PROGRAM_EXT, OPCODE_USE_SHADER_PROGRAM_EXT, + /* GL_ARB_instanced_arrays */ + OPCODE_VERTEX_ATTRIB_DIVISOR, + /* The following three are meta instructions */ OPCODE_ERROR, /* raise compiled-in error */ OPCODE_CONTINUE, @@ -6927,6 +6930,22 @@ exec_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint *params) } +/* GL_ARB_instanced_arrays */ +static void +save_VertexAttribDivisor(GLuint index, GLuint divisor) +{ + GET_CURRENT_CONTEXT(ctx); + Node *n; + ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); + n = alloc_instruction(ctx, OPCODE_VERTEX_ATTRIB_DIVISOR, 2); + if (n) { + n[1].ui = index; + n[2].ui = divisor; + } + if (ctx->ExecuteFlag) { + CALL_VertexAttribDivisorARB(ctx->Exec, (index, divisor)); + } +} @@ -8080,6 +8099,11 @@ execute_list(struct gl_context *ctx, GLuint list) } break; + case OPCODE_VERTEX_ATTRIB_DIVISOR: + /* GL_ARB_instanced_arrays */ + CALL_VertexAttribDivisorARB(ctx->Exec, (n[1].ui, n[2].ui)); + break; + case OPCODE_CONTINUE: n = (Node *) n[1].next; break; @@ -9749,6 +9773,9 @@ _mesa_create_save_table(void) (void) save_Uniform4uiv; #endif + /* GL_ARB_instanced_arrays */ + SET_VertexAttribDivisorARB(table, save_VertexAttribDivisor); + return table; } |