radeonsi: move si_decompress_textures to si_blit.c
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 8 Feb 2016 03:27:17 +0000 (22:27 -0500)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 10 Mar 2016 23:22:49 +0000 (18:22 -0500)
Since it is all about calling into blitter functions, it makes more
sense here. This change also reduces the size of the interfaces between
.c files.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_blit.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_draw.c

index d9c4f8fca1d1076da207bd694dfe562cd8340345..e17343fd3d3668bc354538c163e4ac063a0c7985 100644 (file)
@@ -241,8 +241,9 @@ static void si_blit_decompress_depth_in_place(struct si_context *sctx,
        si_mark_atom_dirty(sctx, &sctx->db_render_state);
 }
 
-void si_flush_depth_textures(struct si_context *sctx,
-                            struct si_textures_info *textures)
+static void
+si_flush_depth_textures(struct si_context *sctx,
+                       struct si_textures_info *textures)
 {
        unsigned i;
        unsigned mask = textures->depth_texture_mask;
@@ -323,8 +324,9 @@ static void si_blit_decompress_color(struct pipe_context *ctx,
        }
 }
 
-void si_decompress_color_textures(struct si_context *sctx,
-                                 struct si_textures_info *textures)
+static void
+si_decompress_color_textures(struct si_context *sctx,
+                            struct si_textures_info *textures)
 {
        unsigned i;
        unsigned mask = textures->compressed_colortex_mask;
@@ -348,6 +350,22 @@ void si_decompress_color_textures(struct si_context *sctx,
        }
 }
 
+void si_decompress_textures(struct si_context *sctx)
+{
+       if (sctx->blitter->running)
+               return;
+
+       /* Flush depth textures which need to be flushed. */
+       for (int i = 0; i < SI_NUM_SHADERS; i++) {
+               if (sctx->samplers[i].depth_texture_mask) {
+                       si_flush_depth_textures(sctx, &sctx->samplers[i]);
+               }
+               if (sctx->samplers[i].compressed_colortex_mask) {
+                       si_decompress_color_textures(sctx, &sctx->samplers[i]);
+               }
+       }
+}
+
 static void si_clear(struct pipe_context *ctx, unsigned buffers,
                     const union pipe_color_union *color,
                     double depth, unsigned stencil)
index 736307b17a1e5064232895936e126b784b1163a0..0fef5f720980c40c667b8648e77e3377226e157a 100644 (file)
@@ -333,10 +333,7 @@ void cik_sdma_copy(struct pipe_context *ctx,
 
 /* si_blit.c */
 void si_init_blit_functions(struct si_context *sctx);
-void si_flush_depth_textures(struct si_context *sctx,
-                            struct si_textures_info *textures);
-void si_decompress_color_textures(struct si_context *sctx,
-                                 struct si_textures_info *textures);
+void si_decompress_textures(struct si_context *sctx);
 void si_resource_copy_region(struct pipe_context *ctx,
                             struct pipe_resource *dst,
                             unsigned dst_level,
index 5d094c71734da59dc3a86183b4a517b0b7956dab..84b850a299240ef777c45191499bf8138605521f 100644 (file)
 #include "util/u_upload_mgr.h"
 #include "util/u_prim.h"
 
-static void si_decompress_textures(struct si_context *sctx)
-{
-       if (!sctx->blitter->running) {
-               /* Flush depth textures which need to be flushed. */
-               for (int i = 0; i < SI_NUM_SHADERS; i++) {
-                       if (sctx->samplers[i].depth_texture_mask) {
-                               si_flush_depth_textures(sctx, &sctx->samplers[i]);
-                       }
-                       if (sctx->samplers[i].compressed_colortex_mask) {
-                               si_decompress_color_textures(sctx, &sctx->samplers[i]);
-                       }
-               }
-       }
-}
-
 static unsigned si_conv_pipe_prim(unsigned mode)
 {
         static const unsigned prim_conv[] = {