InstanceUniforms struct
#include <nCine/Graphics/RenderCommand.h>
The instance block members a sprite-like material rewrites for every quad it draws.
Grouped so that a caller emitting one command per quad out of a pool can write them without asking the block for them by name again. That lookup was the text path's largest cost on the consoles: Font::DrawString rents a command per glyph and wrote three members through it, so a menu frame ran several hundred name lookups over a block whose member names sit in separately allocated strings - all of it recomputing an answer that only a shader change can invalidate. BaseSprite::updateRenderCommand() writes the same members (plus the palette offset) for every sprite whose color, size or texture changed, so it goes through this cache as well.
Public variables
- RHI::UniformCache* TexRect
- The
texRectmember, ornullptrif the shader has none. - RHI::UniformCache* SpriteSize
- The
spriteSizemember, ornullptrif the shader has none. - RHI::UniformCache* Color
- The
colormember, ornullptrif the shader has none. - RHI::UniformCache* PaletteOffset
- The
paletteOffsetmember, ornullptrif the shader has none (only the palette shaders declare it).