From 317ba8796f5572e657c0bfae643c2e2917157c7c Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Fri, 2 Nov 2018 14:54:35 -0700 Subject: [PATCH] iris: allow binding a null vertex buffer PBO upload apparently does this... --- src/gallium/drivers/iris/iris_state.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 859c96717bc..12741c7a899 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -2259,9 +2259,13 @@ iris_set_vertex_buffers(struct pipe_context *ctx, vb.MOCS = MOCS_WB; vb.AddressModifyEnable = true; vb.BufferPitch = buffers[i].stride; - vb.BufferSize = res->bo->size; - vb.BufferStartingAddress = - ro_bo(NULL, res->bo->gtt_offset + buffers[i].buffer_offset); + if (res) { + vb.BufferSize = res->bo->size; + vb.BufferStartingAddress = + ro_bo(NULL, res->bo->gtt_offset + buffers[i].buffer_offset); + } else { + vb.NullVertexBuffer = true; + } } vb_pack_dest += GENX(VERTEX_BUFFER_STATE_length); -- 2.30.2