ac: add has_tc_compat_zrange_bug to ac_gpu_info
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 21 Aug 2019 09:21:05 +0000 (11:21 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 27 Aug 2019 06:04:36 +0000 (08:04 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_gpu_info.c
src/amd/common/ac_gpu_info.h
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_image.c
src/amd/vulkan/radv_private.h

index 720abb5469aa955a41cfcf35398657a21dd6f29a..3f3a236ba803743a3a00b4cc1969507374b77d3b 100644 (file)
@@ -470,6 +470,9 @@ bool ac_query_gpu_info(int fd, void *dev_p,
        info->has_gfx9_scissor_bug = info->family == CHIP_VEGA10 ||
                                     info->family == CHIP_RAVEN;
 
+       info->has_tc_compat_zrange_bug = info->chip_class >= GFX8 &&
+                                        info->chip_class <= GFX9;
+
        /* Get the number of good compute units. */
        info->num_good_compute_units = 0;
        for (i = 0; i < info->max_se; i++)
index 0b62e37b67eae4ded67414be4ec1c68dfc53d7f1..0f802216bdc2329f77c997e9e7aea4cfe4d76e76 100644 (file)
@@ -159,6 +159,7 @@ struct radeon_info {
 
        /* Hardware bugs. */
        bool                        has_gfx9_scissor_bug;
+       bool                        has_tc_compat_zrange_bug;
 };
 
 bool ac_query_gpu_info(int fd, void *dev_p,
index 8c7eeddd709ea90e69c8a5669d5acf204fcd25a2..7031428a9962fc1fc543c60b8d6035cd2e9f9fba 100644 (file)
@@ -1403,7 +1403,7 @@ radv_update_zrange_precision(struct radv_cmd_buffer *cmd_buffer,
        uint32_t db_z_info = ds->db_z_info;
        uint32_t db_z_info_reg;
 
-       if (!cmd_buffer->device->physical_device->has_tc_compat_zrange_bug ||
+       if (!cmd_buffer->device->physical_device->rad_info.has_tc_compat_zrange_bug ||
            !radv_image_is_tc_compat_htile(image))
                return;
 
@@ -1632,7 +1632,7 @@ radv_set_tc_compat_zrange_metadata(struct radv_cmd_buffer *cmd_buffer,
 {
        struct radeon_cmdbuf *cs = cmd_buffer->cs;
 
-       if (!cmd_buffer->device->physical_device->has_tc_compat_zrange_bug)
+       if (!cmd_buffer->device->physical_device->rad_info.has_tc_compat_zrange_bug)
                return;
 
        uint64_t va = radv_get_tc_compat_zrange_va(image, range->baseMipLevel);
index a34e5506463a9cd4b6a90f755fb83ce9b87a9e36..ce487aa2eda41070f1b67fa5bdf1c47ef24d9c66 100644 (file)
@@ -363,8 +363,6 @@ radv_physical_device_init(struct radv_physical_device *device,
                                         device->rad_info.family == CHIP_RENOIR;
        }
 
-       device->has_tc_compat_zrange_bug = device->rad_info.chip_class < GFX10;
-
        device->out_of_order_rast_allowed = device->rad_info.has_out_of_order_rast &&
                                            !(device->instance->debug_flags & RADV_DEBUG_NO_OUT_OF_ORDER);
 
index f0c9fd77cf64dbd3734014d71f0414f972e08649..935224c5b6d71f69d7c7141db3bccb7f6d3d5cb7 100644 (file)
@@ -1159,7 +1159,7 @@ radv_image_alloc_htile(struct radv_device *device, struct radv_image *image)
        image->clear_value_offset = image->htile_offset + image->planes[0].surface.htile_size;
        image->size = image->clear_value_offset + image->info.levels * 8;
        if (radv_image_is_tc_compat_htile(image) &&
-           device->physical_device->has_tc_compat_zrange_bug) {
+           device->physical_device->rad_info.has_tc_compat_zrange_bug) {
                /* Metadata for the TC-compatible HTILE hardware bug which
                 * have to be fixed by updating ZRANGE_PRECISION when doing
                 * fast depth clears to 0.0f.
index 55112902c3437f4f634966769a363633441f11c8..b3d6d56e4ace39c314976c218802428458249afb 100644 (file)
@@ -281,7 +281,6 @@ struct radv_physical_device {
        struct wsi_device                       wsi_device;
 
        bool rbplus_allowed; /* if RB+ is allowed */
-       bool has_tc_compat_zrange_bug;
 
        bool out_of_order_rast_allowed;