summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2021-03-22 17:55:40 +0100
committerMarge Bot <eric+marge@anholt.net>2021-04-14 09:31:13 +0000
commit62033e0cb33fde06bb634cd18f02ec22a63cda47 (patch)
treecebf670bc082d0e3630e2395cff5d70c0e5f3f6f
parent914171648148819c88932da3a207fe36ba81415b (diff)
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>
-rw-r--r--src/amd/vulkan/radv_device.c5
-rw-r--r--src/amd/vulkan/radv_private.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 02191d22a1f..e51e14a0099 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -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);
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 72f8601800a..3bb1bbc8752 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -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;