Mesa (master): radv: add support for querying which formats support texture gather LOD
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon May 25 07:25:33 UTC 2020
Module: Mesa
Branch: master
Commit: 2e265b94a2b7a8b681a95d512ad991d6ae3fb69a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e265b94a2b7a8b681a95d512ad991d6ae3fb69a
Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date: Tue May 19 15:05:32 2020 +0200
radv: add support for querying which formats support texture gather LOD
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5147>
---
src/amd/vulkan/radv_formats.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c
index badfcc4f72f..2e753f47be8 100644
--- a/src/amd/vulkan/radv_formats.c
+++ b/src/amd/vulkan/radv_formats.c
@@ -1380,6 +1380,7 @@ VkResult radv_GetPhysicalDeviceImageFormatProperties2(
VkExternalImageFormatProperties *external_props = NULL;
struct VkAndroidHardwareBufferUsageANDROID *android_usage = NULL;
VkSamplerYcbcrConversionImageFormatProperties *ycbcr_props = NULL;
+ VkTextureLODGatherFormatPropertiesAMD *texture_lod_props = NULL;
VkResult result;
VkFormat format = radv_select_android_external_format(base_info->pNext, base_info->format);
@@ -1411,6 +1412,9 @@ VkResult radv_GetPhysicalDeviceImageFormatProperties2(
case VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_USAGE_ANDROID:
android_usage = (void *) s;
break;
+ case VK_STRUCTURE_TYPE_TEXTURE_LOD_GATHER_FORMAT_PROPERTIES_AMD:
+ texture_lod_props = (void *) s;
+ break;
default:
break;
}
@@ -1454,6 +1458,14 @@ VkResult radv_GetPhysicalDeviceImageFormatProperties2(
ycbcr_props->combinedImageSamplerDescriptorCount = vk_format_get_plane_count(format);
}
+ if (texture_lod_props) {
+ if (physical_device->rad_info.chip_class >= GFX9) {
+ texture_lod_props->supportsTextureGatherLODBiasAMD = true;
+ } else {
+ texture_lod_props->supportsTextureGatherLODBiasAMD = !vk_format_is_int(format);
+ }
+ }
+
return VK_SUCCESS;
fail:
More information about the mesa-commit
mailing list