From f1a40a26a90d65c8cb2881b9a2679ed089bf2ead Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 2 May 2020 16:01:44 -0400 Subject: Revert "ac/surface: remove RADEON_SURF_TC_COMPATIBLE_HTILE and assume it's always set" This reverts commit f6d87ec8a908250af5e805c8042524ac360094a2. It breaks RADV. Fixes: f6d87ec8a908250af5e805c8042524ac360094a2 "ac/surface: remove RADEON_SURF_TC_COMPATIBLE_HTILE and assume it's always set" Part-of: --- src/amd/vulkan/radv_image.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/amd/vulkan') diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 84eae33f433..f7818c691c8 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -437,8 +437,11 @@ radv_init_surface(struct radv_device *device, unreachable("unhandled image type"); } - if (is_depth) + if (is_depth) { surface->flags |= RADEON_SURF_ZBUFFER; + if (radv_use_tc_compat_htile_for_image(device, pCreateInfo, image_format)) + surface->flags |= RADEON_SURF_TC_COMPATIBLE_HTILE; + } if (is_stencil) surface->flags |= RADEON_SURF_SBUFFER; @@ -1348,8 +1351,6 @@ static void radv_image_disable_htile(struct radv_image *image) { for (unsigned i = 0; i < image->plane_count; ++i) image->planes[i].surface.htile_size = 0; - - image->tc_compatible_htile = false; } VkResult @@ -1421,8 +1422,7 @@ radv_image_create_layout(struct radv_device *device, /* Otherwise, try to enable HTILE for depth surfaces. */ if (radv_image_can_enable_htile(image) && !(device->instance->debug_flags & RADV_DEBUG_NO_HIZ)) { - if (!image->planes[0].surface.tc_compatible_htile_allowed) - image->tc_compatible_htile = false; + image->tc_compatible_htile = image->planes[0].surface.flags & RADEON_SURF_TC_COMPATIBLE_HTILE; radv_image_alloc_htile(device, image); } else { radv_image_disable_htile(image); @@ -1500,10 +1500,6 @@ radv_image_create(VkDevice _device, image->info.surf_index = &device->image_mrt_offset_counter; } - image->tc_compatible_htile = - radv_use_tc_compat_htile_for_image(device, create_info->vk_info, - image->vk_format); - for (unsigned plane = 0; plane < image->plane_count; ++plane) { radv_init_surface(device, image, &image->planes[plane].surface, plane, pCreateInfo, format); } -- cgit v1.2.3