From 264e770b828386f8b1dc191d3743595a032914a6 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Wed, 29 Sep 2021 11:28:01 +0200 Subject: [PATCH] radv: fix adjusting the frag coord when RADV_FORCE_VRS is enabled force_vrs was always RADV_FORCE_VRS_NONE at that point and the hw workaround was never applied. Found by inspection. Cc: mesa-stable Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: (cherry picked from commit 0c88c5cdc436fecc777b8635fd57fe7e194a5e0a) --- .pick_status.json | 2 +- src/amd/vulkan/radv_device.c | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 251e9d44991..b9664de5e5d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1264,7 +1264,7 @@ "description": "radv: fix adjusting the frag coord when RADV_FORCE_VRS is enabled", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 73039ba766e..f97534bcde6 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -2914,7 +2914,6 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr bool robust_buffer_access2 = false; bool overallocation_disallowed = false; bool custom_border_colors = false; - bool vrs_enabled = false; bool attachment_vrs_enabled = false; /* Check enabled features */ @@ -2956,8 +2955,6 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR: { const VkPhysicalDeviceFragmentShadingRateFeaturesKHR *vrs = (const void *)ext; attachment_vrs_enabled = vrs->attachmentFragmentShadingRate; - vrs_enabled = vrs->pipelineFragmentShadingRate || vrs->primitiveFragmentShadingRate || - attachment_vrs_enabled; break; } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: { @@ -3012,12 +3009,6 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr device->robust_buffer_access = robust_buffer_access || robust_buffer_access2; device->robust_buffer_access2 = robust_buffer_access2; - device->adjust_frag_coord_z = - (vrs_enabled || device->vk.enabled_extensions.KHR_fragment_shading_rate || - device->force_vrs != RADV_FORCE_VRS_NONE) && - (device->physical_device->rad_info.family == CHIP_SIENNA_CICHLID || - device->physical_device->rad_info.family == CHIP_NAVY_FLOUNDER || - device->physical_device->rad_info.family == CHIP_VANGOGH); device->attachment_vrs_enabled = attachment_vrs_enabled; mtx_init(&device->shader_slab_mutex, mtx_plain); @@ -3187,6 +3178,13 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr "(valid values are 2x2, 2x1 and 1x2)\n"); } + device->adjust_frag_coord_z = + (device->vk.enabled_extensions.KHR_fragment_shading_rate || + device->force_vrs != RADV_FORCE_VRS_NONE) && + (device->physical_device->rad_info.family == CHIP_SIENNA_CICHLID || + device->physical_device->rad_info.family == CHIP_NAVY_FLOUNDER || + device->physical_device->rad_info.family == CHIP_VANGOGH); + device->keep_shader_info = keep_shader_info; result = radv_device_init_meta(device); if (result != VK_SUCCESS)