The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/vk: On Android create sRGB images as linear and use views to sample with gamma

+17
+17
src/xrt/auxiliary/vk/vk_helpers.c
··· 668 668 669 669 // This is the format we allocate the image in, can be changed further down. 670 670 VkFormat image_format = (VkFormat)info->format; 671 + 672 + #ifdef XRT_GRAPHICS_BUFFER_HANDLE_IS_AHARDWAREBUFFER 673 + /* 674 + * Some Vulkan drivers will natively support importing and exporting 675 + * SRGB formats (Qualcomm) even tho technically that's not intended 676 + * by the AHardwareBuffer since they don't support sRGB formats. 677 + * While others (Mail) does not support importing and exporting sRGB 678 + * formats. So we need to create the image without sRGB and then create 679 + * the image views with sRGB which is allowed by the Vulkan spec. It 680 + * seems to be safe to do with on all drivers, so to reduce the logic 681 + * do that instead. 682 + */ 683 + if (image_format == VK_FORMAT_R8G8B8A8_SRGB) { 684 + image_format = VK_FORMAT_R8G8B8A8_UNORM; 685 + } 686 + #endif 687 + 671 688 VkImageUsageFlags image_usage = vk_csci_get_image_usage_flags( // 672 689 vk, // 673 690 image_format, //