radeonsi: split texture decompression for compute shaders
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 19 Mar 2016 17:41:20 +0000 (18:41 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 19 Apr 2016 16:10:31 +0000 (18:10 +0200)
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_blit.c
src/gallium/drivers/radeonsi/si_compute.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_draw.c

index 54da7a20203fbda2b31196fec620f34a77a1c269..7ca0e23b63395cd8c33c5e8c89cf31e83d54e152 100644 (file)
@@ -374,7 +374,8 @@ si_decompress_image_color_textures(struct si_context *sctx,
        }
 }
 
-void si_decompress_textures(struct si_context *sctx)
+static void si_decompress_textures(struct si_context *sctx, int shader_start,
+                                   int shader_end)
 {
        unsigned compressed_colortex_counter;
 
@@ -389,7 +390,7 @@ void si_decompress_textures(struct si_context *sctx)
        }
 
        /* Flush depth textures which need to be flushed. */
-       for (int i = 0; i < SI_NUM_SHADERS; i++) {
+       for (int i = shader_start; i < shader_end; i++) {
                if (sctx->samplers[i].depth_texture_mask) {
                        si_flush_depth_textures(sctx, &sctx->samplers[i]);
                }
@@ -402,6 +403,14 @@ void si_decompress_textures(struct si_context *sctx)
        }
 }
 
+void si_decompress_graphics_textures(struct si_context *sctx) {
+       si_decompress_textures(sctx, 0, SI_NUM_GRAPHICS_SHADERS);
+}
+
+void si_decompress_compute_textures(struct si_context *sctx) {
+       si_decompress_textures(sctx, SI_NUM_GRAPHICS_SHADERS, SI_NUM_SHADERS);
+}
+
 static void si_clear(struct pipe_context *ctx, unsigned buffers,
                     const union pipe_color_union *color,
                     double depth, unsigned stencil)
index e0750314e76a8d6c8c618a365259c594f2a0872a..269cb201db4d24127cc4d2c2d02b8225f3fbce1b 100644 (file)
@@ -434,6 +434,8 @@ static void si_launch_grid(
        struct si_compute *program = sctx->cs_shader_state.program;
        int i;
 
+       si_decompress_compute_textures(sctx);
+
        si_need_cs_space(sctx);
 
        if (!sctx->cs_shader_state.initialized)
index 5a5249cd8c6bebcc9b5618ad5e1a8cf7ae87d7c5..c77353fba3204b97025553eef7aa68a1ac6ea122 100644 (file)
@@ -339,7 +339,8 @@ void cik_sdma_copy(struct pipe_context *ctx,
 
 /* si_blit.c */
 void si_init_blit_functions(struct si_context *sctx);
-void si_decompress_textures(struct si_context *sctx);
+void si_decompress_graphics_textures(struct si_context *sctx);
+void si_decompress_compute_textures(struct si_context *sctx);
 void si_resource_copy_region(struct pipe_context *ctx,
                             struct pipe_resource *dst,
                             unsigned dst_level,
index 8248604907d3abd1c71f0d8937b057f5c3917ab8..131c3776c60e13f18d9f87eb5c46bfb0bf78d988 100644 (file)
@@ -812,7 +812,7 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
                si_mark_atom_dirty(sctx, &sctx->framebuffer.atom);
        }
 
-       si_decompress_textures(sctx);
+       si_decompress_graphics_textures(sctx);
 
        /* Set the rasterization primitive type.
         *