From: Marek Olšák Date: Wed, 19 Feb 2020 21:54:45 +0000 (-0500) Subject: glthread: add GL_DRAW_INDIRECT_BUFFER tracking and generator support X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fb95a4693f05b8a64d61267409fcdce937dd3383;p=mesa.git glthread: add GL_DRAW_INDIRECT_BUFFER tracking and generator support Reviewed-by: Timothy Arceri Part-of: --- diff --git a/src/mapi/glapi/gen/marshal_XML.py b/src/mapi/glapi/gen/marshal_XML.py index d761e58ce83..5b682c51965 100644 --- a/src/mapi/glapi/gen/marshal_XML.py +++ b/src/mapi/glapi/gen/marshal_XML.py @@ -77,7 +77,9 @@ class marshal_function(gl_XML.gl_function): for p in self.parameters: if p.is_output: return 'sync' - if p.is_pointer() and not (p.count or p.counter) and not (self.marshal == 'draw' and p.name == 'indices'): + if (p.is_pointer() and not (p.count or p.counter) + and not (self.marshal == 'draw' + and (p.name == 'indices' or p.name == 'indirect'))): return 'sync' if p.count_parameter_list: # Parameter size is determined by enums; haven't diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h index 021d5213084..5e99602b418 100644 --- a/src/mesa/main/glthread.h +++ b/src/mesa/main/glthread.h @@ -94,6 +94,7 @@ struct glthread_state * buffer) binding is in a VBO. */ bool element_array_is_vbo; + bool draw_indirect_buffer_is_vbo; }; void _mesa_glthread_init(struct gl_context *ctx); diff --git a/src/mesa/main/marshal.c b/src/mesa/main/marshal.c index 28054d236c9..24e419ca337 100644 --- a/src/mesa/main/marshal.c +++ b/src/mesa/main/marshal.c @@ -252,6 +252,9 @@ track_vbo_binding(struct gl_context *ctx, GLenum target, GLuint buffer) */ glthread->element_array_is_vbo = (buffer != 0); break; + case GL_DRAW_INDIRECT_BUFFER: + glthread->draw_indirect_buffer_is_vbo = buffer != 0; + break; } } diff --git a/src/mesa/main/marshal.h b/src/mesa/main/marshal.h index c15253f3973..a172ed30043 100644 --- a/src/mesa/main/marshal.h +++ b/src/mesa/main/marshal.h @@ -98,6 +98,25 @@ _mesa_glthread_is_non_vbo_draw_elements(const struct gl_context *ctx) return ctx->API != API_OPENGL_CORE && !glthread->element_array_is_vbo; } +static inline bool +_mesa_glthread_is_non_vbo_draw_arrays_indirect(const struct gl_context *ctx) +{ + struct glthread_state *glthread = ctx->GLThread; + + return ctx->API != API_OPENGL_CORE && + !glthread->draw_indirect_buffer_is_vbo; +} + +static inline bool +_mesa_glthread_is_non_vbo_draw_elements_indirect(const struct gl_context *ctx) +{ + struct glthread_state *glthread = ctx->GLThread; + + return ctx->API != API_OPENGL_CORE && + (!glthread->draw_indirect_buffer_is_vbo || + !glthread->element_array_is_vbo); +} + #define DEBUG_MARSHAL_PRINT_CALLS 0 /**