glthread: add GL_DRAW_INDIRECT_BUFFER tracking and generator support
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
This commit is contained in:
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user