From 8343dfe05955402d5ee1629fdcc002d00421a68b Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 4 Mar 2021 15:33:19 +1000 Subject: [PATCH] lavapipe: add dummy sampler ycbcr conversion This at least keeps the CTS tests happy. Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/frontends/lavapipe/lvp_device.c | 22 ++++++++++++++++++++ src/gallium/frontends/lavapipe/lvp_formats.c | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index a6e2c60852a..08b951281ff 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -574,6 +574,12 @@ VKAPI_ATTR void VKAPI_CALL lvp_GetPhysicalDeviceFeatures2( features->scalarBlockLayout = true; break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES: { + VkPhysicalDeviceSamplerYcbcrConversionFeatures *features = + (VkPhysicalDeviceSamplerYcbcrConversionFeatures *) ext; + CORE_FEATURE(1, 1, samplerYcbcrConversion); + break; + } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT: { VkPhysicalDeviceHostQueryResetFeaturesEXT *features = (VkPhysicalDeviceHostQueryResetFeaturesEXT *)ext; @@ -1923,6 +1929,22 @@ VKAPI_ATTR void VKAPI_CALL lvp_DestroySampler( vk_free2(&device->vk.alloc, pAllocator, sampler); } +VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateSamplerYcbcrConversionKHR( + VkDevice device, + const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkSamplerYcbcrConversion* pYcbcrConversion) +{ + return VK_ERROR_OUT_OF_HOST_MEMORY; +} + +VKAPI_ATTR void VKAPI_CALL lvp_DestroySamplerYcbcrConversionKHR( + VkDevice device, + VkSamplerYcbcrConversion ycbcrConversion, + const VkAllocationCallbacks* pAllocator) +{ +} + /* vk_icd.h does not declare this function, so we declare it here to * suppress Wmissing-prototypes. */ diff --git a/src/gallium/frontends/lavapipe/lvp_formats.c b/src/gallium/frontends/lavapipe/lvp_formats.c index c2f205c9bda..30a38c20f3e 100644 --- a/src/gallium/frontends/lavapipe/lvp_formats.c +++ b/src/gallium/frontends/lavapipe/lvp_formats.c @@ -427,6 +427,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_GetPhysicalDeviceImageFormatProperties2( LVP_FROM_HANDLE(lvp_physical_device, physical_device, physicalDevice); const VkPhysicalDeviceExternalImageFormatInfo *external_info = NULL; VkExternalImageFormatProperties *external_props = NULL; + VkSamplerYcbcrConversionImageFormatProperties *ycbcr_props = NULL; VkResult result; result = lvp_get_image_format_properties(physical_device, base_info, &base_props->imageFormatProperties); @@ -449,6 +450,9 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_GetPhysicalDeviceImageFormatProperties2( case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES: external_props = (void *) s; break; + case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES: + ycbcr_props = (void *) s; + break; default: break; } @@ -461,6 +465,8 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_GetPhysicalDeviceImageFormatProperties2( .compatibleHandleTypes = 0, }; } + if (ycbcr_props) + ycbcr_props->combinedImageSamplerDescriptorCount = 0; return VK_SUCCESS; }