aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2020-02-27 15:46:11 -0500
committerMarge Bot <[email protected]>2020-03-11 18:45:28 +0000
commitec7d48afc40343bf314d28a7276500efb1e52361 (patch)
treeff714c7bafe4f834a309f23df46449e316c10e89 /src
parenta398a9d7e7f8fe19eaa0c33b36ab6816472b698c (diff)
vbo: use vbo_exec_wrap_upgrade_vertex for glVertex in ATTR_UNION
We can't decrease the size for glVertex before a flush, so use vbo_exec_wrap_upgrade_vertex directly. Reviewed-by: Mathias Fröhlich <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3591>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/vbo/vbo_exec_api.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 6fd4c1493cf..d97c4988b29 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -474,14 +474,14 @@ do { \
\
assert(sz == 1 || sz == 2); \
\
- /* check if attribute size or type is changing */ \
- if (unlikely(exec->vtx.attr[A].active_size != N * sz || \
- exec->vtx.attr[A].type != T)) { \
- vbo_exec_fixup_vertex(ctx, A, N * sz, T); \
- } \
- \
/* store a copy of the attribute in exec except for glVertex */ \
if ((A) != 0) { \
+ /* Check if attribute size or type is changing. */ \
+ if (unlikely(exec->vtx.attr[A].active_size != N * sz || \
+ exec->vtx.attr[A].type != T)) { \
+ vbo_exec_fixup_vertex(ctx, A, N * sz, T); \
+ } \
+ \
C *dest = (C *)exec->vtx.attrptr[A]; \
if (N>0) dest[0] = V0; \
if (N>1) dest[1] = V1; \
@@ -493,6 +493,12 @@ do { \
ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \
} else { \
/* This is a glVertex call */ \
+ /* Check if attribute size or type is changing. */ \
+ if (unlikely(exec->vtx.attr[0].size < N * sz || \
+ exec->vtx.attr[0].type != T)) { \
+ vbo_exec_wrap_upgrade_vertex(exec, 0, N * sz, T); \
+ } \
+ \
uint32_t *dst = (uint32_t *)exec->vtx.buffer_ptr; \
uint32_t *src = (uint32_t *)exec->vtx.vertex; \
unsigned vertex_size_no_pos = exec->vtx.vertex_size_no_pos; \