summaryrefslogtreecommitdiff
path: root/src/mesa/main/glthread.h
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-10-09 22:16:29 -0400
committerMarge Bot <eric+marge@anholt.net>2020-12-08 17:47:56 +0000
commit70b778945b320115c558e17f12e3d630d464dcba (patch)
treee791413051f9487d8644d11e96ad2279551e0b91 /src/mesa/main/glthread.h
parent0a4004e5fab0aef3ccec102656d7abef303ae5d8 (diff)
glthread: use glthread->used instead of glthread->next_batch->used
remove one pointer dereference by having "used" in glthread too Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7719>
Diffstat (limited to 'src/mesa/main/glthread.h')
-rw-r--r--src/mesa/main/glthread.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h
index 677cbe672ea..73d1b22c02a 100644
--- a/src/mesa/main/glthread.h
+++ b/src/mesa/main/glthread.h
@@ -100,7 +100,12 @@ struct glthread_batch
/** The worker thread will access the context with this. */
struct gl_context *ctx;
- /** Amount of data used by batch commands, in bytes. */
+ /**
+ * Amount of data used by batch commands, in bytes.
+ * This is 0 when it's being filled because glthread::used holds the real
+ * value temporarily, and glthread::used is copied to this variable when
+ * the batch is submitted.
+ */
int used;
/** Data contained in the command buffer. */
@@ -153,6 +158,9 @@ struct glthread_state
/** Index of the batch being filled and about to be submitted. */
unsigned next;
+ /** Amount of data filled in next_batch, in bytes. */
+ int used;
+
/** Upload buffer. */
struct gl_buffer_object *upload_buffer;
uint8_t *upload_ptr;