vk: Add GetPhysicalDeviceFeatures
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 9 Jul 2015 20:54:08 +0000 (13:54 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 9 Jul 2015 23:14:37 +0000 (16:14 -0700)
include/vulkan/vulkan.h
src/vulkan/device.c

index 5497e069c375d4891b5b003df421a8682cc913cb..4f467bb99acba3d99aa1cc3b917c7a2d405fc711 100644 (file)
@@ -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,
index 85f1cba23dd78763e736a82c2ce5b9f8006e5f7b..7df4374c153da2951f45a2d96e94334fe6d49d6d 100644 (file)
@@ -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,