vulkan
Safe HaskellNone
LanguageHaskell2010

Vulkan.Extensions.VK_EXT_shader_uniform_buffer_unsized_array

Description

Name

VK_EXT_shader_uniform_buffer_unsized_array - device extension

VK_EXT_shader_uniform_buffer_unsized_array

Name String
VK_EXT_shader_uniform_buffer_unsized_array
Extension Type
Device extension
Registered Extension Number
643
Revision
1
Ratification Status
Ratified
Extension and Version Dependencies
VK_KHR_get_physical_device_properties2 or Vulkan Version 1.1
Contact
Extension Proposal
VK_EXT_shader_uniform_buffer_unsized_array

Other Extension Metadata

Last Modified Date
2025-05-28
Contributors
  • Pat Brown, NVIDIA
  • Jeff Bolz, NVIDIA
  • Pranjal Dubey, NVIDIA

Description

This extension allows the last member of a uniform buffer block to be declared as an unsized array. This capability enables applications to create flexible buffer layouts where the array size can vary based on runtime requirements.

When the last member of a uniform buffer block is declared as an unsized array, the effective array size is inferred at runtime from the size of the buffer object backing the uniform buffer block. Such unsized arrays can be indexed with general integer expressions, but may not be passed as arguments to functions or indexed with negative constant expressions.

This extension leverages existing SPIR-V capabilities, allowing use of OpTypeRuntimeArray as the last member of a uniform buffer block structure while prohibiting OpArrayLength.

Applications needing to know array sizes at runtime should calculate the length and pass it to shaders via a separate uniform. This calculation can be performed using the formula: max((buffer_object_size - offset_of_array) / stride_of_array, 0), where buffer_object_size is the size of the bound buffer, offset_of_array is the byte offset of the array in the block, and stride_of_array is the byte stride between consecutive array elements.

Uniform buffers have traditionally required explicit sizes for all arrays which limits flexibility. With this extension, developers can create a single shader that adapts to different data set sizes at runtime by binding differently sized buffers.

New Structures

New Enum Constants

Version History

  • Revision 1, 2025-05-28 (Pranjal Dubey)

    • Initial draft

See Also

No cross-references are available

Document Notes

For more information, see the Vulkan Specification.

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

Synopsis

Documentation

data PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT Source #

VkPhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT - Structure describing uniform buffer unsized array features that can be supported by an implementation

Members

This structure describes the following feature:

Description

If the PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT structure is included in the pNext chain of the PhysicalDeviceFeatures2 structure passed to getPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. If the application wishes to use a Device with any features described by PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT, it must add an instance of the structure, with the desired feature members set to TRUE, to the pNext chain of DeviceCreateInfo when creating the Device.

Valid Usage (Implicit)

See Also

VK_EXT_shader_uniform_buffer_unsized_array, Bool32, StructureType

Constructors

PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT 

Fields

  • shaderUniformBufferUnsizedArray :: Bool

    shaderUniformBufferUnsizedArray indicates that the implementation supports declaring the last member of a uniform buffer block as an unsized array.

Instances

Instances details
Eq PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_uniform_buffer_unsized_array

Storable PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_uniform_buffer_unsized_array

Show PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_uniform_buffer_unsized_array

FromCStruct PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_uniform_buffer_unsized_array

ToCStruct PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_uniform_buffer_unsized_array

Zero PhysicalDeviceShaderUniformBufferUnsizedArrayFeaturesEXT Source # 
Instance details

Defined in Vulkan.Extensions.VK_EXT_shader_uniform_buffer_unsized_array

type EXT_SHADER_UNIFORM_BUFFER_UNSIZED_ARRAY_EXTENSION_NAME = "VK_EXT_shader_uniform_buffer_unsized_array" Source #