aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/glthread.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-03-05 21:50:17 -0500
committerMarge Bot <[email protected]>2020-04-30 22:01:55 +0000
commit7f22e0fd29369f478da1d36520049f001cd698d1 (patch)
treebaf0547d059b79fe21ad9ce39687951457d42dce /src/mesa/main/glthread.h
parent70847eb0a95f1e1b0fbd435aa0ef4091ae5bef88 (diff)
glthread: do glBufferSubData as unsynchronized upload + GPU copy
1. glthread has a private upload buffer (as struct gl_buffer_object *) 2. the new function glInternalBufferSubDataCopyMESA is used to execute the copy (the source buffer parameter type is struct gl_buffer_object * as GLintptr) Now glthread can handle arbitrary glBufferSubData sizes without syncing. This is a good exercise for uploading data outside of the driver thread. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4314>
Diffstat (limited to 'src/mesa/main/glthread.h')
-rw-r--r--src/mesa/main/glthread.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h
index 32c7826a8f2..4a8ce5abce6 100644
--- a/src/mesa/main/glthread.h
+++ b/src/mesa/main/glthread.h
@@ -50,6 +50,7 @@
#include "compiler/shader_enums.h"
struct gl_context;
+struct gl_buffer_object;
struct _mesa_HashTable;
struct glthread_attrib_binding {
@@ -109,6 +110,14 @@ struct glthread_state
/** Index of the batch being filled and about to be submitted. */
unsigned next;
+ /** Upload buffer. */
+ struct gl_buffer_object *upload_buffer;
+ uint8_t *upload_ptr;
+ unsigned upload_offset;
+
+ /** Caps. */
+ GLboolean SupportsBufferUploads;
+
/** Vertex Array objects tracked by glthread independently of Mesa. */
struct _mesa_HashTable *VAOs;
struct glthread_vao *CurrentVAO;
@@ -129,6 +138,10 @@ void _mesa_glthread_disable(struct gl_context *ctx, const char *func);
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_upload(struct gl_context *ctx, const void *data,
+ GLsizeiptr size, unsigned *out_offset,
+ struct gl_buffer_object **out_buffer,
+ uint8_t **out_ptr);
void _mesa_glthread_BindBuffer(struct gl_context *ctx, GLenum target,
GLuint buffer);