From: Jason Ekstrand Date: Thu, 9 Jul 2015 23:14:31 +0000 (-0700) Subject: vk: Remove the old GetPhysicalDeviceInfo call X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8c2c37fae74cc40072f103f49e1d9c2c235912f3;p=mesa.git vk: Remove the old GetPhysicalDeviceInfo call --- diff --git a/include/vulkan/vk_wsi_lunarg.h b/include/vulkan/vk_wsi_lunarg.h index 84de8d2c6d1..a439012e2cb 100644 --- a/include/vulkan/vk_wsi_lunarg.h +++ b/include/vulkan/vk_wsi_lunarg.h @@ -37,6 +37,25 @@ extern "C" { #endif // __cplusplus +// This macro defines INT_MAX in enumerations to force compilers to use 32 bits +// to represent them. This may or may not be necessary on some compilers. The +// option to compile it out may allow compilers that warn about missing enumerants +// in switch statements to be silenced. +// Using this macro is not needed for flag bit enums because those aren't used +// as storage type anywhere. +#define VK_MAX_ENUM(Prefix) VK_##Prefix##_MAX_ENUM = 0x7FFFFFFF + +// This macro defines the BEGIN_RANGE, END_RANGE, NUM, and MAX_ENUM constants for +// the enumerations. +#define VK_ENUM_RANGE(Prefix, First, Last) \ + VK_##Prefix##_BEGIN_RANGE = VK_##Prefix##_##First, \ + VK_##Prefix##_END_RANGE = VK_##Prefix##_##Last, \ + VK_NUM_##Prefix = (VK_##Prefix##_END_RANGE - VK_##Prefix##_BEGIN_RANGE + 1), \ + VK_MAX_ENUM(Prefix) + +// This is a helper macro to define the value of flag bit enum values. +#define VK_BIT(bit) (1 << (bit)) + // ------------------------------------------------------------------------------------------------ // Objects diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index d21c56bd191..5ae5f6e781f 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -103,24 +103,6 @@ VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkDynamicDsState, VkDynamicStateObject) VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkFramebuffer, VkNonDispatchable) VK_DEFINE_NONDISP_SUBCLASS_HANDLE(VkRenderPass, VkNonDispatchable) -// This macro defines INT_MAX in enumerations to force compilers to use 32 bits -// to represent them. This may or may not be necessary on some compilers. The -// option to compile it out may allow compilers that warn about missing enumerants -// in switch statements to be silenced. -// Using this macro is not needed for flag bit enums because those aren't used -// as storage type anywhere. -#define VK_MAX_ENUM(Prefix) VK_##Prefix##_MAX_ENUM = 0x7FFFFFFF - -// This macro defines the BEGIN_RANGE, END_RANGE, NUM, and MAX_ENUM constants for -// the enumerations. -#define VK_ENUM_RANGE(Prefix, First, Last) \ - VK_##Prefix##_BEGIN_RANGE = VK_##Prefix##_##First, \ - VK_##Prefix##_END_RANGE = VK_##Prefix##_##Last, \ - VK_NUM_##Prefix = (VK_##Prefix##_END_RANGE - VK_##Prefix##_BEGIN_RANGE + 1), \ - VK_MAX_ENUM(Prefix) - -// This is a helper macro to define the value of flag bit enum values. -#define VK_BIT(bit) (1 << (bit)) typedef enum { VK_SUCCESS = 0, @@ -1095,28 +1077,6 @@ typedef enum { } VkMemoryInputFlagBits; typedef VkFlags VkMemoryInputFlags; -typedef enum { - // Info type for vkGetPhysicalDeviceInfo() - VK_PHYSICAL_DEVICE_INFO_TYPE_PROPERTIES = 0x00000000, - VK_PHYSICAL_DEVICE_INFO_TYPE_PERFORMANCE = 0x00000001, - VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PROPERTIES = 0x00000002, - VK_PHYSICAL_DEVICE_INFO_TYPE_MEMORY_PROPERTIES = 0x00000003, - - VK_ENUM_RANGE(PHYSICAL_DEVICE_INFO_TYPE, PROPERTIES, MEMORY_PROPERTIES) -} VkPhysicalDeviceInfoType; - -// Physical device compatibility flags -typedef VkFlags VkPhysicalDeviceCompatibilityFlags; -typedef enum { - VK_PHYSICAL_DEVICE_COMPATIBILITY_FEATURES_BIT = VK_BIT(0), - VK_PHYSICAL_DEVICE_COMPATIBILITY_IQ_MATCH_BIT = VK_BIT(1), - VK_PHYSICAL_DEVICE_COMPATIBILITY_PEER_TRANSFER_BIT = VK_BIT(2), - VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_MEMORY_BIT = VK_BIT(3), - VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_SYNC_BIT = VK_BIT(4), - VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_DEVICE0_DISPLAY_BIT = VK_BIT(5), - VK_PHYSICAL_DEVICE_COMPATIBILITY_SHARED_DEVICE1_DISPLAY_BIT = VK_BIT(6), -} VkPhysicalDeviceCompatibilityFlagBits; - typedef struct { VkStructureType sType; const void* pNext; @@ -1305,18 +1265,6 @@ typedef struct { uint8_t pipelineCacheUUID[VK_UUID_LENGTH]; } VkPhysicalDeviceProperties; -typedef struct { - float maxDeviceClock; - float aluPerClock; - float texPerClock; - float primsPerClock; - float pixelsPerClock; -} VkPhysicalDevicePerformance; - -typedef struct { - VkPhysicalDeviceCompatibilityFlags compatibilityFlags; -} VkPhysicalDeviceCompatibilityInfo; - typedef struct { VkQueueFlags queueFlags; uint32_t queueCount; @@ -2009,7 +1957,6 @@ typedef VkResult (VKAPI *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCrea typedef VkResult (VKAPI *PFN_vkDestroyInstance)(VkInstance instance); typedef VkResult (VKAPI *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures); -typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceInfo)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceInfoType infoType, size_t* pDataSize, void* pData); typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceFormatInfo)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatInfo); typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceLimits)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits); typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); @@ -2139,12 +2086,6 @@ VkResult VKAPI vkGetPhysicalDeviceFeatures( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures); -VkResult VKAPI vkGetPhysicalDeviceInfo( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceInfoType infoType, - size_t* pDataSize, - void* pData); - VkResult VKAPI vkGetPhysicalDeviceFormatInfo( VkPhysicalDevice physicalDevice, VkFormat format, diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 3cb04a1d4c2..c574c5fdbbc 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -416,78 +416,6 @@ VkResult anv_GetPhysicalDeviceQueueProperties( return VK_SUCCESS; } -VkResult anv_GetPhysicalDeviceInfo( - VkPhysicalDevice physicalDevice, - VkPhysicalDeviceInfoType infoType, - size_t* pDataSize, - void* pData) -{ - VkPhysicalDevicePerformance *performance; - VkPhysicalDeviceQueueProperties *queue_properties; - VkPhysicalDeviceMemoryProperties *memory_properties; - VkDisplayPropertiesWSI *display_properties; - - switch ((uint32_t) infoType) { - case VK_PHYSICAL_DEVICE_INFO_TYPE_PERFORMANCE: - performance = pData; - - *pDataSize = sizeof(*performance); - if (pData == NULL) - return VK_SUCCESS; - - performance->maxDeviceClock = 1.0; - performance->aluPerClock = 1.0; - performance->texPerClock = 1.0; - performance->primsPerClock = 1.0; - performance->pixelsPerClock = 1.0; - return VK_SUCCESS; - - case VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PROPERTIES: - queue_properties = pData; - - *pDataSize = sizeof(*queue_properties); - if (pData == NULL) - return VK_SUCCESS; - - queue_properties->queueFlags = 0; - queue_properties->queueCount = 1; - queue_properties->supportsTimestamps = true; - return VK_SUCCESS; - - case VK_PHYSICAL_DEVICE_INFO_TYPE_MEMORY_PROPERTIES: - memory_properties = pData; - - *pDataSize = sizeof(*memory_properties); - if (pData == NULL) - return VK_SUCCESS; - - memory_properties->supportsMigration = false; - memory_properties->supportsPinning = false; - return VK_SUCCESS; - - case VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI: - anv_finishme("VK_PHYSICAL_DEVICE_INFO_TYPE_DISPLAY_PROPERTIES_WSI"); - - *pDataSize = sizeof(*display_properties); - if (pData == NULL) - return VK_SUCCESS; - - display_properties = pData; - display_properties->display = 0; - display_properties->physicalResolution = (VkExtent2D) { 0, 0 }; - return VK_SUCCESS; - - case VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PRESENT_PROPERTIES_WSI: - anv_finishme("VK_PHYSICAL_DEVICE_INFO_TYPE_QUEUE_PRESENT_PROPERTIES_WSI"); - return VK_SUCCESS; - - - default: - return VK_UNSUPPORTED; - } - -} - PFN_vkVoidFunction anv_GetInstanceProcAddr( VkInstance instance, const char* pName)