wavelength 1.0.0
Loading...
Searching...
No Matches
PsTex::UsedRange Struct Reference

The GS blocks of the CLUT or of one mipmap. More...

#include <pstex.h>

Public Member Functions

int AlignShift () const
 Report the alignment the range requires, as a power of two of blocks.
bool AllocFree ()
 Take the free run that wastes the fewest blocks once aligned.
bool AllocUsed ()
 Take the blocks of the range of another texture that wastes the fewest of them.
void Release ()
 Free the blocks and remove the range from sUsedRanges.
unsigned short GetCount () const
void SetCount (unsigned short nCount)
int GetFrame () const
void SetFrame (int nFrame)

Public Attributes

unsigned short mStart: 15
unsigned short mPinned: 1

Detailed Description

The GS blocks of the CLUT or of one mipmap.

The name is inferred.

Member Function Documentation

◆ AlignShift()

int PsTex::UsedRange::AlignShift ( ) const

Report the alignment the range requires, as a power of two of blocks.

A pinned range, and a range of 17 blocks or more, aligns to a whole page of 32 blocks.

Returns
The power of two.
Ghidra address:
NTSC-U/C: 0x00216eb0
Ghidra address:
PAL: 0x0021fcc8

◆ AllocFree()

bool PsTex::UsedRange::AllocFree ( )

Take the free run that wastes the fewest blocks once aligned.

A run that fits exactly is taken at once. The alignment padding before the range becomes a separate free run.

Returns
Whether the range received blocks.
Ghidra address:
NTSC-U/C: 0x00216f10
Ghidra address:
PAL: 0x0021fd28

◆ AllocUsed()

bool PsTex::UsedRange::AllocUsed ( )

Take the blocks of the range of another texture that wastes the fewest of them.

Pinned ranges are passed over, and every range is passed over while this range is marked with sStamp. Of ranges that waste as many blocks, the earliest in sUsedRanges wins. The other texture's range is evicted, and the blocks this range does not need are freed.

Returns
Whether the range received blocks.
Ghidra address:
NTSC-U/C: 0x00217150
Ghidra address:
PAL: 0x0021ff68

◆ Release()

void PsTex::UsedRange::Release ( )

Free the blocks and remove the range from sUsedRanges.

A range without blocks is unchanged.

Ghidra address:
NTSC-U/C: 0x00217f58
Ghidra address:
PAL: 0x00220d70

◆ GetCount()

unsigned short PsTex::UsedRange::GetCount ( ) const
inline
Returns
The number of blocks.

◆ SetCount()

void PsTex::UsedRange::SetCount ( unsigned short nCount)
inline
Parameters
nCountThe number of blocks.

◆ GetFrame()

int PsTex::UsedRange::GetFrame ( ) const
inline
Returns
The value of sStamp when the texture was last selected.

◆ SetFrame()

void PsTex::UsedRange::SetFrame ( int nFrame)
inline
Parameters
nFrameThe value of sStamp when the texture was last selected.

Member Data Documentation

◆ mStart

unsigned short PsTex::UsedRange::mStart

The first block, or 0 while the range has none.

◆ mPinned

unsigned short PsTex::UsedRange::mPinned

Set for a render target. A pinned range is never evicted.


The documentation for this struct was generated from the following file: