svga: fix prim type check/assignment in translate_indices()
authorBrian Paul <brianp@vmware.com>
Fri, 2 Sep 2016 20:06:00 +0000 (14:06 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 17 Sep 2016 16:09:00 +0000 (10:09 -0600)
Left over test code spotted by Sinclair.

Tested with piglit, Google Earth, Lightsmark, Heaven4, glretraces, etc.

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
src/gallium/drivers/svga/svga_draw_elements.c

index 37d1fdb4f6164fbf2f23f98d0b26c1015215e807..f9bb13664f586e6fdb5b52d9788c7e580e7256e4 100644 (file)
@@ -81,7 +81,7 @@ translate_indices(struct svga_hwtnl *hwtnl, struct pipe_resource *src,
    if (!screen->debug.no_cache_index_buffers) {
       /* Check if we already have a translated index buffer */
       if (src_sbuf->translated_indices.buffer &&
-          src_sbuf->translated_indices.orig_prim == PIPE_PRIM_QUADS &&
+          src_sbuf->translated_indices.orig_prim == orig_prim &&
           src_sbuf->translated_indices.new_prim == gen_prim &&
           src_sbuf->translated_indices.offset == offset &&
           src_sbuf->translated_indices.count == orig_nr &&
@@ -123,7 +123,7 @@ translate_indices(struct svga_hwtnl *hwtnl, struct pipe_resource *src,
        * again in the future.
        */
       pipe_resource_reference(&src_sbuf->translated_indices.buffer, dst);
-      src_sbuf->translated_indices.orig_prim = PIPE_PRIM_QUADS;
+      src_sbuf->translated_indices.orig_prim = orig_prim;
       src_sbuf->translated_indices.new_prim = gen_prim;
       src_sbuf->translated_indices.offset = offset;
       src_sbuf->translated_indices.count = orig_nr;