From e5405e6400d7bdb550d031bd1153f93ad90f30cb Mon Sep 17 00:00:00 2001 From: Igor Torrente Date: Thu, 27 Jan 2022 06:33:55 -0300 Subject: [PATCH] venus: Exposes VK_EXT_4444_formats extension Allows venus to passthrough the VK_EXT_4444_formats extension to the vulkan client. And add code to the device initialization and feature query functions. Reviewed-by: Chia-I Wu Reviewed-by: Yiwei Zhang Signed-off-by: Igor Torrente Part-of: --- src/virtio/vulkan/vn_physical_device.c | 15 +++++++++++++++ src/virtio/vulkan/vn_physical_device.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/virtio/vulkan/vn_physical_device.c b/src/virtio/vulkan/vn_physical_device.c index e546107805a..e7f23a04f26 100644 --- a/src/virtio/vulkan/vn_physical_device.c +++ b/src/virtio/vulkan/vn_physical_device.c @@ -145,6 +145,15 @@ vn_physical_device_init_features(struct vn_physical_device *physical_dev) local_feats.vulkan_memory_model.pNext = NULL; } + if (physical_dev->renderer_extensions.EXT_4444_formats) { + physical_dev->argb_4444_formats_features.sType = + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT; + physical_dev->argb_4444_formats_features.pNext = + physical_dev->features.pNext; + physical_dev->features.pNext = + &physical_dev->argb_4444_formats_features; + } + if (physical_dev->renderer_extensions.EXT_transform_feedback) { physical_dev->transform_feedback_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT; @@ -963,6 +972,7 @@ vn_physical_device_get_passthrough_extensions( .EXT_shader_viewport_index_layer = true, /* promoted to VK_VERSION_1_3 */ + .EXT_4444_formats = true, .EXT_extended_dynamic_state = true, /* EXT */ #ifndef ANDROID @@ -1638,6 +1648,7 @@ vn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceBufferDeviceAddressFeatures *buffer_device_address; VkPhysicalDeviceVulkanMemoryModelFeatures *vulkan_memory_model; + VkPhysicalDevice4444FormatsFeaturesEXT *argb_4444_formats; VkPhysicalDeviceTransformFeedbackFeaturesEXT *transform_feedback; VkPhysicalDeviceExtendedDynamicStateFeaturesEXT *extended_dynamic_state; } u; @@ -1796,6 +1807,10 @@ vn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, u.vulkan_memory_model->vulkanMemoryModelAvailabilityVisibilityChains = vk12_feats->vulkanMemoryModelAvailabilityVisibilityChains; break; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT: + memcpy(u.argb_4444_formats, &physical_dev->argb_4444_formats_features, + sizeof(physical_dev->argb_4444_formats_features)); + break; case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TRANSFORM_FEEDBACK_FEATURES_EXT: memcpy(u.transform_feedback, &physical_dev->transform_feedback_features, diff --git a/src/virtio/vulkan/vn_physical_device.h b/src/virtio/vulkan/vn_physical_device.h index 8aa6c773cfa..15ab5307c40 100644 --- a/src/virtio/vulkan/vn_physical_device.h +++ b/src/virtio/vulkan/vn_physical_device.h @@ -41,6 +41,7 @@ struct vn_physical_device { VkPhysicalDeviceVulkan11Features vulkan_1_1_features; VkPhysicalDeviceVulkan12Features vulkan_1_2_features; VkPhysicalDeviceTransformFeedbackFeaturesEXT transform_feedback_features; + VkPhysicalDevice4444FormatsFeaturesEXT argb_4444_formats_features; VkPhysicalDeviceExtendedDynamicStateFeaturesEXT extended_dynamic_state_features;