PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
graph_vram.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GRAPH_VRAM_MAX_WORDS   1048576
 
#define GRAPH_ALIGN_PAGE   2048
 
#define GRAPH_ALIGN_BLOCK   64
 

Functions

int graph_vram_allocate (int width, int height, int psm, int alignment)
 
void graph_vram_free (int address)
 
void graph_vram_clear (void)
 
int graph_vram_size (int width, int height, int psm, int alignment)
 

Detailed Description

Graph library VRAM

Definition in file graph_vram.h.

Macro Definition Documentation

◆ GRAPH_VRAM_MAX_WORDS

#define GRAPH_VRAM_MAX_WORDS   1048576

Each word is 1 32-bit pixel

Definition at line 10 of file graph_vram.h.

◆ GRAPH_ALIGN_PAGE

#define GRAPH_ALIGN_PAGE   2048

Frame Buffer and Z Buffer

Definition at line 13 of file graph_vram.h.

◆ GRAPH_ALIGN_BLOCK

#define GRAPH_ALIGN_BLOCK   64

Texture Buffer and CLUT Buffer

Definition at line 16 of file graph_vram.h.

Function Documentation

◆ graph_vram_allocate()

int graph_vram_allocate ( int  width,
int  height,
int  psm,
int  alignment 
)

Allocates vram and returns vram base pointer

Definition at line 7 of file graph_vram.c.

References graph_vram_allocate(), GRAPH_VRAM_MAX_WORDS, and graph_vram_size().

Referenced by graph_vram_allocate().

◆ graph_vram_free()

void graph_vram_free ( int  address)

Frees in FIFO order...

Definition at line 30 of file graph_vram.c.

References graph_vram_free().

Referenced by graph_vram_free().

◆ graph_vram_clear()

void graph_vram_clear ( void  )

Clears the vram status

Definition at line 37 of file graph_vram.c.

References graph_vram_clear().

Referenced by graph_vram_clear().

◆ graph_vram_size()

int graph_vram_size ( int  width,
int  height,
int  psm,
int  alignment 
)

Calculate the size in vram of a texture or buffer

Definition at line 44 of file graph_vram.c.

References graph_vram_size(), GS_PSM_16, GS_PSM_16S, GS_PSM_24, GS_PSM_32, GS_PSM_4, GS_PSM_4HH, GS_PSM_4HL, GS_PSM_8, GS_PSM_8H, GS_PSMZ_16, GS_PSMZ_16S, GS_PSMZ_24, and GS_PSMZ_32.

Referenced by graph_vram_allocate(), and graph_vram_size().