From: Kenneth Graunke Date: Fri, 2 Nov 2018 21:54:35 +0000 (-0700) Subject: iris: allow binding a null vertex buffer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=317ba8796f5572e657c0bfae643c2e2917157c7c;p=mesa.git iris: allow binding a null vertex buffer PBO upload apparently does this... --- 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);