nCine::RHI::GXM::GxmShaderProgram::GxmBlockUpload struct

Where one uniform block's bytes go in a stage's default uniform buffer.

The Cg dialect has no counterpart to a std140 block - its emitter hoists each block member to a top-level uniform - so a block is uploaded member by member. Both layouts place an array-of-structs element on a 16-byte boundary and pack its fields the same way, so the member's bytes go across verbatim out of the range the pipeline bound, without being repacked.

A batched block does not go through the default uniform buffer at all. Its instance array is tens of kilobytes, far past what the SGX's uniform registers hold, so the compiler places it in a uniform buffer container* - reported as SCE_GXM_PARAMETER_CATEGORY_UNIFORM_BUFFER - which is bound by address rather than written into. That is why the pipeline's uniform buffers are GPU-visible memory (see GxmBufferObject): the range the batcher filled is handed to sceGxm as a pointer, with no copy at all. Mistaking this case for the copied one is invisible at load time and costs every batched draw its instance data - sprites, text and tile layers all at once.

Public types

enum class Destination { DefaultUniformBuffer, UniformBufferContainer }
How the member reaches the shader.

Public variables

Destination Where
std::uint32_t BindingIndex
std::uint32_t SourceOffset
std::uint32_t Index
std::uint32_t MaxByteSize
const char* Name
std::uint32_t SourceStride
std::uint32_t CompiledStride

Enum documentation

enum class nCine::RHI::GXM::GxmShaderProgram::GxmBlockUpload::Destination

How the member reaches the shader.

Enumerators
DefaultUniformBuffer

copied into the draw's reserved default uniform buffer

UniformBufferContainer

bound by address with sceGxmSet{Vertex,Fragment}UniformBuffer()