From 64f4b277ea66cf62ec1bee732e9b1e3dad45b5b1 Mon Sep 17 00:00:00 2001 From: Constantine Shablya Date: Fri, 7 Apr 2023 04:00:13 +0300 Subject: [PATCH] vulkan: inline vk_get_physical_device_features into vk_common_GetPhysicalDeviceFeatures2 Part-of: --- src/vulkan/runtime/vk_physical_device.c | 9 --------- src/vulkan/util/vk_physical_device_features.py | 17 ++++++++--------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/vulkan/runtime/vk_physical_device.c b/src/vulkan/runtime/vk_physical_device.c index 3f0b2ebe288..be55a42c97a 100644 --- a/src/vulkan/runtime/vk_physical_device.c +++ b/src/vulkan/runtime/vk_physical_device.c @@ -117,15 +117,6 @@ vk_common_GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, *pFeatures = features2.features; } -VKAPI_ATTR void VKAPI_CALL -vk_common_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, - VkPhysicalDeviceFeatures2 *pFeatures) -{ - VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice); - - vk_get_physical_device_features(pFeatures, &pdevice->supported_features); -} - VKAPI_ATTR void VKAPI_CALL vk_common_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties *pProperties) diff --git a/src/vulkan/util/vk_physical_device_features.py b/src/vulkan/util/vk_physical_device_features.py index 9aa62653a0a..a971341d1f8 100644 --- a/src/vulkan/util/vk_physical_device_features.py +++ b/src/vulkan/util/vk_physical_device_features.py @@ -128,6 +128,7 @@ class FeatureStruct: TEMPLATE_C = Template(COPYRIGHT + """ /* This file generated from ${filename}, don't edit directly. */ +#include "vk_common_entrypoints.h" #include "vk_log.h" #include "vk_physical_device.h" #include "vk_physical_device_features.h" @@ -274,12 +275,14 @@ vk_set_physical_device_features(struct vk_features *all_features, } } -void -vk_get_physical_device_features(VkPhysicalDeviceFeatures2 *pFeatures, - const struct vk_features *all_features) +VKAPI_ATTR void VKAPI_CALL +vk_common_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures2 *pFeatures) { + VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice); + % for flag in pdev_features: - pFeatures->features.${flag} = all_features->${flag}; + pFeatures->features.${flag} = pdevice->supported_features.${flag}; % endfor vk_foreach_struct(ext, pFeatures) { @@ -288,7 +291,7 @@ vk_get_physical_device_features(VkPhysicalDeviceFeatures2 *pFeatures, case ${f.s_type}: { ${f.c_type} *features = (void *) ext; % for flag in f.features: - features->${flag} = all_features->${get_renamed_feature(f.c_type, flag)}; + features->${flag} = pdevice->supported_features.${get_renamed_feature(f.c_type, flag)}; % endfor break; } @@ -324,10 +327,6 @@ void vk_set_physical_device_features(struct vk_features *all_features, const VkPhysicalDeviceFeatures2 *pFeatures); -void -vk_get_physical_device_features(VkPhysicalDeviceFeatures2 *pFeatures, - const struct vk_features *all_features); - #ifdef __cplusplus } #endif