diff options
author | Chris Forbes <[email protected]> | 2013-11-16 16:38:57 +1300 |
---|---|---|
committer | Chris Forbes <[email protected]> | 2013-11-25 22:01:35 +1300 |
commit | aadbb0f275cb2df2ec082c1f06d682f4eb96c63a (patch) | |
tree | 469659e26c1616baebc9ea1bb6c074c88313aab2 /src | |
parent | 36046ae2789f74c04e6b62fa5250d81e8d1160eb (diff) |
mesa: add indirect_offset, is_indirect to _mesa_prim
V3: Add missing cases
V4: Add indirect_offset here too
Signed-off-by: Chris Forbes <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/vbo/vbo.h | 5 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_exec_api.c | 1 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_exec_array.c | 5 | ||||
-rw-r--r-- | src/mesa/vbo/vbo_save_api.c | 2 |
4 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h index 827917fc37f..f58fa0b3399 100644 --- a/src/mesa/vbo/vbo.h +++ b/src/mesa/vbo/vbo.h @@ -46,13 +46,16 @@ struct _mesa_prim { GLuint end:1; GLuint weak:1; GLuint no_current_update:1; - GLuint pad:19; + GLuint is_indirect:1; + GLuint pad:18; GLuint start; GLuint count; GLint basevertex; GLuint num_instances; GLuint base_instance; + + GLsizeiptr indirect_offset; }; /* Would like to call this a "vbo_index_buffer", but this would be diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 600398c5891..c84d97f56f1 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -702,6 +702,7 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) exec->vtx.prim[i].count = 0; exec->vtx.prim[i].num_instances = 1; exec->vtx.prim[i].base_instance = 0; + exec->vtx.prim[i].is_indirect = 0; ctx->Driver.CurrentExecPrimitive = mode; diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 303e87f779c..e85a0aa7512 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -611,6 +611,7 @@ vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, prim[0].mode = mode; prim[0].num_instances = numInstances; prim[0].base_instance = baseInstance; + prim[0].is_indirect = 0; /* Implement the primitive restart index */ if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex < count) { @@ -965,6 +966,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, prim[0].start = 0; prim[0].count = count; prim[0].indexed = 1; + prim[0].is_indirect = 0; prim[0].basevertex = basevertex; prim[0].num_instances = numInstances; prim[0].base_instance = baseInstance; @@ -1368,6 +1370,7 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode, prim[i].indexed = 1; prim[i].num_instances = 1; prim[i].base_instance = 0; + prim[i].is_indirect = 0; if (basevertex != NULL) prim[i].basevertex = basevertex[i]; else @@ -1397,6 +1400,7 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode, prim[0].indexed = 1; prim[0].num_instances = 1; prim[0].base_instance = 0; + prim[0].is_indirect = 0; if (basevertex != NULL) prim[0].basevertex = basevertex[i]; else @@ -1483,6 +1487,7 @@ vbo_draw_transform_feedback(struct gl_context *ctx, GLenum mode, prim[0].mode = mode; prim[0].num_instances = numInstances; prim[0].base_instance = 0; + prim[0].is_indirect = 0; /* Maybe we should do some primitive splitting for primitive restart * (like in DrawArrays), but we have no way to know how many vertices diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 411c0060480..d16405efc40 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -531,6 +531,7 @@ _save_wrap_buffers(struct gl_context *ctx) save->prim[0].count = 0; save->prim[0].num_instances = 1; save->prim[0].base_instance = 0; + save->prim[0].is_indirect = 0; save->prim_count = 1; } @@ -986,6 +987,7 @@ vbo_save_NotifyBegin(struct gl_context *ctx, GLenum mode) save->prim[i].count = 0; save->prim[i].num_instances = 1; save->prim[i].base_instance = 0; + save->prim[i].is_indirect = 0; if (save->out_of_memory) { _mesa_install_save_vtxfmt(ctx, &save->vtxfmt_noop); |