summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Cercueil <[email protected]>2019-11-19 21:58:17 +0100
committerMarge Bot <[email protected]>2019-12-21 18:29:30 +0000
commit88d041a6b9958f893312bfd159372c4b4559652a (patch)
tree66293d24a6993b135460f9ca93317d57b4225e67 /src
parent5f37e38b810af438159d30542c6174f99d5bf2c3 (diff)
u_vbuf: Mark vbufs incompatible if more were requested than HW supports
More vertex buffers are used than the hardware supports. In principle, we only need to make sure that less vertex buffers are used, and mark some of the latter vertex buffers as incompatible. For now, mark all vertex buffers as incompatible. Signed-off-by: Paul Cercueil <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2807>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/util/u_vbuf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_vbuf.c b/src/gallium/auxiliary/util/u_vbuf.c
index e69e9fd20a0..67c82a56ecd 100644
--- a/src/gallium/auxiliary/util/u_vbuf.c
+++ b/src/gallium/auxiliary/util/u_vbuf.c
@@ -788,6 +788,17 @@ u_vbuf_create_vertex_elements(struct u_vbuf *mgr, unsigned count,
}
}
+ if (used_buffers & ~mgr->allowed_vb_mask) {
+ /* More vertex buffers are used than the hardware supports. In
+ * principle, we only need to make sure that less vertex buffers are
+ * used, and mark some of the latter vertex buffers as incompatible.
+ * For now, mark all vertex buffers as incompatible.
+ */
+ ve->incompatible_vb_mask_any = used_buffers;
+ ve->compatible_vb_mask_any = 0;
+ ve->incompatible_elem_mask = u_bit_consecutive(0, count);
+ }
+
ve->used_vb_mask = used_buffers;
ve->compatible_vb_mask_all = ~ve->incompatible_vb_mask_any & used_buffers;
ve->incompatible_vb_mask_all = ~ve->compatible_vb_mask_any & used_buffers;