nCine::RHI::GS::GsVramLayout struct

Static layout of the Graphics Synthesizer's local memory, as requested by the device.

Passed to GsVram::Initialize(), which places the display buffers first, then the render-target reserve, then the CLUT slab, and gives every page left over to the texture cache.

Public variables

std::int32_t DisplayWidth
Width of a display buffer in pixels (must be a multiple of 64, the FBW unit).
std::int32_t DisplayHeight
Height of a display buffer in pixels.
GsPsm DisplayPsm
Pixel storage mode of the display buffers.
std::int32_t DisplayBufferCount
Number of display buffers (1 for single-buffered, 2 for the usual flip).
std::uint32_t ReservedRttPages
Pages statically reserved for render targets.
std::uint32_t ClutSlotCount
Number of 1 KB CLUT slots in the slab (a 256-entry 32-bit CLUT is exactly one slot).

Variable documentation

std::uint32_t nCine::RHI::GS::GsVramLayout::ReservedRttPages

Pages statically reserved for render targets.

Render targets have no host copy to rebuild from, so they must never be evicted (the PVR backend spares them in its eviction walk for the same reason). Rather than let them compete with the texture cache for space and fail unpredictably - which is how the Dreamcast's 256x256 TexturedBackgroundPass target used to fail to allocate - the ones the engine is known to want are reserved up front out of a fixed pool.