From 06220a28e7adef4b4ccb6f3adc6e5b93627c4762 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Tue, 25 Jan 2022 12:49:44 +0100 Subject: [PATCH] v3dv: rework Vulkan 1.2 feature queries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fill them into a VkPhysicalDeviceVulkan12Features struct like we do for Vulkan 1.1, and then read them from there. Reviewed-by: Alejandro PiƱeiro Part-of: --- src/broadcom/vulkan/v3dv_device.c | 42 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index 9444dac0f9c..7282236f15e 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -1085,8 +1085,10 @@ v3dv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, v3dv_GetPhysicalDeviceFeatures(physicalDevice, &pFeatures->features); VkPhysicalDeviceVulkan12Features vk12 = { - .storageBuffer8BitAccess = true, + .hostQueryReset = true, .uniformAndStorageBuffer8BitAccess = true, + .uniformBufferStandardLayout = true, + .storageBuffer8BitAccess = true, .storagePushConstant8 = true, }; @@ -1131,13 +1133,6 @@ v3dv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: { - VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *features = - (VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *)ext; - features->uniformBufferStandardLayout = true; - break; - } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT: { VkPhysicalDevicePrivateDataFeaturesEXT *features = (VkPhysicalDevicePrivateDataFeaturesEXT *)ext; @@ -1180,11 +1175,26 @@ v3dv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: { - VkPhysicalDeviceHostQueryResetFeatures *features = - (void *) ext; + /* Vulkan 1.2 */ + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: { + VkPhysicalDevice8BitStorageFeatures *features = (void *) ext; + features->storageBuffer8BitAccess = vk12.storageBuffer8BitAccess; + features->uniformAndStorageBuffer8BitAccess = + vk12.uniformAndStorageBuffer8BitAccess; + features->storagePushConstant8 = vk12.storagePushConstant8; + break; + } - features->hostQueryReset = true; + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES: { + VkPhysicalDeviceHostQueryResetFeatures *features = (void *) ext; + features->hostQueryReset = vk12.hostQueryReset; + break; + } + + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR: { + VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *features = + (VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR *)ext; + features->uniformBufferStandardLayout = vk12.uniformBufferStandardLayout; break; } @@ -1195,14 +1205,6 @@ v3dv_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, memcpy(features, &vk11, sizeof(VkPhysicalDeviceVulkan11Features)); break; } - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES: { - VkPhysicalDevice8BitStorageFeatures *features = (void *) ext; - features->storageBuffer8BitAccess = vk12.storageBuffer8BitAccess; - features->uniformAndStorageBuffer8BitAccess = - vk12.uniformAndStorageBuffer8BitAccess; - features->storagePushConstant8 = vk12.storagePushConstant8; - break; - } case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES: { VkPhysicalDevice16BitStorageFeatures *features = (void *) ext; features->storageBuffer16BitAccess = vk11.storageBuffer16BitAccess;