vc4: Don't throw out the index offset in the shadow index buffer path.
authorEric Anholt <eric@anholt.net>
Fri, 12 Dec 2014 04:34:06 +0000 (20:34 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 12 Dec 2014 07:52:25 +0000 (23:52 -0800)
When we upload shadow indices at draw time, we need the source offset.
Fixes the piglit draw-elements test.

src/gallium/drivers/vc4/vc4_state.c

index bbbb73d4cd6a1c3be56bb936a9727cd406a82cf2..630ac4dc04fa3955681ffea3e9a7fb430dc27e1e 100644 (file)
@@ -300,12 +300,11 @@ vc4_set_index_buffer(struct pipe_context *pctx,
                         pipe_resource_reference(&vc4->indexbuf.buffer, NULL);
                         vc4->indexbuf.buffer = pshadow;
                         vc4->indexbuf.index_size = 2;
-                        vc4->indexbuf.offset = 0;
                 } else {
                         pipe_resource_reference(&vc4->indexbuf.buffer, ib->buffer);
                         vc4->indexbuf.index_size = ib->index_size;
-                        vc4->indexbuf.offset = ib->offset;
                 }
+                vc4->indexbuf.offset = ib->offset;
         } else {
                 pipe_resource_reference(&vc4->indexbuf.buffer, NULL);
         }