vk/0.210.0: Rework device features and limits
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 3 Dec 2015 00:58:54 +0000 (16:58 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 3 Dec 2015 21:43:54 +0000 (13:43 -0800)
include/vulkan/vulkan.h
src/vulkan/anv_device.c

index 0a9499eadfed3696e58e7a78ea233bedb3afdec4..8036b6126aa6200c389764c5771b8dcc0bcbc942 100644 (file)
@@ -1123,29 +1123,31 @@ typedef struct VkPhysicalDeviceFeatures {
     VkBool32                                    geometryShader;
     VkBool32                                    tessellationShader;
     VkBool32                                    sampleRateShading;
-    VkBool32                                    dualSourceBlend;
+    VkBool32                                    dualSrcBlend;
     VkBool32                                    logicOp;
     VkBool32                                    multiDrawIndirect;
-    VkBool32                                    depthClip;
+    VkBool32                                    depthClamp;
     VkBool32                                    depthBiasClamp;
     VkBool32                                    fillModeNonSolid;
     VkBool32                                    depthBounds;
     VkBool32                                    wideLines;
     VkBool32                                    largePoints;
+    VkBool32                                    alphaToOne;
+    VkBool32                                    multiViewport;
+    VkBool32                                    samplerAnisotropy;
     VkBool32                                    textureCompressionETC2;
     VkBool32                                    textureCompressionASTC_LDR;
     VkBool32                                    textureCompressionBC;
-    VkBool32                                    occlusionQueryNonConservative;
+    VkBool32                                    occlusionQueryPrecise;
     VkBool32                                    pipelineStatisticsQuery;
-    VkBool32                                    vertexSideEffects;
-    VkBool32                                    tessellationSideEffects;
-    VkBool32                                    geometrySideEffects;
-    VkBool32                                    fragmentSideEffects;
-    VkBool32                                    shaderTessellationPointSize;
-    VkBool32                                    shaderGeometryPointSize;
+    VkBool32                                    vertexPipelineStoresAndAtomics;
+    VkBool32                                    fragmentStoresAndAtomics;
+    VkBool32                                    shaderTessellationAndGeometryPointSize;
     VkBool32                                    shaderImageGatherExtended;
     VkBool32                                    shaderStorageImageExtendedFormats;
     VkBool32                                    shaderStorageImageMultisample;
+    VkBool32                                    shaderStorageImageReadWithoutFormat;
+    VkBool32                                    shaderStorageImageWriteWithoutFormat;
     VkBool32                                    shaderUniformBufferArrayDynamicIndexing;
     VkBool32                                    shaderSampledImageArrayDynamicIndexing;
     VkBool32                                    shaderStorageBufferArrayDynamicIndexing;
@@ -1156,8 +1158,7 @@ typedef struct VkPhysicalDeviceFeatures {
     VkBool32                                    shaderInt64;
     VkBool32                                    shaderInt16;
     VkBool32                                    shaderResourceResidency;
-    VkBool32                                    shaderResourceMinLOD;
-    VkBool32                                    alphaToOne;
+    VkBool32                                    shaderResourceMinLod;
     VkBool32                                    sparseBinding;
     VkBool32                                    sparseResidencyBuffer;
     VkBool32                                    sparseResidencyImage2D;
@@ -1167,6 +1168,7 @@ typedef struct VkPhysicalDeviceFeatures {
     VkBool32                                    sparseResidency8Samples;
     VkBool32                                    sparseResidency16Samples;
     VkBool32                                    sparseResidencyAliased;
+    VkBool32                                    variableMultisampleRate;
 } VkPhysicalDeviceFeatures;
 
 typedef struct VkFormatProperties {
@@ -1195,21 +1197,22 @@ typedef struct VkPhysicalDeviceLimits {
     uint32_t                                    maxImageDimension3D;
     uint32_t                                    maxImageDimensionCube;
     uint32_t                                    maxImageArrayLayers;
-    VkSampleCountFlags                          sampleCounts;
-    uint32_t                                    maxTexelBufferSize;
-    uint32_t                                    maxUniformBufferSize;
-    uint32_t                                    maxStorageBufferSize;
+    uint32_t                                    maxTexelBufferElements;
+    uint32_t                                    maxUniformBufferRange;
+    uint32_t                                    maxStorageBufferRange;
     uint32_t                                    maxPushConstantsSize;
     uint32_t                                    maxMemoryAllocationCount;
+    uint32_t                                    maxSamplerAllocationCount;
     VkDeviceSize                                bufferImageGranularity;
     VkDeviceSize                                sparseAddressSpaceSize;
     uint32_t                                    maxBoundDescriptorSets;
-    uint32_t                                    maxDescriptorSets;
     uint32_t                                    maxPerStageDescriptorSamplers;
     uint32_t                                    maxPerStageDescriptorUniformBuffers;
     uint32_t                                    maxPerStageDescriptorStorageBuffers;
     uint32_t                                    maxPerStageDescriptorSampledImages;
     uint32_t                                    maxPerStageDescriptorStorageImages;
+    uint32_t                                    maxPerStageDescriptorInputAttachments;
+    uint32_t                                    maxPerStageResources;
     uint32_t                                    maxDescriptorSetSamplers;
     uint32_t                                    maxDescriptorSetUniformBuffers;
     uint32_t                                    maxDescriptorSetUniformBuffersDynamic;
@@ -1217,27 +1220,28 @@ typedef struct VkPhysicalDeviceLimits {
     uint32_t                                    maxDescriptorSetStorageBuffersDynamic;
     uint32_t                                    maxDescriptorSetSampledImages;
     uint32_t                                    maxDescriptorSetStorageImages;
+    uint32_t                                    maxDescriptorSetInputAttachments;
     uint32_t                                    maxVertexInputAttributes;
     uint32_t                                    maxVertexInputBindings;
     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                                    maxTessellationGenerationLevel;
+    uint32_t                                    maxTessellationPatchSize;
+    uint32_t                                    maxTessellationControlPerVertexInputComponents;
+    uint32_t                                    maxTessellationControlPerVertexOutputComponents;
+    uint32_t                                    maxTessellationControlPerPatchOutputComponents;
+    uint32_t                                    maxTessellationControlTotalOutputComponents;
+    uint32_t                                    maxTessellationEvaluationInputComponents;
+    uint32_t                                    maxTessellationEvaluationOutputComponents;
     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                                    maxFragmentOutputAttachments;
+    uint32_t                                    maxFragmentDualSrcAttachments;
     uint32_t                                    maxFragmentCombinedOutputResources;
     uint32_t                                    maxComputeSharedMemorySize;
     uint32_t                                    maxComputeWorkGroupCount[3];
@@ -1247,21 +1251,20 @@ typedef struct VkPhysicalDeviceLimits {
     uint32_t                                    subTexelPrecisionBits;
     uint32_t                                    mipmapPrecisionBits;
     uint32_t                                    maxDrawIndexedIndexValue;
-    uint32_t                                    maxDrawIndirectInstanceCount;
-    VkBool32                                    primitiveRestartForPatches;
+    uint32_t                                    maxDrawIndirectCount;
     float                                       maxSamplerLodBias;
     float                                       maxSamplerAnisotropy;
     uint32_t                                    maxViewports;
     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;
+    size_t                                      minMemoryMapAlignment;
+    VkDeviceSize                                minTexelBufferOffsetAlignment;
+    VkDeviceSize                                minUniformBufferOffsetAlignment;
+    VkDeviceSize                                minStorageBufferOffsetAlignment;
+    int32_t                                     minTexelOffset;
     uint32_t                                    maxTexelOffset;
-    uint32_t                                    minTexelGatherOffset;
+    int32_t                                     minTexelGatherOffset;
     uint32_t                                    maxTexelGatherOffset;
     float                                       minInterpolationOffset;
     float                                       maxInterpolationOffset;
@@ -1269,23 +1272,31 @@ typedef struct VkPhysicalDeviceLimits {
     uint32_t                                    maxFramebufferWidth;
     uint32_t                                    maxFramebufferHeight;
     uint32_t                                    maxFramebufferLayers;
-    uint32_t                                    maxFramebufferColorSamples;
-    uint32_t                                    maxFramebufferDepthSamples;
-    uint32_t                                    maxFramebufferStencilSamples;
+    VkSampleCountFlags                          framebufferColorSampleCounts;
+    VkSampleCountFlags                          framebufferDepthSampleCounts;
+    VkSampleCountFlags                          framebufferStencilSampleCounts;
+    VkSampleCountFlags                          framebufferNoAttachmentsSampleCounts;
     uint32_t                                    maxColorAttachments;
-    uint32_t                                    maxSampledImageColorSamples;
-    uint32_t                                    maxSampledImageDepthSamples;
-    uint32_t                                    maxSampledImageIntegerSamples;
-    uint32_t                                    maxStorageImageSamples;
+    VkSampleCountFlags                          sampledImageColorSampleCounts;
+    VkSampleCountFlags                          sampledImageIntegerSampleCounts;
+    VkSampleCountFlags                          sampledImageDepthSampleCounts;
+    VkSampleCountFlags                          sampledImageStencilSampleCounts;
+    VkSampleCountFlags                          storageImageSampleCounts;
     uint32_t                                    maxSampleMaskWords;
-    uint64_t                                    timestampFrequency;
+    float                                       timestampPeriod;
     uint32_t                                    maxClipDistances;
     uint32_t                                    maxCullDistances;
     uint32_t                                    maxCombinedClipAndCullDistances;
+    uint32_t                                    discreteQueuePriorities;
     float                                       pointSizeRange[2];
     float                                       lineWidthRange[2];
     float                                       pointSizeGranularity;
     float                                       lineWidthGranularity;
+    VkBool32                                    strictLines;
+    VkBool32                                    standardSampleLocations;
+    VkDeviceSize                                optimalBufferCopyOffsetAlignment;
+    VkDeviceSize                                optimalBufferCopyRowPitchAlignment;
+    VkDeviceSize                                nonCoherentAtomSize;
 } VkPhysicalDeviceLimits;
 
 typedef struct VkPhysicalDeviceSparseProperties {
index 11d97838c9670633c9c73df6773a685a9f127e82..5b300afc0a80ca8c26bf4873576fbb135e034fca 100644 (file)
@@ -324,26 +324,26 @@ void anv_GetPhysicalDeviceFeatures(
       .geometryShader                           = true,
       .tessellationShader                       = false,
       .sampleRateShading                        = false,
-      .dualSourceBlend                          = true,
+      .dualSrcBlend                             = true,
       .logicOp                                  = true,
       .multiDrawIndirect                        = true,
-      .depthClip                                = false,
+      .depthClamp                               = false,
       .depthBiasClamp                           = false,
       .fillModeNonSolid                         = true,
       .depthBounds                              = false,
       .wideLines                                = true,
       .largePoints                              = true,
+      .alphaToOne                               = true,
+      .multiViewport                            = true,
+      .samplerAnisotropy                        = false, /* FINISHME */
       .textureCompressionETC2                   = true,
       .textureCompressionASTC_LDR               = true,
       .textureCompressionBC                     = true,
-      .occlusionQueryNonConservative            = false, /* FINISHME */
+      .occlusionQueryPrecise                    = false, /* FINISHME */
       .pipelineStatisticsQuery                  = true,
-      .vertexSideEffects                        = false,
-      .tessellationSideEffects                  = false,
-      .geometrySideEffects                      = false,
-      .fragmentSideEffects                      = false,
-      .shaderTessellationPointSize              = false,
-      .shaderGeometryPointSize                  = true,
+      .vertexPipelineStoresAndAtomics           = false,
+      .fragmentStoresAndAtomics                 = true,
+      .shaderTessellationAndGeometryPointSize   = true,
       .shaderImageGatherExtended                = true,
       .shaderStorageImageExtendedFormats        = false,
       .shaderStorageImageMultisample            = false,
@@ -351,12 +351,15 @@ void anv_GetPhysicalDeviceFeatures(
       .shaderSampledImageArrayDynamicIndexing   = false,
       .shaderStorageBufferArrayDynamicIndexing  = false,
       .shaderStorageImageArrayDynamicIndexing   = false,
+      .shaderStorageImageReadWithoutFormat      = false,
+      .shaderStorageImageWriteWithoutFormat     = true,
       .shaderClipDistance                       = false,
       .shaderCullDistance                       = false,
       .shaderFloat64                            = false,
       .shaderInt64                              = false,
       .shaderInt16                              = false,
       .alphaToOne                               = true,
+      .variableMultisampleRate                  = false,
    };
 }
 
@@ -369,30 +372,34 @@ void anv_GetPhysicalDeviceProperties(
 
    anv_finishme("Get correct values for VkPhysicalDeviceLimits");
 
+   VkSampleCountFlags sample_counts =
+      VK_SAMPLE_COUNT_1_BIT |
+      VK_SAMPLE_COUNT_2_BIT |
+      VK_SAMPLE_COUNT_4_BIT |
+      VK_SAMPLE_COUNT_8_BIT;
+
    VkPhysicalDeviceLimits limits = {
       .maxImageDimension1D                      = (1 << 14),
       .maxImageDimension2D                      = (1 << 14),
       .maxImageDimension3D                      = (1 << 10),
       .maxImageDimensionCube                    = (1 << 14),
       .maxImageArrayLayers                      = (1 << 10),
-
-      /* Broadwell supports 1, 2, 4, and 8 samples. */
-      .sampleCounts                             = 4,
-
-      .maxTexelBufferSize                       = (1 << 14),
-      .maxUniformBufferSize                     = UINT32_MAX,
-      .maxStorageBufferSize                     = UINT32_MAX,
+      .maxTexelBufferElements                   = (1 << 14),
+      .maxUniformBufferRange                    = UINT32_MAX,
+      .maxStorageBufferRange                    = UINT32_MAX,
       .maxPushConstantsSize                     = MAX_PUSH_CONSTANTS_SIZE,
       .maxMemoryAllocationCount                 = UINT32_MAX,
+      .maxSamplerAllocationCount                = UINT32_MAX,
       .bufferImageGranularity                   = 64, /* A cache line */
       .sparseAddressSpaceSize                   = 0,
       .maxBoundDescriptorSets                   = MAX_SETS,
-      .maxDescriptorSets                        = UINT32_MAX,
       .maxPerStageDescriptorSamplers            = 64,
       .maxPerStageDescriptorUniformBuffers      = 64,
       .maxPerStageDescriptorStorageBuffers      = 64,
       .maxPerStageDescriptorSampledImages       = 64,
       .maxPerStageDescriptorStorageImages       = 64,
+      .maxPerStageDescriptorInputAttachments    = 64,
+      .maxPerStageResources                     = 128,
       .maxDescriptorSetSamplers                 = 256,
       .maxDescriptorSetUniformBuffers           = 256,
       .maxDescriptorSetUniformBuffersDynamic    = 256,
@@ -400,27 +407,28 @@ void anv_GetPhysicalDeviceProperties(
       .maxDescriptorSetStorageBuffersDynamic    = 256,
       .maxDescriptorSetSampledImages            = 256,
       .maxDescriptorSetStorageImages            = 256,
+      .maxDescriptorSetInputAttachments         = 256,
       .maxVertexInputAttributes                 = 32,
       .maxVertexInputBindings                   = 32,
       .maxVertexInputAttributeOffset            = 256,
       .maxVertexInputBindingStride              = 256,
       .maxVertexOutputComponents                = 32,
-      .maxTessGenLevel                          = 0,
-      .maxTessPatchSize                         = 0,
-      .maxTessControlPerVertexInputComponents   = 0,
-      .maxTessControlPerVertexOutputComponents  = 0,
-      .maxTessControlPerPatchOutputComponents   = 0,
-      .maxTessControlTotalOutputComponents      = 0,
-      .maxTessEvaluationInputComponents         = 0,
-      .maxTessEvaluationOutputComponents        = 0,
+      .maxTessellationGenerationLevel           = 0,
+      .maxTessellationPatchSize                 = 0,
+      .maxTessellationControlPerVertexInputComponents = 0,
+      .maxTessellationControlPerVertexOutputComponents = 0,
+      .maxTessellationControlPerPatchOutputComponents = 0,
+      .maxTessellationControlTotalOutputComponents = 0,
+      .maxTessellationEvaluationInputComponents = 0,
+      .maxTessellationEvaluationOutputComponents = 0,
       .maxGeometryShaderInvocations             = 6,
       .maxGeometryInputComponents               = 16,
       .maxGeometryOutputComponents              = 16,
       .maxGeometryOutputVertices                = 16,
       .maxGeometryTotalOutputComponents         = 16,
       .maxFragmentInputComponents               = 16,
-      .maxFragmentOutputBuffers                 = 8,
-      .maxFragmentDualSourceBuffers             = 2,
+      .maxFragmentOutputAttachments             = 8,
+      .maxFragmentDualSrcAttachments            = 2,
       .maxFragmentCombinedOutputResources       = 8,
       .maxComputeSharedMemorySize               = 1024,
       .maxComputeWorkGroupCount = {
@@ -438,8 +446,7 @@ void anv_GetPhysicalDeviceProperties(
       .subTexelPrecisionBits                    = 4 /* FIXME */,
       .mipmapPrecisionBits                      = 4 /* FIXME */,
       .maxDrawIndexedIndexValue                 = UINT32_MAX,
-      .maxDrawIndirectInstanceCount             = UINT32_MAX,
-      .primitiveRestartForPatches               = UINT32_MAX,
+      .maxDrawIndirectCount                     = UINT32_MAX,
       .maxSamplerLodBias                        = 16,
       .maxSamplerAnisotropy                     = 16,
       .maxViewports                             = MAX_VIEWPORTS,
@@ -460,23 +467,31 @@ void anv_GetPhysicalDeviceProperties(
       .maxFramebufferWidth                      = (1 << 14),
       .maxFramebufferHeight                     = (1 << 14),
       .maxFramebufferLayers                     = (1 << 10),
-      .maxFramebufferColorSamples               = 8,
-      .maxFramebufferDepthSamples               = 8,
-      .maxFramebufferStencilSamples             = 8,
+      .framebufferColorSampleCounts             = sample_counts,
+      .framebufferDepthSampleCounts             = sample_counts,
+      .framebufferStencilSampleCounts           = sample_counts,
+      .framebufferNoAttachmentsSampleCounts     = sample_counts,
       .maxColorAttachments                      = MAX_RTS,
-      .maxSampledImageColorSamples              = 8,
-      .maxSampledImageDepthSamples              = 8,
-      .maxSampledImageIntegerSamples            = 1,
-      .maxStorageImageSamples                   = 1,
+      .sampledImageColorSampleCounts            = sample_counts,
+      .sampledImageIntegerSampleCounts          = VK_SAMPLE_COUNT_1_BIT,
+      .sampledImageDepthSampleCounts            = sample_counts,
+      .sampledImageStencilSampleCounts          = sample_counts,
+      .storageImageSampleCounts                 = VK_SAMPLE_COUNT_1_BIT,
       .maxSampleMaskWords                       = 1,
-      .timestampFrequency                       = 1000 * 1000 * 1000 / 80,
+      .timestampPeriod                          = 80.0 / (1000 * 1000 * 1000),
       .maxClipDistances                         = 0 /* FIXME */,
       .maxCullDistances                         = 0 /* FIXME */,
       .maxCombinedClipAndCullDistances          = 0 /* FIXME */,
+      .discreteQueuePriorities                  = 1,
       .pointSizeRange                           = { 0.125, 255.875 },
       .lineWidthRange                           = { 0.0, 7.9921875 },
       .pointSizeGranularity                     = (1.0 / 8.0),
       .lineWidthGranularity                     = (1.0 / 128.0),
+      .strictLines                              = false, /* FINISHME */
+      .standardSampleLocations                  = true, /* FINISHME */
+      .optimalBufferCopyOffsetAlignment         = 128,
+      .optimalBufferCopyRowPitchAlignment       = 128,
+      .nonCoherentAtomSize                      = 64,
    };
 
    *pProperties = (VkPhysicalDeviceProperties) {