radv: clean up radv_vi_dcc_enabled()
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 6 Apr 2018 14:00:08 +0000 (16:00 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 9 Apr 2018 09:21:14 +0000 (11:21 +0200)
And rename to radv_dcc_enabled() to be consistent.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_image.c
src/amd/vulkan/radv_private.h

index caf6f00e63423c41603ee1fcd7d4ced09ebc0058..846639eab0d71922c63a28d9a3a1c448a2b776bf 100644 (file)
@@ -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) {
index 56b9ba1cdaf235af7bba1af2a6eca11e267d0048..1a8352fea275d57c2ebb9c17e67995941983b0b1 100644 (file)
@@ -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;
index f954d678740565e11db3816ef82c42e9a685ac8e..97f4cf657d8c3a1f1a34d6fb5f1a9c54ad5d2707 100644 (file)
@@ -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.
  */
@@ -1417,6 +1411,16 @@ radv_image_has_dcc(const struct radv_image *image)
        return image->surface.dcc_size;
 }
 
+/**
+ * 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.
  */