Source: DeviceProperties.h
Use DeviceProperties from DeviceProperties const& GraphicsScheduler().GetDeviceProperties();
to get runtime limits for the current GPU.
Use DeviceLimits from static constexpr DeviceProperties DeviceLimits;
to get compile time limits which is compatible with most GPUs.
These constants are used to calculate data alignment for uniform, storage and vertex buffers. Constants are used in C++ code to store data for accessing them in the GPU.
-
minUniformBufferOffsetAlign
minStorageBufferOffsetAlign
minThreadgroupMemoryLengthAlign
minUniformTexelBufferOffsetAlign
minStorageTexelBufferOffsetAlign
Vulkan: defined in VkPhysicalDeviceLimits:
minUniformBufferOffsetAlignment, minStorageBufferOffsetAlignment, minTexelBufferOffsetAlignment, minTexelBufferOffsetAlignment.
Metal: from Feature Set Tables:
"Threadgroup memory length alignment",
"Minimum constant buffer offset alignment"
and from specs:
"For buffers in the device address space, align the offset to the data type consumed by the compute function (which is always less than or equal to 16 bytes). For buffers in the constant address space, align the offset to 256 bytes in macOS. In iOS, align the offset to the maximum of either the data type consumed by the compute function, or 4 bytes. A 16-byte alignment is safe in iOS if you don't need to consider the data type." -
maxVerticesPerRenderPass
Mali GPU: from ARM blog: "has fixed-sized buffer to store vertices after transformations and before per-tile execution, this is not documented in Vulkan API and should be manually updated."
Vulkan: not defined
Metal: not defined -
minVertexBufferOffsetAlign
Vulkan: from specs: "If format is a packed format, attribAddress must be a multiple of the size in bytes of the whole attribute data type as described in Packed Formats. Otherwise, attribAddress must be a multiple of the size in bytes of the component type indicated by format."
Metal: from specs: "must be a multiple of 4 bytes" -
minVertexBufferElementsAlign
Vulkan: not defined in docs
Mali GPU: hardware process vertices by 4 elements, so vertex buffer must have enough size or robust buffer access must be enabled.
Metal: not defined // TODO: check -
maxUniformBufferRange
Vulkan: defined in VkPhysicalDeviceLimits::maxUniformBufferRange
Metal: from Feature Set Tables: "Maximum length of constant buffer arguments in vertex, fragment, tile, or kernel function" -
maxBoundDescriptorSets
Vulkan: defined in VkPhysicalDeviceLimits::maxBoundDescriptorSets
Metal: used as ArgumentBuffer, which is bound as buffer, maximum number of buffers defined as "Maximum number of entries in the buffer argument table, per graphics or kernel function" in Feature Set Tables, minus number of vertex buffers. -
minMemoryMapAlign
Vulkan: defined in VkPhysicalDeviceLimits::minMemoryMapAlignment
Metal: // TODO -
minNonCoherentAtomSize
Vulkan: defined in VkPhysicalDeviceLimits::nonCoherentAtomSize
Metal: // TODO -
minBufferCopyOffsetAlign
Vulkan: defined in VkPhysicalDeviceLimits::optimalBufferCopyOffsetAlignment
Metal: from specs: "In macOS, offset needs to be a multiple of 4, but can be any value in iOS and tvOS." -
minBufferCopyRowPitchAlign
Vulkan: defined in VkPhysicalDeviceLimits::optimalBufferCopyRowPitchAlignment
Metal: from Feature Set Tables: "Buffer alignment for copying an existing texture to a buffer"
This constants is used to calculate data alignment for acceleration structure input data: vertices, indices, transformations, AABBs, instances. Constants used in C++ code to store data for GPU usage.
-
vertexDataAlign
Vulkan: from specs: "vertexData.deviceAddress must be aligned to the size in bytes of the smallest component of the format in vertexFormat", max 4 bytes.
Metal: from specs: "The vertex must be a multiple of the vertex stride and must be a multiple of 4 bytes". -
vertexStrideAlign
Vulkan: from specs: "must be a multiple of the size in bytes of the smallest component of vertexFormat", max 4 bytes.
Metal: from specs: "must be a multiple of 4 bytes". -
indexDataAlign
Vulkan: from specs: "indexData.deviceAddress must be aligned to the size in bytes of the type in indexType", max 4 bytes.
Metal: from specs: "multiple of the index data type size and a multiple of the platform’s buffer offset alignment". -
aabbDataAlign
Vulkan: from specs: "must be aligned to 8 bytes".
Metal: from specs: "The offset must be a multiple of boundingBoxStride, and must be aligned to the platform’s buffer offset alignment", min stride: 8 bytes. -
aabbStrideAlign
Vulkan: from specs: "must be a multiple of 8".
Metal: from specs: "The stride must be at least 24 bytes, and must be a multiple of 4 bytes". -
transformDataAlign
Vulkan: from specs: "must be aligned to 16 bytes"
Metal: in specs: not defined. -
instanceDataAlign
Vulkan: from specs: if arrayOfPointers: "must be aligned to 8 bytes", otherwise: "must be aligned to 16 bytes". For array elements: "each element of ... in device memory must be aligned to 16 bytes"
Metal: from specs: "Specify an offset that is a multiple of 4 bytes and a multiple of the platform’s buffer offset alignment". -
instanceStrideAlign
Vulkan: custom stride is not supported, stride must be 64.
Metal: from specs: "The stride must be at least 64 bytes and must be a multiple of 4 bytes". -
scratchBufferAlign
Vulkan: defined in VkPhysicalDeviceAccelerationStructurePropertiesKHR::minAccelerationStructureScratchOffsetAlignment.
Metal: not defined. -
maxGeometries
Vulkan: defined in VkPhysicalDeviceAccelerationStructurePropertiesKHR::maxGeometryCount.
Metal: from specs: 2^24^ (can be extended to 2^30^) -
maxInstances
Vulkan: defined in VkPhysicalDeviceAccelerationStructurePropertiesKHR::maxInstanceCount.
Metal: from specs: 2^24^ (can be extended to 2^30^) -
maxPrimitives
Vulkan: defined in VkPhysicalDeviceAccelerationStructurePropertiesKHR::maxPrimitiveCount.
Metal: from specs: 2^28^ (can be extended to 2^30^) -
maxRecursion
Vulkan: defined in VkPhysicalDeviceRayTracingPipelinePropertiesKHR::maxRayRecursionDepth.
Metal: not defined. -
maxDispatchInvocations
Vulkan: defined in VkPhysicalDeviceRayTracingPipelinePropertiesKHR::maxRayDispatchInvocationCount.
Metal: not defined.
-
cores
StreamingMultiprocessor/Core count per GPU. -
warpsPerCore
Maximum number of simultaneously executing warps on an StreamingMultiprocessor/Core. -
threadsPerWarp
Number of thread in warp, same as maximum size of subgroup.