module
CrShader::GLSLLayoutPacker
Overview
Deterministic std430 / std140 byte-offset calculator for Vulkan / RenderingDevice push constants and uniform buffer objects (UBOs).
Defined in:
crshader/transpiler/glsl/layout_packer.crConstant Summary
-
OPAQUE_PREFIXES =
["sampler", "isampler", "usampler", "image", "iimage", "uimage", "subpassInput"]
Class Method Summary
- .align_up(value : Int32, alignment : Int32) : Int32
-
.compute_layout(program : ShaderProgram) : PackedLayout
Computes deterministic layout for non-opaque uniforms in GLSL 450.
- .opaque_uniform?(u : UniformDecl) : Bool
- .pack_fields(uniforms : Array(UniformDecl), std140 : Bool) : Tuple(Array(FieldSlot), Int32)
- .split_uniforms(uniforms : Array(UniformDecl)) : Tuple(Array(UniformDecl), Array(UniformDecl))
- .type_metrics(glsl_type : String) : Tuple(Int32, Int32)
Class Method Detail
Computes deterministic layout for non-opaque uniforms in GLSL 450.
Uses push_constant (std430) when no manual push_constant exists, no arrays are present,
and total size <= 128 bytes; otherwise falls back to set = 1, binding = 0 UBO (std140).
def self.pack_fields(uniforms : Array(UniformDecl), std140 : Bool) : Tuple(Array(FieldSlot), Int32)
#
def self.split_uniforms(uniforms : Array(UniformDecl)) : Tuple(Array(UniformDecl), Array(UniformDecl))
#