Mesa (main): aux/vbuf: move mask-clearing for vbuf updates after buffer scanning
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Feb 1 01:49:54 UTC 2022
Module: Mesa
Branch: main
Commit: b733a226360b78d87308c3b74c6a4abbd59c897b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b733a226360b78d87308c3b74c6a4abbd59c897b
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Thu Jan 20 11:51:28 2022 -0500
aux/vbuf: move mask-clearing for vbuf updates after buffer scanning
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14640>
---
src/gallium/auxiliary/util/u_vbuf.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index ed2ca4bf03f..587a45e61ec 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -992,20 +992,20 @@ void u_vbuf_set_vertex_buffers(struct u_vbuf *mgr,
const uint32_t mask =
~(((1ull << (count + unbind_num_trailing_slots)) - 1) << start_slot);
- /* Zero out the bits we are going to rewrite completely. */
- mgr->user_vb_mask &= mask;
- mgr->incompatible_vb_mask &= mask;
- mgr->nonzero_stride_vb_mask &= mask;
- mgr->enabled_vb_mask &= mask;
- mgr->unaligned_vb_mask[0] &= mask;
- mgr->unaligned_vb_mask[1] &= mask;
-
if (!bufs) {
struct pipe_context *pipe = mgr->pipe;
/* Unbind. */
unsigned total_count = count + unbind_num_trailing_slots;
mgr->dirty_real_vb_mask &= mask;
+ /* Zero out the bits we are going to rewrite completely. */
+ mgr->user_vb_mask &= mask;
+ mgr->incompatible_vb_mask &= mask;
+ mgr->nonzero_stride_vb_mask &= mask;
+ mgr->enabled_vb_mask &= mask;
+ mgr->unaligned_vb_mask[0] &= mask;
+ mgr->unaligned_vb_mask[1] &= mask;
+
for (i = 0; i < total_count; i++) {
unsigned dst_index = start_slot + i;
@@ -1078,6 +1078,15 @@ void u_vbuf_set_vertex_buffers(struct u_vbuf *mgr,
pipe_vertex_buffer_unreference(&mgr->real_vertex_buffer[dst_index]);
}
+
+ /* Zero out the bits we are going to rewrite completely. */
+ mgr->user_vb_mask &= mask;
+ mgr->incompatible_vb_mask &= mask;
+ mgr->nonzero_stride_vb_mask &= mask;
+ mgr->enabled_vb_mask &= mask;
+ mgr->unaligned_vb_mask[0] &= mask;
+ mgr->unaligned_vb_mask[1] &= mask;
+
mgr->user_vb_mask |= user_vb_mask;
mgr->incompatible_vb_mask |= incompatible_vb_mask;
mgr->nonzero_stride_vb_mask |= nonzero_stride_vb_mask;
More information about the mesa-commit
mailing list