[Mesa-dev] [PATCH V2 07/15] mesa: add is_indirect to _mesa_prim
Paul Berry
stereotype441 at gmail.com
Thu Nov 7 11:30:00 PST 2013
On 6 November 2013 23:06, Chris Forbes <chrisf at ijw.co.nz> wrote:
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
> src/mesa/vbo/vbo.h | 3 ++-
> src/mesa/vbo/vbo_exec_array.c | 5 +++++
> 2 files changed, 7 insertions(+), 1 deletion(-)
>
It looks to me like you forgot to update the code in the following
functions set is_indirect to 0:
- vbo_exec_Begin()
- _save_wrap_buffers()
- vbo_save_NotifyBegin()
(Unless there's some code I'm not seeing that memsets the prim data
structure to 0).
With that fixed, this patch is:
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
For completeness we might want to also update these functions, but it's not
strictly necessary because they memset the prim data structure to 0:
- vbo_validated_multidrawelements()
- vbo_draw_transform_feedback()
- vbo_draw_arrays()
>
> diff --git a/src/mesa/vbo/vbo.h b/src/mesa/vbo/vbo.h
> index 113374a..942b34a 100644
> --- a/src/mesa/vbo/vbo.h
> +++ b/src/mesa/vbo/vbo.h
> @@ -46,7 +46,8 @@ 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;
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 7aa0ad2..40c435d 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -965,6 +965,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;
> @@ -1578,6 +1579,7 @@ vbo_validated_drawarraysindirect(struct gl_context
> *ctx,
> prim[0].begin = 1;
> prim[0].end = 1;
> prim[0].mode = mode;
> + prim[0].is_indirect = 1;
> prim[0].indirect_offset = (GLsizeiptr)indirect;
>
> /* NOTE: We do NOT want to handle primitive restart here, nor perform
> any
> @@ -1623,6 +1625,7 @@ vbo_validated_multidrawarraysindirect(struct
> gl_context *ctx,
> for (i = 0; i < primcount; ++i, offset += stride) {
> prim[i].mode = mode;
> prim[i].indirect_offset = offset;
> + prim[i].is_indirect = 1;
> }
>
> check_buffers_are_unmapped(exec->array.inputs);
> @@ -1660,6 +1663,7 @@ vbo_validated_drawelementsindirect(struct gl_context
> *ctx,
> prim[0].mode = mode;
> prim[0].indexed = 1;
> prim[0].indirect_offset = (GLsizeiptr)indirect;
> + prim[0].is_indirect = 1;
>
> check_buffers_are_unmapped(exec->array.inputs);
> vbo->draw_prims(ctx, prim, 1,
> @@ -1708,6 +1712,7 @@ vbo_validated_multidrawelementsindirect(struct
> gl_context *ctx,
> prim[i].mode = mode;
> prim[i].indexed = 1;
> prim[i].indirect_offset = offset;
> + prim[i].is_indirect = 1;
> }
>
> check_buffers_are_unmapped(exec->array.inputs);
> --
> 1.8.4.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20131107/9cc025bd/attachment-0001.html>
More information about the mesa-dev
mailing list