ShaderStorageFormat
Represents the format specification for a shader storage buffer. Defines the structure, primitives, and memory layout for data used in GPU programming.
The ShaderStorageFormat class allows users to describe and organize shader storage elements, compute memory alignments, and manage offsets and paddings accordingly.
The format consists of multiple elements that can be primitives or nested structures, and it ensures that the overall memory layout adheres to GPU alignment and padding requirements.
Properties
Functions
Processes and updates the internal format size based on the alignment and size requirements of the elements within the shader storage format. The method ensures that the memory layout complies with the alignment constraints of each element, including primitives and structures, while accounting for array sizes and nested structures.
Generates a sequence of ShaderStorageElement
objects by processing the elements defined in the ShaderStorageFormat
. This function delegates the processing of individual elements to the processElements
method.
Adds a primitive element to the shader storage format.