From f6d51f3fd3c2677418de677897c724f1bae12d3a Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 9 Jul 2015 13:54:08 -0700 Subject: [PATCH] vk: Add GetPhysicalDeviceFeatures --- include/vulkan/vulkan.h | 49 +++++++++++++++++++++++++++++++++++++ src/vulkan/device.c | 53 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 5497e069c37..4f467bb99ac 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -1152,6 +1152,50 @@ typedef struct { const char*const* ppEnabledExtensionNames; } VkInstanceCreateInfo; +typedef struct { + bool32_t robustBufferAccess; + bool32_t fullDrawIndexUint32; + bool32_t imageCubeArray; + bool32_t independentBlend; + bool32_t geometryShader; + bool32_t tessellationShader; + bool32_t sampleRateShading; + bool32_t dualSourceBlend; + bool32_t logicOp; + bool32_t instancedDrawIndirect; + bool32_t depthClip; + bool32_t depthBiasClamp; + bool32_t fillModeNonSolid; + bool32_t depthBounds; + bool32_t wideLines; + bool32_t largePoints; + bool32_t textureCompressionETC2; + bool32_t textureCompressionASTC_LDR; + bool32_t textureCompressionBC; + bool32_t pipelineStatisticsQuery; + bool32_t vertexSideEffects; + bool32_t tessellationSideEffects; + bool32_t geometrySideEffects; + bool32_t fragmentSideEffects; + bool32_t shaderTessellationPointSize; + bool32_t shaderGeometryPointSize; + bool32_t shaderTextureGatherExtended; + bool32_t shaderStorageImageExtendedFormats; + bool32_t shaderStorageImageMultisample; + bool32_t shaderStorageBufferArrayConstantIndexing; + bool32_t shaderStorageImageArrayConstantIndexing; + bool32_t shaderUniformBufferArrayDynamicIndexing; + bool32_t shaderSampledImageArrayDynamicIndexing; + bool32_t shaderStorageBufferArrayDynamicIndexing; + bool32_t shaderStorageImageArrayDynamicIndexing; + bool32_t shaderClipDistance; + bool32_t shaderCullDistance; + bool32_t shaderFloat64; + bool32_t shaderInt64; + bool32_t shaderFloat16; + bool32_t shaderInt16; +} VkPhysicalDeviceFeatures; + typedef struct { VkFormatFeatureFlags linearTilingFeatures; VkFormatFeatureFlags optimalTilingFeatures; @@ -1877,6 +1921,7 @@ typedef struct { typedef VkResult (VKAPI *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, VkInstance* pInstance); 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 PFN_vkVoidFunction (VKAPI *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); @@ -1999,6 +2044,10 @@ VkResult VKAPI vkEnumeratePhysicalDevices( uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); +VkResult VKAPI vkGetPhysicalDeviceFeatures( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures* pFeatures); + VkResult VKAPI vkGetPhysicalDeviceInfo( VkPhysicalDevice physicalDevice, VkPhysicalDeviceInfoType infoType, diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 85f1cba23dd..7df4374c153 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -200,6 +200,59 @@ VkResult anv_EnumeratePhysicalDevices( return VK_SUCCESS; } +VkResult anv_GetPhysicalDeviceFeatures( + VkPhysicalDevice physicalDevice, + VkPhysicalDeviceFeatures* pFeatures) +{ + anv_finishme("Get correct values for PhysicalDeviceFeatures"); + + *pFeatures = (VkPhysicalDeviceFeatures) { + .robustBufferAccess = false, + .fullDrawIndexUint32 = false, + .imageCubeArray = false, + .independentBlend = false, + .geometryShader = true, + .tessellationShader = false, + .sampleRateShading = false, + .dualSourceBlend = true, + .logicOp = true, + .instancedDrawIndirect = true, + .depthClip = false, + .depthBiasClamp = false, + .fillModeNonSolid = true, + .depthBounds = false, + .wideLines = true, + .largePoints = true, + .textureCompressionETC2 = true, + .textureCompressionASTC_LDR = true, + .textureCompressionBC = true, + .pipelineStatisticsQuery = true, + .vertexSideEffects = false, + .tessellationSideEffects = false, + .geometrySideEffects = false, + .fragmentSideEffects = false, + .shaderTessellationPointSize = false, + .shaderGeometryPointSize = true, + .shaderTextureGatherExtended = true, + .shaderStorageImageExtendedFormats = false, + .shaderStorageImageMultisample = false, + .shaderStorageBufferArrayConstantIndexing = false, + .shaderStorageImageArrayConstantIndexing = false, + .shaderUniformBufferArrayDynamicIndexing = true, + .shaderSampledImageArrayDynamicIndexing = false, + .shaderStorageBufferArrayDynamicIndexing = false, + .shaderStorageImageArrayDynamicIndexing = false, + .shaderClipDistance = false, + .shaderCullDistance = false, + .shaderFloat64 = false, + .shaderInt64 = false, + .shaderFloat16 = false, + .shaderInt16 = false, + }; + + return VK_SUCCESS; +} + VkResult anv_GetPhysicalDeviceInfo( VkPhysicalDevice physicalDevice, VkPhysicalDeviceInfoType infoType, -- 2.30.2