vulkan.h: Update features/limits structures (#12827, v125)
authorChris Forbes <chrisf@ijw.co.nz>
Sun, 21 Jun 2015 08:09:12 +0000 (20:09 +1200)
committerChris Forbes <chrisf@ijw.co.nz>
Mon, 6 Jul 2015 23:54:54 +0000 (11:54 +1200)
- Add infrastructure in vulkaninfo to dump features/limits. To be filled
  out to dump everything interesting.
- Move existing limits from VkPhysicalDeviceInfo to
  VkPhysicalDeviceLimits, and drop those that no longer exist.
- Adjust the drivers to fill out the above in their new location.
  Other new features/limits still to be exposed by nulldrv and the intel
  ICD.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
demos/vulkaninfo.c
icd/nulldrv/nulldrv.c
include/vulkan.h

index eaac2d1e12fb72052f0eb64cb0e99d3fce7d5bbc..9ea80882b1ba4cb393638a311f1da0f44a2312a8 100644 (file)
@@ -102,6 +102,8 @@ struct app_gpu {
     VkDeviceQueueCreateInfo *queue_reqs;
 
     VkPhysicalDeviceMemoryProperties memory_props;
+    VkPhysicalDeviceFeatures features;
+    VkPhysicalDeviceLimits limits;
 
     uint32_t device_extension_count;
     VkExtensionProperties *device_extensions;
@@ -547,6 +549,14 @@ static void app_gpu_init(struct app_gpu *gpu, uint32_t id, VkPhysicalDevice obj)
     if (err)
         ERR_EXIT(err);
 
+    err = vkGetPhysicalDeviceFeatures(gpu->obj, &gpu->features);
+    if (err)
+        ERR_EXIT(err);
+
+    err = vkGetPhysicalDeviceLimits(gpu->obj, &gpu->limits);
+    if (err)
+        ERR_EXIT(err);
+
     app_dev_init(&gpu->dev, gpu);
     app_dev_init_formats(&gpu->dev);
 }
@@ -628,10 +638,27 @@ static void app_gpu_dump_props(const struct app_gpu *gpu)
     printf("\tdeviceId = 0x%04x\n",                 props->deviceId);
     printf("\tdeviceType = %s\n",                   vk_physical_device_type_string(props->deviceType));
     printf("\tdeviceName = %s\n",                   props->deviceName);
-    printf("\tmaxBoundDescriptorSets = %u\n",       props->maxBoundDescriptorSets);
-    printf("\tmaxThreadGroupSize = %u\n",           props->maxThreadGroupSize);
-    printf("\ttimestampFrequency = %lu\n",          props->timestampFrequency);
-    printf("\tmultiColorAttachmentClears = %u\n",   props->multiColorAttachmentClears);
+}
+
+static void app_gpu_dump_features(const struct app_gpu *gpu)
+{
+    const VkPhysicalDeviceFeatures *features = &gpu->features;
+
+    printf("VkPhysicalDeviceFeatures\n");
+    /* TODO: add interesting features */
+    printf("\tgeometryShader = %u\n",               features->geometryShader);
+}
+
+static void app_gpu_dump_limits(const struct app_gpu *gpu)
+{
+    const VkPhysicalDeviceLimits *limits = &gpu->limits;
+
+    printf("VkPhysicalDeviceLimits\n");
+    /* TODO: add interesting limits */
+    printf("\tmaxInlineMemoryUpdateSize = " PRINTF_SIZE_T_SPECIFIER "\n",   limits->maxInlineMemoryUpdateSize);
+    printf("\tmaxBoundDescriptorSets = %u\n",                               limits->maxBoundDescriptorSets);
+    printf("\tmaxComputeWorkGroupInvocations = %u\n",                       limits->maxComputeWorkGroupInvocations);
+    printf("\ttimestampFrequency = %lu\n",                                  limits->timestampFrequency);
 }
 
 static void app_gpu_dump_perf(const struct app_gpu *gpu)
@@ -725,6 +752,10 @@ static void app_gpu_dump(const struct app_gpu *gpu)
     }
     app_gpu_dump_memory_props(gpu);
     printf("\n");
+    app_gpu_dump_features(gpu);
+    printf("\n");
+    app_gpu_dump_limits(gpu);
+    printf("\n");
     app_dev_dump(&gpu->dev);
 }
 
