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 <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13098>
(cherry picked from commit 0c88c5cdc4)
This commit is contained in:
Samuel Pitoiset 2021-09-29 11:28:01 +02:00 committed by Dylan Baker
parent a30bee6a14
commit 264e770b82
2 changed files with 8 additions and 10 deletions

View file

@ -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
},

View file

@ -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)