[Mesa-dev] [PATCH] nvc0: handle user buffers without any data
Rhys Perry
pendingchaos02 at gmail.com
Mon Oct 8 16:20:20 UTC 2018
Fixes crash in piglit's gl-3.1-vao-broken-attrib.
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
---
src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
index f2393cb27b..86a8bebc25 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c
@@ -972,7 +972,13 @@ nvc0_set_vertex_buffers(struct pipe_context *pipe,
for (i = 0; i < count; ++i) {
unsigned dst_index = start_slot + i;
- if (vb[i].is_user_buffer) {
+ /* user buffers without any data are treated as resource buffers
+ * without a resource
+ */
+ if (vb[i].is_user_buffer && !vb[i].buffer.user)
+ nvc0->vtxbuf[i].is_user_buffer = false;
+
+ if (nvc0->vtxbuf[i].is_user_buffer) {
nvc0->vbo_user |= 1 << dst_index;
if (!vb[i].stride && nvc0->screen->eng3d->oclass < GM107_3D_CLASS)
nvc0->constant_vbos |= 1 << dst_index;
--
2.17.1
More information about the mesa-dev
mailing list