aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-02-19 16:54:45 -0500
committerMarge Bot <[email protected]>2020-03-06 01:06:14 +0000
commitfb95a4693f05b8a64d61267409fcdce937dd3383 (patch)
tree225457a3f9fffe53e18c2921a88226958127ffd3
parent30b6e8236400deac08aec6b0334f78b7eacb62d9 (diff)
glthread: add GL_DRAW_INDIRECT_BUFFER tracking and generator support
Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
-rw-r--r--src/mapi/glapi/gen/marshal_XML.py4
-rw-r--r--src/mesa/main/glthread.h1
-rw-r--r--src/mesa/main/marshal.c3
-rw-r--r--src/mesa/main/marshal.h19
4 files changed, 26 insertions, 1 deletions
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
/**