VkDeviceQueueCreateInfo *queue_reqs;
VkPhysicalDeviceMemoryProperties memory_props;
+ VkPhysicalDeviceFeatures features;
+ VkPhysicalDeviceLimits limits;
uint32_t device_extension_count;
VkExtensionProperties *device_extensions;
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);
}
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)
}
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);
}
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;