iris: allow binding a null vertex buffer
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 2 Nov 2018 21:54:35 +0000 (14:54 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:09 +0000 (10:26 -0800)
PBO upload apparently does this...

src/gallium/drivers/iris/iris_state.c

index 859c96717bcddc650e0c38c7b21addf06c44f4c9..12741c7a899dd484e1f637efa9e552519dd25e50 100644 (file)
@@ -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);