radeonsi: rename shader resource decompress masks to their true meaning
authorMarek Olšák <marek.olsak@amd.com>
Tue, 6 Jun 2017 22:51:23 +0000 (00:51 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 8 Jun 2017 21:29:07 +0000 (23:29 +0200)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_blit.c
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_pipe.h

index 46cb6469b66c17f67a8a94de5c4430a67694e4f9..20b08b6afb14001ee9a24eb841b97707a102e28d 100644 (file)
@@ -395,7 +395,7 @@ si_flush_depth_textures(struct si_context *sctx,
                        struct si_textures_info *textures)
 {
        unsigned i;
-       unsigned mask = textures->depth_texture_mask;
+       unsigned mask = textures->needs_depth_decompress_mask;
 
        while (mask) {
                struct pipe_sampler_view *view;
@@ -507,7 +507,7 @@ si_decompress_sampler_color_textures(struct si_context *sctx,
                                     struct si_textures_info *textures)
 {
        unsigned i;
-       unsigned mask = textures->compressed_colortex_mask;
+       unsigned mask = textures->needs_color_decompress_mask;
 
        while (mask) {
                struct pipe_sampler_view *view;
@@ -530,7 +530,7 @@ si_decompress_image_color_textures(struct si_context *sctx,
                                   struct si_images_info *images)
 {
        unsigned i;
-       unsigned mask = images->compressed_colortex_mask;
+       unsigned mask = images->needs_color_decompress_mask;
 
        while (mask) {
                const struct pipe_image_view *view;
@@ -664,13 +664,13 @@ static void si_decompress_textures(struct si_context *sctx, unsigned shader_mask
        while (mask) {
                unsigned i = u_bit_scan(&mask);
 
-               if (sctx->samplers[i].depth_texture_mask) {
+               if (sctx->samplers[i].needs_depth_decompress_mask) {
                        si_flush_depth_textures(sctx, &sctx->samplers[i]);
                }
-               if (sctx->samplers[i].compressed_colortex_mask) {
+               if (sctx->samplers[i].needs_color_decompress_mask) {
                        si_decompress_sampler_color_textures(sctx, &sctx->samplers[i]);
                }
-               if (sctx->images[i].compressed_colortex_mask) {
+               if (sctx->images[i].needs_color_decompress_mask) {
                        si_decompress_image_color_textures(sctx, &sctx->images[i]);
                }
        }
index 6955b9daf69d1c6b62ce238d3140005b609828b0..3aa2b9d3fb11b6c502974c02b47e4967cb7ad300 100644 (file)
@@ -580,9 +580,9 @@ static void si_update_compressed_tex_shader_mask(struct si_context *sctx,
        struct si_textures_info *samplers = &sctx->samplers[shader];
        unsigned shader_bit = 1 << shader;
 
-       if (samplers->depth_texture_mask ||
-           samplers->compressed_colortex_mask ||
-           sctx->images[shader].compressed_colortex_mask)
+       if (samplers->needs_depth_decompress_mask ||
+           samplers->needs_color_decompress_mask ||
+           sctx->images[shader].needs_color_decompress_mask)
                sctx->compressed_tex_shader_mask |= shader_bit;
        else
                sctx->compressed_tex_shader_mask &= ~shader_bit;
@@ -604,8 +604,8 @@ static void si_set_sampler_views(struct pipe_context *ctx,
                unsigned slot = start + i;
 
                if (!views || !views[i]) {
-                       samplers->depth_texture_mask &= ~(1u << slot);
-                       samplers->compressed_colortex_mask &= ~(1u << slot);
+                       samplers->needs_depth_decompress_mask &= ~(1u << slot);
+                       samplers->needs_color_decompress_mask &= ~(1u << slot);
                        si_set_sampler_view(sctx, shader, slot, NULL, false);
                        continue;
                }
@@ -618,22 +618,22 @@ static void si_set_sampler_views(struct pipe_context *ctx,
                        struct si_sampler_view *rview = (struct si_sampler_view *)views[i];
 
                        if (depth_needs_decompression(rtex, rview)) {
-                               samplers->depth_texture_mask |= 1u << slot;
+                               samplers->needs_depth_decompress_mask |= 1u << slot;
                        } else {
-                               samplers->depth_texture_mask &= ~(1u << slot);
+                               samplers->needs_depth_decompress_mask &= ~(1u << slot);
                        }
                        if (color_needs_decompression(rtex)) {
-                               samplers->compressed_colortex_mask |= 1u << slot;
+                               samplers->needs_color_decompress_mask |= 1u << slot;
                        } else {
-                               samplers->compressed_colortex_mask &= ~(1u << slot);
+                               samplers->needs_color_decompress_mask &= ~(1u << slot);
                        }
 
                        if (rtex->dcc_offset &&
                            p_atomic_read(&rtex->framebuffers_bound))
                                sctx->need_check_render_feedback = true;
                } else {
-                       samplers->depth_texture_mask &= ~(1u << slot);
-                       samplers->compressed_colortex_mask &= ~(1u << slot);
+                       samplers->needs_depth_decompress_mask &= ~(1u << slot);
+                       samplers->needs_color_decompress_mask &= ~(1u << slot);
                }
        }
 
@@ -653,9 +653,9 @@ si_samplers_update_compressed_colortex_mask(struct si_textures_info *samplers)
                        struct r600_texture *rtex = (struct r600_texture *)res;
 
                        if (color_needs_decompression(rtex)) {
-                               samplers->compressed_colortex_mask |= 1u << i;
+                               samplers->needs_color_decompress_mask |= 1u << i;
                        } else {
-                               samplers->compressed_colortex_mask &= ~(1u << i);
+                               samplers->needs_color_decompress_mask &= ~(1u << i);
                        }
                }
        }
@@ -702,7 +702,7 @@ si_disable_shader_image(struct si_context *ctx, unsigned shader, unsigned slot)
                unsigned desc_slot = si_get_image_slot(slot);
 
                pipe_resource_reference(&images->views[slot].resource, NULL);
-               images->compressed_colortex_mask &= ~(1 << slot);
+               images->needs_color_decompress_mask &= ~(1 << slot);
 
                memcpy(descs->list + desc_slot*8, null_image_descriptor, 8*4);
                images->enabled_mask &= ~(1u << slot);
@@ -756,7 +756,7 @@ static void si_set_shader_image(struct si_context *ctx,
                                          view->u.buf.size, desc);
                si_set_buf_desc_address(res, view->u.buf.offset, desc + 4);
 
-               images->compressed_colortex_mask &= ~(1 << slot);
+               images->needs_color_decompress_mask &= ~(1 << slot);
                res->bind_history |= PIPE_BIND_SHADER_IMAGE;
        } else {
                static const unsigned char swizzle[4] = { 0, 1, 2, 3 };
@@ -782,9 +782,9 @@ static void si_set_shader_image(struct si_context *ctx,
                }
 
                if (color_needs_decompression(tex)) {
-                       images->compressed_colortex_mask |= 1 << slot;
+                       images->needs_color_decompress_mask |= 1 << slot;
                } else {
-                       images->compressed_colortex_mask &= ~(1 << slot);
+                       images->needs_color_decompress_mask &= ~(1 << slot);
                }
 
                if (uses_dcc &&
@@ -877,9 +877,9 @@ si_images_update_compressed_colortex_mask(struct si_images_info *images)
                        struct r600_texture *rtex = (struct r600_texture *)res;
 
                        if (color_needs_decompression(rtex)) {
-                               images->compressed_colortex_mask |= 1 << i;
+                               images->needs_color_decompress_mask |= 1 << i;
                        } else {
-                               images->compressed_colortex_mask &= ~(1 << i);
+                               images->needs_color_decompress_mask &= ~(1 << i);
                        }
                }
        }
index 5559946484397b34922fca7c80fece814b1beacf..b5c77973cceb90797382380b76e8eb73434df718 100644 (file)
@@ -153,13 +153,13 @@ struct si_cs_shader_state {
 
 struct si_textures_info {
        struct si_sampler_views         views;
-       uint32_t                        depth_texture_mask; /* which textures are depth */
-       uint32_t                        compressed_colortex_mask;
+       uint32_t                        needs_depth_decompress_mask;
+       uint32_t                        needs_color_decompress_mask;
 };
 
 struct si_images_info {
        struct pipe_image_view          views[SI_NUM_IMAGES];
-       uint32_t                        compressed_colortex_mask;
+       uint32_t                        needs_color_decompress_mask;
        unsigned                        enabled_mask;
 };