|
resonance 1.0.1
|


Go to the source code of this file.
Classes | |
| class | VramPalEntry |
| One entry of the GS video memory palette table. More... | |
| class | Rnd::VRAM |
| Cache of GS video memory, divided into a reserved palette region and a pool of texture blocks. More... | |
| class | Rnd::VRAM::Entry |
| One entry of the GS video memory block table. More... | |
Namespaces | |
| namespace | Rnd |
| The rendering engine. | |
Enumerations | |
| enum | VramBlockKind { kVramBlockKindNone = 0 , kVramBlockKindTexture = 2 , kVramBlockKindRenderTarget = 3 , kVramBlockKindFree = 4 } |
| Kind of block a table record describes. More... | |
| enum | VramList { kVramListFree = 0 , kVramListUsed = 1 , kVramListPool = 2 } |
| Which of the table's three record lists a record belongs to. More... | |
| enum | GsPixelStorageMode { kGsPsmCt32 = 0 , kGsPsmCt24 = 1 , kGsPsmCt16 = 2 , kGsPsmT8 = 19 , kGsPsmT4 = 20 } |
| GS pixel storage modes this unit distinguishes. More... | |
Variables | |
| constexpr int | kVramBlockBytes = 256 |
| Bytes in one GS video memory block, the unit every address and size in this unit uses. | |
| constexpr int | kVramBlocks = 0x4000 |
| Blocks of GS video memory on the console, 4 MiB divided by the block size. | |
| constexpr int | kVramPageBlocks = 32 |
| Blocks in one GS page, which is 8 KiB. | |
| constexpr int | kVramTableEntries = 1024 |
| Records in the block table, all of them file scope and linked into one pool at start-up. | |
| constexpr int | kVramPalEntries = 1024 |
| Records in the palette table. | |
| constexpr int | kVramPalSlots = 192 |
| Palette slots the reserved palette region divides into. | |
| constexpr int | kVramPalSlotWords = 6 |
| Words of the palette occupancy bitmap, one bit per slot. | |
| constexpr int | kVramPalBlocks = 4 |
| Blocks one palette occupies, so 1 KiB for a 256 entry 32-bit table. | |
| constexpr int | kVramPalAreaBlocks = kVramPalSlots * kVramPalBlocks |
| Blocks the palette region reserves, which is every slot at its full size. | |
| constexpr int | kVramLockGenerations = 3 |
| Rotating lock generations, so a block locked for one packet is released two packets later. | |
| constexpr int | kVramListCount = 3 |
| Record lists the table maintains, which is one head and one tail array of this length. | |
| constexpr int | kVramLockedPerGeneration = 128 |
| Records one generation may lock. | |
| constexpr int | kVramPalSlotsPerWord = 32 |
| Slots one word of the palette occupancy bitmap covers. | |
| constexpr int | kVramPalSwapOutLimit = 16 |
| Palettes SwapOutOldest() releases at most in one pass. | |
| constexpr int | kVramPalTbw = 1 |
| Buffer width, in 64 texel units, that a palette transfer uses. | |
| constexpr int | kGsTexelsPerTbwUnit = 64 |
| Texels one unit of a GS transfer buffer width covers. | |
| constexpr int | kVramFrameCounterBytes = 28 |
| Bytes of the frame counter run EndFrame() clears, from mSwaps through mSpareFrameCounter. | |
| constexpr int | kVramWipeTileTexels = 64 |
| Texels along each edge of a tile Rnd::VRAM::WipeVram() writes. | |
| constexpr int | kVramWipeRows = 512 |
| Texel rows Rnd::VRAM::WipeVram() walks. | |
| constexpr int | kVramWipeBlocksPerRow = 64 |
| Blocks Rnd::VRAM::WipeVram() advances its destination by for each texel row. | |
| constexpr int | kVramWipeTileBytes = kVramWipeTileTexels * kVramWipeTileTexels * 4 |
| Bytes of zeros Rnd::VRAM::WipeVram() builds, one tile at four bytes per texel. | |
| constexpr int | kVramSwapBudgetMultiple = 4 |
| Multiple of a request that eviction frees before the allocator retries its search. | |
| constexpr int | kVramLockPinned = 8 |
| Bit of a record's lock mask that pins it against eviction until a caller clears it. | |
| constexpr int | kVramLockGenerationMask = 7 |
| Bits of a record's lock mask the rotating generations own. | |
| const int | g_anGsPixelStorageModes [kABitmapFormatCount] |
| GS storage mode of each ABitmapFormat, indexed by the format code. | |
| const int | g_anBitsPerPixelTable [kABitmapFormatCount] |
| Bits per texel of each ABitmapFormat once it reaches GS memory, indexed by the format code. | |
| VRAM | Rnd::TheVRAM |
| The video memory cache. | |
| Rnd::VRAM::Entry | g_vramEntries [kVramTableEntries] |
| Every block table record. | |
| VramPalEntry | g_vramPalEntries [kVramPalEntries] |
| Every palette table record. | |
| VramPalEntry * | g_pVramPalFree |
| First unused palette record. | |
| VramPalEntry * | g_pVramPalUsed |
| First resident palette record, most recently used first. | |
| unsigned | g_adVramPalSlots [kVramPalSlotWords] |
| Occupancy of the palette region, one bit per slot. | |
| int | g_anVramLockCount [kVramLockGenerations] |
| Block records each generation has locked. | |
| int | g_anVramPalLockCount [kVramLockGenerations] |
| Palette records each generation has locked. | |
| Rnd::VRAM::Entry * | g_apVramLocked [kVramLockGenerations][kVramLockedPerGeneration] |
| Block records each generation has locked, in the order they were locked. | |
| VramPalEntry * | g_apVramPalLocked [kVramLockGenerations][kVramLockedPerGeneration] |
| Palette records each generation has locked, in the order they were locked. | |
| int | g_nVramLoadsLastFrame |
| Transfers the previous frame performed. | |
| int | g_nVramLoadBlocksLastFrame |
| Blocks the previous frame's transfers moved. | |
| sceGsLoadImage | g_vramUploadLoadImage |
| Transfer descriptor Rnd::VRAM::Entry::UploadImage() reuses. | |
| sceGsLoadImage | g_vramUploadSubLoadImage |
| Transfer descriptor Rnd::VRAM::Entry::UploadSubImage() reuses. | |
| sceGsLoadImage | g_vramPalLoadImage |
| Transfer descriptor VramPalEntry::UploadClut() reuses. | |
| sceGsLoadImage | g_vramWipeLoadImage |
| Transfer descriptor Rnd::VRAM::WipeVram() reuses. | |
| sceGsStoreImage | g_vramReadBackStoreImage |
| Transfer descriptor Rnd::VRAM::ReadBackBitmap() reuses, and therefore Rnd::VRAM::Screendump(). | |
| int | g_nScreendumpIndex |
| Number the next Rnd::VRAM::Screendump() file takes, advanced after each dump. | |
| enum VramBlockKind |
Kind of block a table record describes.
The value is a single byte at +0x04. Only four of its values appear in the image, and the two that arrive from outside come from Rnd::PsTex. The titles of the first three are inferred from the call sites; only kVramBlockKindFree is settled, because Rnd::VRAM::Entry::MakeFree() writes it and Rnd::VRAM::AllocBlock() tests for it when deciding whether a block may be split.
| Enumerator | |
|---|---|
| kVramBlockKindNone | Written by Rnd::VRAM::Entry::Reset() on a released record. |
| kVramBlockKindTexture | Passed by Rnd::PsTex::RestoreSurfaces(). |
| kVramBlockKindRenderTarget | Rounded up to a page by GetBlockAddr(). |
| kVramBlockKindFree | Unallocated space the allocator may split. |
| enum VramList |
Which of the table's three record lists a record belongs to.
Rnd::VRAM::UnlinkEntry() takes the value as an index into the head and tail arrays. The three lists therefore share one pair of arrays rather than six separate pointers. Every title is inferred from what the list is walked for.
| enum GsPixelStorageMode |
GS pixel storage modes this unit distinguishes.
Three of these select a page shape other than the default. The remaining modes take the 64 by 32 texel page Rnd::VRAM::Entry::ComputeBlockSize() falls back to, and the jump table the routine dispatches through routes PSMCT16S to that fallback rather than to the 64 by 64 page the hardware gives it. The two 32-bit and 24-bit modes appear because g_anGsPixelStorageModes maps bitmap formats onto them.
|
constexpr |
Bytes in one GS video memory block, the unit every address and size in this unit uses.
|
constexpr |
Blocks of GS video memory on the console, 4 MiB divided by the block size.
|
constexpr |
Blocks in one GS page, which is 8 KiB.
|
constexpr |
Records in the block table, all of them file scope and linked into one pool at start-up.
|
constexpr |
Records in the palette table.
|
constexpr |
Palette slots the reserved palette region divides into.
|
constexpr |
Words of the palette occupancy bitmap, one bit per slot.
|
constexpr |
Blocks one palette occupies, so 1 KiB for a 256 entry 32-bit table.
|
constexpr |
Blocks the palette region reserves, which is every slot at its full size.
|
constexpr |
Rotating lock generations, so a block locked for one packet is released two packets later.
|
constexpr |
Record lists the table maintains, which is one head and one tail array of this length.
|
constexpr |
Records one generation may lock.
|
constexpr |
Slots one word of the palette occupancy bitmap covers.
|
constexpr |
Palettes SwapOutOldest() releases at most in one pass.
|
constexpr |
Buffer width, in 64 texel units, that a palette transfer uses.
A palette is never wider.
|
constexpr |
Texels one unit of a GS transfer buffer width covers.
|
constexpr |
Bytes of the frame counter run EndFrame() clears, from mSwaps through mSpareFrameCounter.
|
constexpr |
Texels along each edge of a tile Rnd::VRAM::WipeVram() writes.
|
constexpr |
Texel rows Rnd::VRAM::WipeVram() walks.
|
constexpr |
Blocks Rnd::VRAM::WipeVram() advances its destination by for each texel row.
|
constexpr |
Bytes of zeros Rnd::VRAM::WipeVram() builds, one tile at four bytes per texel.
|
constexpr |
Multiple of a request that eviction frees before the allocator retries its search.
|
constexpr |
Bit of a record's lock mask that pins it against eviction until a caller clears it.
|
constexpr |
Bits of a record's lock mask the rotating generations own.
|
extern |
GS storage mode of each ABitmapFormat, indexed by the format code.
The run-length format maps to PSMT8, the form it is decompressed into before upload.
|
extern |
Bits per texel of each ABitmapFormat once it reaches GS memory, indexed by the format code.
|
extern |
Every block table record.
|
extern |
Every palette table record.
|
extern |
First unused palette record.
|
extern |
First resident palette record, most recently used first.
|
extern |
Occupancy of the palette region, one bit per slot.
|
extern |
Block records each generation has locked.
|
extern |
Palette records each generation has locked.
|
extern |
Block records each generation has locked, in the order they were locked.
|
extern |
Palette records each generation has locked, in the order they were locked.
|
extern |
Transfers the previous frame performed.
|
extern |
Blocks the previous frame's transfers moved.
|
extern |
Transfer descriptor Rnd::VRAM::Entry::UploadImage() reuses.
|
extern |
Transfer descriptor Rnd::VRAM::Entry::UploadSubImage() reuses.
|
extern |
Transfer descriptor VramPalEntry::UploadClut() reuses.
|
extern |
Transfer descriptor Rnd::VRAM::WipeVram() reuses.
|
extern |
Transfer descriptor Rnd::VRAM::ReadBackBitmap() reuses, and therefore Rnd::VRAM::Screendump().
|
extern |
Number the next Rnd::VRAM::Screendump() file takes, advanced after each dump.