aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/glthread.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-02-20 19:28:56 -0500
committerMarge Bot <[email protected]>2020-03-06 01:06:14 +0000
commit28a2ad7ddf76702a5de56a7bc0d8754b7dbd66a0 (patch)
tree15e77758d8169b01a7dc20761ca7c575f2994093 /src/mesa/main/glthread.h
parentd510e652d46f471a93eae5a07f7e7508633d1040 (diff)
glthread: track for each VAO whether the user has set a user pointer
This commit mainly adds basic infrastructure for tracking vertex array state. If glthread gets a non-VBO pointer, this commit delays disabling glthread until glDraw is called. The next will change that to "sync" instead of "disable". Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3948>
Diffstat (limited to 'src/mesa/main/glthread.h')
-rw-r--r--src/mesa/main/glthread.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h
index 5e99602b418..d4a680ab038 100644
--- a/src/mesa/main/glthread.h
+++ b/src/mesa/main/glthread.h
@@ -46,9 +46,17 @@
#include <inttypes.h>
#include <stdbool.h>
#include "util/u_queue.h"
+#include "GL/gl.h"
enum marshal_dispatch_cmd_id;
struct gl_context;
+struct _mesa_HashTable;
+
+struct glthread_vao {
+ GLuint Name;
+ bool HasUserPointer;
+ bool IndexBufferIsUserPointer;
+};
/** A single batch of commands queued up for execution. */
struct glthread_batch
@@ -83,6 +91,12 @@ struct glthread_state
/** Index of the batch being filled and about to be submitted. */
unsigned next;
+ /** Vertex Array objects tracked by glthread independently of Mesa. */
+ struct _mesa_HashTable *VAOs;
+ struct glthread_vao *CurrentVAO;
+ struct glthread_vao *LastLookedUpVAO;
+ struct glthread_vao DefaultVAO;
+
/**
* Tracks on the main thread side whether the current vertex array binding
* is in a VBO.
@@ -93,7 +107,6 @@ struct glthread_state
* Tracks on the main thread side whether the current element array (index
* buffer) binding is in a VBO.
*/
- bool element_array_is_vbo;
bool draw_indirect_buffer_is_vbo;
};
@@ -106,4 +119,11 @@ void _mesa_glthread_flush_batch(struct gl_context *ctx);
void _mesa_glthread_finish(struct gl_context *ctx);
void _mesa_glthread_finish_before(struct gl_context *ctx, const char *func);
+void _mesa_glthread_BindVertexArray(struct gl_context *ctx, GLuint id);
+void _mesa_glthread_DeleteVertexArrays(struct gl_context *ctx,
+ GLsizei n, const GLuint *ids);
+void _mesa_glthread_GenVertexArrays(struct gl_context *ctx,
+ GLsizei n, GLuint *arrays);
+void _mesa_glthread_AttribPointer(struct gl_context *ctx);
+
#endif /* _GLTHREAD_H*/