radv: determine if attachment VRS is enabled
When VRS attachment, any depth buffer can potentially be used for VRS. We also have to create a global depth buffer if the app doesn't provide one. 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/10187>
This commit is contained in:

committed by
Marge Bot

parent
9141716481
commit
62033e0cb3
@@ -2683,6 +2683,7 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
|
||||
bool overallocation_disallowed = false;
|
||||
bool custom_border_colors = false;
|
||||
bool vrs_enabled = false;
|
||||
bool attachment_vrs_enabled = false;
|
||||
|
||||
/* Check enabled features */
|
||||
if (pCreateInfo->pEnabledFeatures) {
|
||||
@@ -2722,8 +2723,9 @@ 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 ||
|
||||
vrs->attachmentFragmentShadingRate;
|
||||
attachment_vrs_enabled;
|
||||
break;
|
||||
}
|
||||
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT: {
|
||||
@@ -2782,6 +2784,7 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo *pCr
|
||||
(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);
|
||||
list_inithead(&device->shader_slabs);
|
||||
|
@@ -805,6 +805,9 @@ struct radv_device {
|
||||
/* Whether the driver uses a global BO list. */
|
||||
bool use_global_bo_list;
|
||||
|
||||
/* Whether attachment VRS is enabled. */
|
||||
bool attachment_vrs_enabled;
|
||||
|
||||
/* Whether anisotropy is forced with RADV_TEX_ANISO (-1 is disabled). */
|
||||
int force_aniso;
|
||||
|
||||
|
Reference in New Issue
Block a user