radeonsi: set current_rast_prim in the right place
authorMarek Olšák <marek.olsak@amd.com>
Sun, 22 Feb 2015 18:14:42 +0000 (19:14 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 24 Feb 2015 20:21:04 +0000 (21:21 +0100)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_state_draw.c

index 511bea283ac3ad01867038dd8b2c7721af671e9e..cb147c367082e469b8a785829d22117079307636 100644 (file)
@@ -502,12 +502,18 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
        if (!sctx->ps_shader || !sctx->vs_shader)
                return;
 
+       si_decompress_textures(sctx);
+
+       /* Set the rasterization primitive type.
+        *
+        * This must be done after si_decompress_textures, which can call
+        * draw_vbo recursively, and before si_update_shaders, which uses
+        * current_rast_prim for this draw_vbo call. */
        if (sctx->gs_shader)
                sctx->current_rast_prim = sctx->gs_shader->gs_output_prim;
        else
                sctx->current_rast_prim = info->mode;
 
-       si_decompress_textures(sctx);
        si_update_shaders(sctx);
 
        if (sctx->vertex_buffers_dirty) {