Module: Mesa
Branch: master
Commit: ed41e776d03d27d2874f9b02e00bbd1f2226528f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed41e776d03d27d2874f9b02e00bbd1f2226528f

Author: Samuel Pitoiset <[email protected]>
Date:   Fri Apr  6 16:00:08 2018 +0200

radv: clean up radv_vi_dcc_enabled()

And rename to radv_dcc_enabled() to be consistent.

Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>

---

 src/amd/vulkan/radv_device.c  |  2 +-
 src/amd/vulkan/radv_image.c   |  2 +-
 src/amd/vulkan/radv_private.h | 16 ++++++++++------
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index caf6f00e63..846639eab0 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -3560,7 +3560,7 @@ radv_initialise_color_surface(struct radv_device *device,
            !(device->instance->debug_flags & RADV_DEBUG_NO_FAST_CLEARS))
                cb->cb_color_info |= S_028C70_FAST_CLEAR(1);
 
-       if (radv_vi_dcc_enabled(iview->image, iview->base_mip))
+       if (radv_dcc_enabled(iview->image, iview->base_mip))
                cb->cb_color_info |= S_028C70_DCC_ENABLE(1);
 
        if (device->physical_device->rad_info.chip_class >= VI) {
diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 56b9ba1cda..1a8352fea2 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -294,7 +294,7 @@ si_set_mutable_tex_desc_fields(struct radv_device *device,
        if (chip_class >= VI) {
                state[6] &= C_008F28_COMPRESSION_EN;
                state[7] = 0;
-               if (!is_storage_image && radv_vi_dcc_enabled(image, 
first_level)) {
+               if (!is_storage_image && radv_dcc_enabled(image, first_level)) {
                        meta_va = gpu_address + image->dcc_offset;
                        if (chip_class <= VI)
                                meta_va += base_level_info->dcc_offset;
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index f954d67874..97f4cf657d 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1384,12 +1384,6 @@ bool radv_layout_dcc_compressed(const struct radv_image 
*image,
                                VkImageLayout layout,
                                unsigned queue_mask);
 
-static inline bool
-radv_vi_dcc_enabled(const struct radv_image *image, unsigned level)
-{
-       return image->surface.dcc_size && level < image->surface.num_dcc_levels;
-}
-
 /**
  * Return whether the image has CMASK metadata for color surfaces.
  */
@@ -1418,6 +1412,16 @@ radv_image_has_dcc(const struct radv_image *image)
 }
 
 /**
+ * Return whether DCC metadata is enabled for a level.
+ */
+static inline bool
+radv_dcc_enabled(const struct radv_image *image, unsigned level)
+{
+       return radv_image_has_dcc(image) &&
+              level < image->surface.num_dcc_levels;
+}
+
+/**
  * Return whether the image has HTILE metadata for depth surfaces.
  */
 static inline bool

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to