Skip to content

Instantly share code, notes, and snippets.

@expipiplus1
Created April 3, 2020 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save expipiplus1/9a1e461a8b1a76a25af0cd0da99f2ae4 to your computer and use it in GitHub Desktop.
Save expipiplus1/9a1e461a8b1a76a25af0cd0da99f2ae4 to your computer and use it in GitHub Desktop.
module Main
where
import Graphics.Vulkan.Zero
import Graphics.Vulkan.Core10
import Graphics.Vulkan.Core11
import Graphics.Vulkan.Core12
import Graphics.Vulkan.Extensions
import Text.Pretty.Simple
import Data.Foldable
main :: IO ()
main = withInstance zero Nothing $ \i -> do
(_, devices) <- enumeratePhysicalDevices i
traverse_ deviceInfo devices
deviceInfo :: PhysicalDevice -> IO ()
deviceInfo p =
pPrintNoColor
=<< getPhysicalDeviceProperties2
@'[ PhysicalDevicePushDescriptorPropertiesKHR
, PhysicalDeviceDriverProperties
, PhysicalDeviceIDProperties
, PhysicalDeviceMultiviewProperties
, PhysicalDeviceDiscardRectanglePropertiesEXT
, PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX
, PhysicalDeviceSubgroupProperties
, PhysicalDevicePointClippingProperties
, PhysicalDeviceProtectedMemoryProperties
, PhysicalDeviceSamplerFilterMinmaxProperties
, PhysicalDeviceSampleLocationsPropertiesEXT
, PhysicalDeviceBlendOperationAdvancedPropertiesEXT
, PhysicalDeviceInlineUniformBlockPropertiesEXT
, PhysicalDeviceMaintenance3Properties
, PhysicalDeviceFloatControlsProperties
, PhysicalDeviceExternalMemoryHostPropertiesEXT
, PhysicalDeviceConservativeRasterizationPropertiesEXT
, PhysicalDeviceShaderCorePropertiesAMD
, PhysicalDeviceShaderCoreProperties2AMD
, PhysicalDeviceDescriptorIndexingProperties
, PhysicalDeviceTimelineSemaphoreProperties
, PhysicalDeviceVertexAttributeDivisorPropertiesEXT
, PhysicalDevicePCIBusInfoPropertiesEXT
, PhysicalDeviceDepthStencilResolveProperties
, PhysicalDeviceTransformFeedbackPropertiesEXT
, PhysicalDeviceShadingRateImagePropertiesNV
, PhysicalDeviceMeshShaderPropertiesNV
, PhysicalDeviceRayTracingPropertiesNV
, PhysicalDeviceFragmentDensityMapPropertiesEXT
, PhysicalDeviceCooperativeMatrixPropertiesNV
, PhysicalDevicePerformanceQueryPropertiesKHR
, PhysicalDeviceShaderSMBuiltinsPropertiesNV
, PhysicalDeviceTexelBufferAlignmentPropertiesEXT
, PhysicalDeviceSubgroupSizeControlPropertiesEXT
, PhysicalDeviceLineRasterizationPropertiesEXT
, PhysicalDeviceVulkan11Properties
, PhysicalDeviceVulkan12Properties
]
p
PhysicalDeviceProperties2
{ next =
( PhysicalDevicePushDescriptorPropertiesKHR { maxPushDescriptors = 0 }
,
( PhysicalDeviceDriverProperties
{ driverID = DRIVER_ID_GOOGLE_SWIFTSHADER
, driverName = "SwiftShader driver"
, driverInfo = ""
, conformanceVersion = ConformanceVersion
{ major = 1
, minor = 1
, subminor = 3
, patch = 3
}
}
,
( PhysicalDeviceIDProperties
{ deviceUUID = "SwiftShaderUUID"
, driverUUID = "@"
, deviceLUID = ""
, deviceNodeMask = 0
, deviceLUIDValid = False
}
,
( PhysicalDeviceMultiviewProperties
{ maxMultiviewViewCount = 6
, maxMultiviewInstanceIndex = 134217728
}
,
( PhysicalDeviceDiscardRectanglePropertiesEXT { maxDiscardRectangles = 0 }
,
( PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX { perViewPositionAllComponents = False }
,
( PhysicalDeviceSubgroupProperties
{ subgroupSize = 4
, supportedStages = ShaderStageFlagBits 0x31
, supportedOperations = SubgroupFeatureFlagBits 0x3f
, quadOperationsInAllStages = False
}
,
( PhysicalDevicePointClippingProperties { pointClippingBehavior = POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES }
,
( PhysicalDeviceProtectedMemoryProperties { protectedNoFault = False }
,
( PhysicalDeviceSamplerFilterMinmaxProperties
{ filterMinmaxSingleComponentFormats = False
, filterMinmaxImageComponentMapping = False
}
,
( PhysicalDeviceSampleLocationsPropertiesEXT
{ sampleLocationSampleCounts = SampleCountFlagBits 0x0
, maxSampleLocationGridSize = Extent2D
{ width = 0
, height = 0
}
, sampleLocationCoordinateRange =
( 0.0
, 0.0
)
, sampleLocationSubPixelBits = 0
, variableSampleLocations = False
}
,
( PhysicalDeviceBlendOperationAdvancedPropertiesEXT
{ advancedBlendMaxColorAttachments = 0
, advancedBlendIndependentBlend = False
, advancedBlendNonPremultipliedSrcColor = False
, advancedBlendNonPremultipliedDstColor = False
, advancedBlendCorrelatedOverlap = False
, advancedBlendAllOperations = False
}
,
( PhysicalDeviceInlineUniformBlockPropertiesEXT
{ maxInlineUniformBlockSize = 0
, maxPerStageDescriptorInlineUniformBlocks = 0
, maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks = 0
, maxDescriptorSetInlineUniformBlocks = 0
, maxDescriptorSetUpdateAfterBindInlineUniformBlocks = 0
}
,
( PhysicalDeviceMaintenance3Properties
{ maxPerSetDescriptors = 1024
, maxMemoryAllocationSize = 1073741824
}
,
( PhysicalDeviceFloatControlsProperties
{ denormBehaviorIndependence = SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY
, roundingModeIndependence = SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY
, shaderSignedZeroInfNanPreserveFloat16 = False
, shaderSignedZeroInfNanPreserveFloat32 = False
, shaderSignedZeroInfNanPreserveFloat64 = False
, shaderDenormPreserveFloat16 = False
, shaderDenormPreserveFloat32 = False
, shaderDenormPreserveFloat64 = False
, shaderDenormFlushToZeroFloat16 = False
, shaderDenormFlushToZeroFloat32 = False
, shaderDenormFlushToZeroFloat64 = False
, shaderRoundingModeRTEFloat16 = False
, shaderRoundingModeRTEFloat32 = False
, shaderRoundingModeRTEFloat64 = False
, shaderRoundingModeRTZFloat16 = False
, shaderRoundingModeRTZFloat32 = False
, shaderRoundingModeRTZFloat64 = False
}
,
( PhysicalDeviceExternalMemoryHostPropertiesEXT { minImportedHostPointerAlignment = 16 }
,
( PhysicalDeviceConservativeRasterizationPropertiesEXT
{ primitiveOverestimationSize = 0.0
, maxExtraPrimitiveOverestimationSize = 0.0
, extraPrimitiveOverestimationSizeGranularity = 0.0
, primitiveUnderestimation = False
, conservativePointAndLineRasterization = False
, degenerateTrianglesRasterized = False
, degenerateLinesRasterized = False
, fullyCoveredFragmentShaderInputVariable = False
, conservativeRasterizationPostDepthCoverage = False
}
,
( PhysicalDeviceShaderCorePropertiesAMD
{ shaderEngineCount = 0
, shaderArraysPerEngineCount = 0
, computeUnitsPerShaderArray = 0
, simdPerComputeUnit = 0
, wavefrontsPerSimd = 0
, wavefrontSize = 0
, sgprsPerSimd = 0
, minSgprAllocation = 0
, maxSgprAllocation = 0
, sgprAllocationGranularity = 0
, vgprsPerSimd = 0
, minVgprAllocation = 0
, maxVgprAllocation = 0
, vgprAllocationGranularity = 0
}
,
( PhysicalDeviceShaderCoreProperties2AMD
{ shaderCoreFeatures = ShaderCorePropertiesFlagBitsAMD 0x0
, activeComputeUnitCount = 0
}
,
( PhysicalDeviceDescriptorIndexingProperties
{ maxUpdateAfterBindDescriptorsInAllPools = 0
, shaderUniformBufferArrayNonUniformIndexingNative = False
, shaderSampledImageArrayNonUniformIndexingNative = False
, shaderStorageBufferArrayNonUniformIndexingNative = False
, shaderStorageImageArrayNonUniformIndexingNative = False
, shaderInputAttachmentArrayNonUniformIndexingNative = False
, robustBufferAccessUpdateAfterBind = False
, quadDivergentImplicitLod = False
, maxPerStageDescriptorUpdateAfterBindSamplers = 0
, maxPerStageDescriptorUpdateAfterBindUniformBuffers = 0
, maxPerStageDescriptorUpdateAfterBindStorageBuffers = 0
, maxPerStageDescriptorUpdateAfterBindSampledImages = 0
, maxPerStageDescriptorUpdateAfterBindStorageImages = 0
, maxPerStageDescriptorUpdateAfterBindInputAttachments = 0
, maxPerStageUpdateAfterBindResources = 0
, maxDescriptorSetUpdateAfterBindSamplers = 0
, maxDescriptorSetUpdateAfterBindUniformBuffers = 0
, maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = 0
, maxDescriptorSetUpdateAfterBindStorageBuffers = 0
, maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = 0
, maxDescriptorSetUpdateAfterBindSampledImages = 0
, maxDescriptorSetUpdateAfterBindStorageImages = 0
, maxDescriptorSetUpdateAfterBindInputAttachments = 0
}
,
( PhysicalDeviceTimelineSemaphoreProperties { maxTimelineSemaphoreValueDifference = 0 }
,
( PhysicalDeviceVertexAttributeDivisorPropertiesEXT { maxVertexAttribDivisor = 0 }
,
( PhysicalDevicePCIBusInfoPropertiesEXT
{ pciDomain = 0
, pciBus = 0
, pciDevice = 0
, pciFunction = 0
}
,
( PhysicalDeviceDepthStencilResolveProperties
{ supportedDepthResolveModes = RESOLVE_MODE_NONE
, supportedStencilResolveModes = RESOLVE_MODE_NONE
, independentResolveNone = False
, independentResolve = False
}
,
( PhysicalDeviceTransformFeedbackPropertiesEXT
{ maxTransformFeedbackStreams = 0
, maxTransformFeedbackBuffers = 0
, maxTransformFeedbackBufferSize = 0
, maxTransformFeedbackStreamDataSize = 0
, maxTransformFeedbackBufferDataSize = 0
, maxTransformFeedbackBufferDataStride = 0
, transformFeedbackQueries = False
, transformFeedbackStreamsLinesTriangles = False
, transformFeedbackRasterizationStreamSelect = False
, transformFeedbackDraw = False
}
,
( PhysicalDeviceShadingRateImagePropertiesNV
{ shadingRateTexelSize = Extent2D
{ width = 0
, height = 0
}
, shadingRatePaletteSize = 0
, shadingRateMaxCoarseSamples = 0
}
,
( PhysicalDeviceMeshShaderPropertiesNV
{ maxDrawMeshTasksCount = 0
, maxTaskWorkGroupInvocations = 0
, maxTaskWorkGroupSize =
( 0
, 0
, 0
)
, maxTaskTotalMemorySize = 0
, maxTaskOutputCount = 0
, maxMeshWorkGroupInvocations = 0
, maxMeshWorkGroupSize =
( 0
, 0
, 0
)
, maxMeshTotalMemorySize = 0
, maxMeshOutputVertices = 0
, maxMeshOutputPrimitives = 0
, maxMeshMultiviewViewCount = 0
, meshOutputPerVertexGranularity = 0
, meshOutputPerPrimitiveGranularity = 0
}
,
( PhysicalDeviceRayTracingPropertiesNV
{ shaderGroupHandleSize = 0
, maxRecursionDepth = 0
, maxShaderGroupStride = 0
, shaderGroupBaseAlignment = 0
, maxGeometryCount = 0
, maxInstanceCount = 0
, maxTriangleCount = 0
, maxDescriptorSetAccelerationStructures = 0
}
,
( PhysicalDeviceFragmentDensityMapPropertiesEXT
{ minFragmentDensityTexelSize = Extent2D
{ width = 0
, height = 0
}
, maxFragmentDensityTexelSize = Extent2D
{ width = 0
, height = 0
}
, fragmentDensityInvocations = False
}
,
( PhysicalDeviceCooperativeMatrixPropertiesNV { cooperativeMatrixSupportedStages = ShaderStageFlagBits 0x0 }
,
( PhysicalDevicePerformanceQueryPropertiesKHR { allowCommandBufferQueryCopies = False }
,
( PhysicalDeviceShaderSMBuiltinsPropertiesNV
{ shaderSMCount = 0
, shaderWarpsPerSM = 0
}
,
( PhysicalDeviceTexelBufferAlignmentPropertiesEXT
{ storageTexelBufferOffsetAlignmentBytes = 0
, storageTexelBufferOffsetSingleTexelAlignment = False
, uniformTexelBufferOffsetAlignmentBytes = 0
, uniformTexelBufferOffsetSingleTexelAlignment = False
}
,
( PhysicalDeviceSubgroupSizeControlPropertiesEXT
{ minSubgroupSize = 0
, maxSubgroupSize = 0
, maxComputeWorkgroupSubgroups = 0
, requiredSubgroupSizeStages = ShaderStageFlagBits 0x0
}
,
( PhysicalDeviceLineRasterizationPropertiesEXT { lineSubPixelPrecisionBits = 4 }
,
( PhysicalDeviceVulkan11Properties
{ deviceUUID = ""
, driverUUID = ""
, deviceLUID = ""
, deviceNodeMask = 0
, deviceLUIDValid = False
, subgroupSize = 0
, subgroupSupportedStages = ShaderStageFlagBits 0x0
, subgroupSupportedOperations = SubgroupFeatureFlagBits 0x0
, subgroupQuadOperationsInAllStages = False
, pointClippingBehavior = POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES
, maxMultiviewViewCount = 0
, maxMultiviewInstanceIndex = 0
, protectedNoFault = False
, maxPerSetDescriptors = 0
, maxMemoryAllocationSize = 0
}
,
( PhysicalDeviceVulkan12Properties
{ driverID = DriverId 0
, driverName = ""
, driverInfo = ""
, conformanceVersion = ConformanceVersion
{ major = 0
, minor = 0
, subminor = 0
, patch = 0
}
, denormBehaviorIndependence = SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY
, roundingModeIndependence = SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY
, shaderSignedZeroInfNanPreserveFloat16 = False
, shaderSignedZeroInfNanPreserveFloat32 = False
, shaderSignedZeroInfNanPreserveFloat64 = False
, shaderDenormPreserveFloat16 = False
, shaderDenormPreserveFloat32 = False
, shaderDenormPreserveFloat64 = False
, shaderDenormFlushToZeroFloat16 = False
, shaderDenormFlushToZeroFloat32 = False
, shaderDenormFlushToZeroFloat64 = False
, shaderRoundingModeRTEFloat16 = False
, shaderRoundingModeRTEFloat32 = False
, shaderRoundingModeRTEFloat64 = False
, shaderRoundingModeRTZFloat16 = False
, shaderRoundingModeRTZFloat32 = False
, shaderRoundingModeRTZFloat64 = False
, maxUpdateAfterBindDescriptorsInAllPools = 0
, shaderUniformBufferArrayNonUniformIndexingNative = False
, shaderSampledImageArrayNonUniformIndexingNative = False
, shaderStorageBufferArrayNonUniformIndexingNative = False
, shaderStorageImageArrayNonUniformIndexingNative = False
, shaderInputAttachmentArrayNonUniformIndexingNative = False
, robustBufferAccessUpdateAfterBind = False
, quadDivergentImplicitLod = False
, maxPerStageDescriptorUpdateAfterBindSamplers = 0
, maxPerStageDescriptorUpdateAfterBindUniformBuffers = 0
, maxPerStageDescriptorUpdateAfterBindStorageBuffers = 0
, maxPerStageDescriptorUpdateAfterBindSampledImages = 0
, maxPerStageDescriptorUpdateAfterBindStorageImages = 0
, maxPerStageDescriptorUpdateAfterBindInputAttachments = 0
, maxPerStageUpdateAfterBindResources = 0
, maxDescriptorSetUpdateAfterBindSamplers = 0
, maxDescriptorSetUpdateAfterBindUniformBuffers = 0
, maxDescriptorSetUpdateAfterBindUniformBuffersDynamic = 0
, maxDescriptorSetUpdateAfterBindStorageBuffers = 0
, maxDescriptorSetUpdateAfterBindStorageBuffersDynamic = 0
, maxDescriptorSetUpdateAfterBindSampledImages = 0
, maxDescriptorSetUpdateAfterBindStorageImages = 0
, maxDescriptorSetUpdateAfterBindInputAttachments = 0
, supportedDepthResolveModes = RESOLVE_MODE_NONE
, supportedStencilResolveModes = RESOLVE_MODE_NONE
, independentResolveNone = False
, independentResolve = False
, filterMinmaxSingleComponentFormats = False
, filterMinmaxImageComponentMapping = False
, maxTimelineSemaphoreValueDifference = 0
, framebufferIntegerColorSampleCounts = SampleCountFlagBits 0x0
}
, ()
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
)
, properties = PhysicalDeviceProperties
{ apiVersion = 4198400
, driverVersion = 20971520
, vendorID = 6880
, deviceID = 49374
, deviceType = PHYSICAL_DEVICE_TYPE_CPU
, deviceName = "SwiftShader Device (LLVM 7.0.1)"
, pipelineCacheUUID = "SwiftShaderUUID"
, limits = PhysicalDeviceLimits
{ maxImageDimension1D = 8192
, maxImageDimension2D = 8192
, maxImageDimension3D = 1024
, maxImageDimensionCube = 8192
, maxImageArrayLayers = 2048
, maxTexelBufferElements = 65536
, maxUniformBufferRange = 16384
, maxStorageBufferRange = 134217728
, maxPushConstantsSize = 128
, maxMemoryAllocationCount = 4096
, maxSamplerAllocationCount = 4000
, bufferImageGranularity = 131072
, sparseAddressSpaceSize = 0
, maxBoundDescriptorSets = 4
, maxPerStageDescriptorSamplers = 16
, maxPerStageDescriptorUniformBuffers = 14
, maxPerStageDescriptorStorageBuffers = 16
, maxPerStageDescriptorSampledImages = 16
, maxPerStageDescriptorStorageImages = 4
, maxPerStageDescriptorInputAttachments = 4
, maxPerStageResources = 128
, maxDescriptorSetSamplers = 96
, maxDescriptorSetUniformBuffers = 72
, maxDescriptorSetUniformBuffersDynamic = 8
, maxDescriptorSetStorageBuffers = 24
, maxDescriptorSetStorageBuffersDynamic = 4
, maxDescriptorSetSampledImages = 96
, maxDescriptorSetStorageImages = 24
, maxDescriptorSetInputAttachments = 4
, maxVertexInputAttributes = 16
, maxVertexInputBindings = 16
, maxVertexInputAttributeOffset = 2047
, maxVertexInputBindingStride = 2048
, maxVertexOutputComponents = 128
, maxTessellationGenerationLevel = 0
, maxTessellationPatchSize = 0
, maxTessellationControlPerVertexInputComponents = 0
, maxTessellationControlPerVertexOutputComponents = 0
, maxTessellationControlPerPatchOutputComponents = 0
, maxTessellationControlTotalOutputComponents = 0
, maxTessellationEvaluationInputComponents = 0
, maxTessellationEvaluationOutputComponents = 0
, maxGeometryShaderInvocations = 0
, maxGeometryInputComponents = 0
, maxGeometryOutputComponents = 0
, maxGeometryOutputVertices = 0
, maxGeometryTotalOutputComponents = 0
, maxFragmentInputComponents = 128
, maxFragmentOutputAttachments = 4
, maxFragmentDualSrcAttachments = 1
, maxFragmentCombinedOutputResources = 4
, maxComputeSharedMemorySize = 16384
, maxComputeWorkGroupCount =
( 65535
, 65535
, 65535
)
, maxComputeWorkGroupInvocations = 128
, maxComputeWorkGroupSize =
( 128
, 128
, 64
)
, subPixelPrecisionBits = 4
, subTexelPrecisionBits = 4
, mipmapPrecisionBits = 4
, maxDrawIndexedIndexValue = 4294967295
, maxDrawIndirectCount = 4294967295
, maxSamplerLodBias = 15.0
, maxSamplerAnisotropy = 16.0
, maxViewports = 16
, maxViewportDimensions =
( 4096
, 4096
)
, viewportBoundsRange =
( -8192.0
, 8191.0
)
, viewportSubPixelBits = 0
, minMemoryMapAlignment = 64
, minTexelBufferOffsetAlignment = 256
, minUniformBufferOffsetAlignment = 256
, minStorageBufferOffsetAlignment = 256
, minTexelOffset = -8
, maxTexelOffset = 7
, minTexelGatherOffset = -8
, maxTexelGatherOffset = 7
, minInterpolationOffset = -0.5
, maxInterpolationOffset = 0.5
, subPixelInterpolationOffsetBits = 4
, maxFramebufferWidth = 4096
, maxFramebufferHeight = 4096
, maxFramebufferLayers = 256
, framebufferColorSampleCounts = SampleCountFlagBits 0x5
, framebufferDepthSampleCounts = SampleCountFlagBits 0x5
, framebufferStencilSampleCounts = SampleCountFlagBits 0x5
, framebufferNoAttachmentsSampleCounts = SampleCountFlagBits 0x5
, maxColorAttachments = 4
, sampledImageColorSampleCounts = SampleCountFlagBits 0x5
, sampledImageIntegerSampleCounts = SampleCountFlagBits 0x5
, sampledImageDepthSampleCounts = SampleCountFlagBits 0x5
, sampledImageStencilSampleCounts = SampleCountFlagBits 0x5
, storageImageSampleCounts = SAMPLE_COUNT_1_BIT
, maxSampleMaskWords = 1
, timestampComputeAndGraphics = False
, timestampPeriod = 60.0
, maxClipDistances = 8
, maxCullDistances = 8
, maxCombinedClipAndCullDistances = 16
, discreteQueuePriorities = 2
, pointSizeRange =
( 1.0
, 1023.0
)
, lineWidthRange =
( 1.0
, 1.0
)
, pointSizeGranularity = 0.0
, lineWidthGranularity = 0.0
, strictLines = True
, standardSampleLocations = True
, optimalBufferCopyOffsetAlignment = 64
, optimalBufferCopyRowPitchAlignment = 64
, nonCoherentAtomSize = 256
}
, sparseProperties = PhysicalDeviceSparseProperties
{ residencyStandard2DBlockShape = False
, residencyStandard2DMultisampleBlockShape = False
, residencyStandard3DBlockShape = False
, residencyAlignedMipSize = False
, residencyNonResidentStrict = False
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment