a/vk: Add/update comments

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2332>
This commit is contained in:
Rylie Pavlik 2024-11-05 12:41:08 -06:00
parent 869054403f
commit 7a4ba078d9

View file

@ -1063,6 +1063,13 @@ err_image:
return ret; return ret;
} }
// - vk_csci_get_image_external_handle_type (usually but not always a constant)
// - vk_csci_get_image_external_support
// - vkGetPhysicalDeviceImageFormatProperties2
// - vkCreateImage
// - vkGetImageMemoryRequirements
// - maybe vkGetAndroidHardwareBufferPropertiesANDROID
// - vk_alloc_and_bind_image_memory
XRT_CHECK_RESULT VkResult XRT_CHECK_RESULT VkResult
vk_create_image_from_native(struct vk_bundle *vk, vk_create_image_from_native(struct vk_bundle *vk,
const struct xrt_swapchain_create_info *info, const struct xrt_swapchain_create_info *info,
@ -1078,13 +1085,13 @@ vk_create_image_from_native(struct vk_bundle *vk,
#ifdef XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER #ifdef XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER
/* /*
* Some Vulkan drivers will natively support importing and exporting * Some Vulkan drivers will natively support importing and exporting
* SRGB formats (Qualcomm Adreno) even tho technically that's not intended * SRGB formats (Qualcomm Adreno) even though technically the
* by the AHardwareBuffer since they don't support sRGB formats. * AHardwareBuffer support for sRGB is... awkward (not inherent).
* While others (arm Mali) does not support importing and exporting sRGB * While others (arm Mali) does not support importing and exporting
* formats. So we need to create the image without sRGB and then create * sRGB formats. So we need to create the image without sRGB and
* the image views with sRGB which is allowed by the Vulkan spec. It * then create the image views with sRGB which is allowed by the
* seems to be safe to do with on all drivers, so to reduce the logic * Vulkan spec. It seems to be safe to do with on all drivers,
* do that instead. * so to reduce the logic do that instead.
*/ */
if (image_format == VK_FORMAT_R8G8B8A8_SRGB) { if (image_format == VK_FORMAT_R8G8B8A8_SRGB) {
image_format = VK_FORMAT_R8G8B8A8_UNORM; image_format = VK_FORMAT_R8G8B8A8_UNORM;