index 749aee4e0275a57cdd7c796221583d0572de3790..05a8da80218a7fe31cadd4e5fbd67d4910da6fdc 100644 (file)
@@ -1332,10 +1332,6 @@ ICD_EXPORT VkResult VKAPI vkGetPhysicalDeviceProperties(
     pProperties->deviceId = 0;
     pProperties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
     strncpy(pProperties->deviceName, "nulldrv", strlen("nulldrv"));
-    pProperties->maxBoundDescriptorSets = 0;
-    pProperties->maxThreadGroupSize = 0;
-    pProperties->timestampFrequency = 0;
-    pProperties->multiColorAttachmentClears = false;
 
     return ret;
 }
index f4644f5e2127339cd7394e19bc6e2a0c17cf6344..1517d4c819c447cb2c102c68c761387f8a4356b3 100644 (file)
@@ -1201,55 +1201,147 @@ typedef struct VkPhysicalDeviceProperties_
     uint32_t                                    deviceId;
     VkPhysicalDeviceType                        deviceType;
     char                                        deviceName[VK_MAX_PHYSICAL_DEVICE_NAME];
-    uint32_t                                    maxBoundDescriptorSets;
-    uint32_t                                    maxThreadGroupSize;
-    uint64_t                                    timestampFrequency;
-    bool32_t                                    multiColorAttachmentClears;
-    uint32_t                                    maxDescriptorSets;              // at least 2?
-    uint32_t                                    maxViewports;                   // at least 16?
-    uint32_t                                    maxColorAttachments;            // at least 8?
 } VkPhysicalDeviceProperties;
 
 typedef struct VkPhysicalDeviceFeatures_
 {
-    // GFL_32 features
-    bool32_t                                    supportsGeometryShader;
-    bool32_t                                    supportsTessellationShader;
-    bool32_t                                    supportsSampleRateShading;
-    bool32_t                                    supportsFragmentSideEffects;
-    bool32_t                                    supportsConstantStorageBufferArrayIdexing;
-    bool32_t                                    supportsConstantStorageImageArrayIndexing;
-    bool32_t                                    supportsConstantUniformBufferArrayIndexing;
-    bool32_t                                    supportsDynamicSampledImageArrayIndexing;
-    // GFL_45 features
-    bool32_t                                    supportsBlendSrc1;
-    bool32_t                                    supportsClipAndCullDistance;
-    bool32_t                                    supportsLogicOp;
-    bool32_t                                    supportsInstancedDrawIndirect;
-    bool32_t                                    supportsDepthClip;
-    bool32_t                                    supportsFillMode;
-    bool32_t                                    supportsStorageImageExtendedFormats;
-    bool32_t                                    supportsStorageImageMultisample;
-    bool32_t                                    supportsPipelineStatisticsQuery;
-    bool32_t                                    supportsVTGSideEffects;
-    bool32_t                                    supportsDynamicUniformBufferArrayIndexing;
-    // optional features
-    bool32_t                                    supportsDynamicStorageBufferArrayIndexing;
-    bool32_t                                    supportsDynamicStorageImageArrayIndexing;
-    bool32_t                                    supportsShaderFloat64;
-    bool32_t                                    supportsDepthBounds;
-    bool32_t                                    supportsWideLines;
-    bool32_t                                    supportsTextureCompressionETC2;
-    bool32_t                                    supportsTextureCompressionASTC_LDR;
-    bool32_t                                    supportsTextureCompressionBC;
+    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 VkPhysicalDeviceLimits_
 {
-    uint32_t           maxImageDimensions;
-    uint32_t           maxImageDepth;
-    uint32_t           maxImageArrayLayers;
-    // <lots more>
+    uint32_t                                    maxImageDimension1D;
+    uint32_t                                    maxImageDimension2D;
+    uint32_t                                    maxImageDimension3D;
+    uint32_t                                    maxImageDimensionCube;
+    uint32_t                                    maxImageArrayLayers;
+    uint32_t                                    maxTexelBufferSize;
+    uint32_t                                    maxUniformBufferSize;
+    uint32_t                                    maxStorageBufferSize;
+    uint32_t                                    maxPushConstantsSize;
+    uint32_t                                    maxMemoryAllocationCount;
+    VkDeviceSize                                maxInlineMemoryUpdateSize;
+    uint32_t                                    maxBoundDescriptorSets;
+    uint32_t                                    maxDescriptorSets;
+    uint32_t                                    maxPerStageDescriptorSamplers;
+    uint32_t                                    maxPerStageDescriptorUniformBuffers;
+    uint32_t                                    maxPerStageDescriptorStorageBuffers;
+    uint32_t                                    maxPerStageDescriptorSampledImages;
+    uint32_t                                    maxPerStageDescriptorStorageImages;
+    uint32_t                                    maxDescriptorSetSamplers;
+    uint32_t                                    maxDescriptorSetUniformBuffers;
+    uint32_t                                    maxDescriptorSetStorageBuffers;
+    uint32_t                                    maxDescriptorSetSampledImages;
+    uint32_t                                    maxDescriptorSetStorageImages;
+    uint32_t                                    maxVertexInputAttributes;
+    uint32_t                                    maxVertexInputAttributeOffset;
+    uint32_t                                    maxVertexInputBindingStride;
+    uint32_t                                    maxVertexOutputComponents;
+    uint32_t                                    maxTessGenLevel;
+    uint32_t                                    maxTessPatchSize;
+    uint32_t                                    maxTessControlPerVertexInputComponents;
+    uint32_t                                    maxTessControlPerVertexOutputComponents;
+    uint32_t                                    maxTessControlPerPatchOutputComponents;
+    uint32_t                                    maxTessControlTotalOutputComponents;
+    uint32_t                                    maxTessEvaluationInputComponents;
+    uint32_t                                    maxTessEvaluationOutputComponents;
+    uint32_t                                    maxGeometryShaderInvocations;
+    uint32_t                                    maxGeometryInputComponents;
+    uint32_t                                    maxGeometryOutputComponents;
+    uint32_t                                    maxGeometryOutputVertices;
+    uint32_t                                    maxGeometryTotalOutputComponents;
+    uint32_t                                    maxFragmentInputComponents;
+    uint32_t                                    maxFragmentOutputBuffers;
+    uint32_t                                    maxFragmentDualSourceBuffers;
+    uint32_t                                    maxFragmentCombinedOutputResources;
+    uint32_t                                    maxComputeSharedMemorySize;
+    uint32_t                                    maxComputeWorkGroupCount[3];
+    uint32_t                                    maxComputeWorkGroupInvocations;
+    uint32_t                                    maxComputeWorkGroupSize[3];
+    uint32_t                                    subPixelPrecisionBits;
+    uint32_t                                    subTexelPrecisionBits;
+    uint32_t                                    mipmapPrecisionBits;
+    uint32_t                                    maxDrawIndexedIndexValue;
+    uint32_t                                    maxDrawIndirectInstanceCount;
+    bool32_t                                    primitiveRestartForPatches;
+    float                                       maxSamplerLodBias;
+    uint32_t                                    maxSamplerAnisotropy;
+    uint32_t                                    maxViewports;
+    uint32_t                                    maxDynamicViewportStates;
+    uint32_t                                    maxViewportDimensions[2];
+    float                                       viewportBoundsRange[2];
+    uint32_t                                    viewportSubPixelBits;
+    uint32_t                                    minMemoryMapAlignment;
+    uint32_t                                    minTexelBufferOffsetAlignment;
+    uint32_t                                    minUniformBufferOffsetAlignment;
+    uint32_t                                    minStorageBufferOffsetAlignment;
+    uint32_t                                    minTexelOffset;
+    uint32_t                                    maxTexelOffset;
+    uint32_t                                    minTexelGatherOffset;
+    uint32_t                                    maxTexelGatherOffset;
+    uint32_t                                    minInterpolationOffset;
+    uint32_t                                    maxInterpolationOffset;
+    uint32_t                                    subPixelInterpolationOffsetBits;
+    uint32_t                                    maxFramebufferWidth;
+    uint32_t                                    maxFramebufferHeight;
+    uint32_t                                    maxFramebufferLayers;
+    uint32_t                                    maxFramebufferColorSamples;
+    uint32_t                                    maxFramebufferDepthSamples;
+    uint32_t                                    maxFramebufferStencilSamples;
+    uint32_t                                    maxColorAttachments;
+    uint32_t                                    maxSampledImageColorSamples;
+    uint32_t                                    maxSampledImageDepthSamples;
+    uint32_t                                    maxSampledImageIntegerSamples;
+    uint32_t                                    maxStorageImageSamples;
+    uint32_t                                    maxSampleMaskWords;
+    uint64_t                                    timestampFrequency;
+    uint32_t                                    maxClipDistances;
+    uint32_t                                    maxCullDistances;
+    uint32_t                                    maxCombinedClipAndCullDistances;
+    float                                       pointSizeRange[2];
+    float                                       lineWidthRange[2];
+    float                                       pointSizeGranularity;
+    float                                       lineWidthGranularity;
 } VkPhysicalDeviceLimits;