psl1ght
A free SDK for Sony's PS3 console
Loading...
Searching...
No Matches
rsx_program.h File Reference

RSX shader programming management. More...

#include <ppu-types.h>

Go to the source code of this file.

Data Structures

struct  rsx_vp
 Vertex program data structure. More...
 
struct  rsx_fp
 Fragment program data structure. More...
 
struct  rsx_const
 Program const data structure. More...
 
struct  rsx_co_table
 Table of const offsets. More...
 
struct  rsx_attrib
 Table of program attributes. More...
 

Macros

#define PARAM_BOOL   0
 
#define PARAM_BOOL1   1
 
#define PARAM_BOOL2   2
 
#define PARAM_BOOL3   3
 
#define PARAM_BOOL4   4
 
#define PARAM_FLOAT   5
 
#define PARAM_FLOAT1   6
 
#define PARAM_FLOAT2   7
 
#define PARAM_FLOAT3   8
 
#define PARAM_FLOAT4   9
 
#define PARAM_FLOAT3x4   10
 
#define PARAM_FLOAT4x4   11
 
#define PARAM_FLOAT3x3   12
 
#define PARAM_FLOAT4x3   13
 
#define PARAM_SAMPLER1D   14
 
#define PARAM_SAMPLER2D   15
 
#define PARAM_SAMPLER3D   16
 
#define PARAM_SAMPLERCUBE   17
 
#define PARAM_SAMPLERRECT   18
 
#define PARAM_UNKNOWN   0xff
 

Typedefs

typedef struct rsx_vp rsxVertexProgram
 Vertex program data structure.
 
typedef struct rsx_fp rsxFragmentProgram
 Fragment program data structure.
 
typedef struct rsx_const rsxProgramConst
 Program const data structure.
 
typedef struct rsx_co_table rsxConstOffsetTable
 Table of const offsets.
 
typedef struct rsx_attrib rsxProgramAttrib
 Table of program attributes.
 

Functions

void rsxVertexProgramGetUCode (const rsxVertexProgram *vp, void **ucode, u32 *size)
 Get Ucode from RSX vertex program.
 
u16 rsxVertexProgramGetNumConst (const rsxVertexProgram *vp)
 Get the count of vertex program consts.
 
rsxProgramConstrsxVertexProgramGetConsts (const rsxVertexProgram *vp)
 Get the list of vertex program consts.
 
s32 rsxVertexProgramGetConstIndex (const rsxVertexProgram *vp, const char *name)
 Get index of vertex program const from its name.
 
rsxProgramConstrsxVertexProgramGetConst (const rsxVertexProgram *vp, const char *name)
 Get const value of vertex program const from its name.
 
u16 rsxVertexProgramGetNumAttrib (const rsxVertexProgram *vp)
 Get the count of vertex program attributes.
 
rsxProgramAttribrsxVertexProgramGetAttribs (const rsxVertexProgram *vp)
 Get the list of vertex program attributes.
 
rsxProgramAttribrsxVertexProgramGetAttrib (const rsxVertexProgram *vp, const char *name)
 Get attribute value of vertex program attribute from its name.
 
s32 rsxVertexProgramGetAttribIndex (const rsxVertexProgram *vp, const char *name)
 Get index of vertex program attribute from its name.
 
void rsxFragmentProgramGetUCode (const rsxFragmentProgram *fp, void **ucode, u32 *size)
 Get Ucode from RSX fragment program.
 
u16 rsxFragmentProgramGetNumConst (const rsxFragmentProgram *fp)
 Get the count of fragment program consts.
 
rsxProgramConstrsxFragmentProgramGetConsts (const rsxFragmentProgram *fp)
 Get the list of fragment program consts.
 
s32 rsxFragmentProgramGetConstIndex (const rsxFragmentProgram *fp, const char *name)
 Get index of fragment program const from its name.
 
rsxProgramConstrsxFragmentProgramGetConst (const rsxFragmentProgram *fp, const char *name)
 Get const value of fragment program const from its name.
 
u16 rsxFragmentProgramGetNumAttrib (const rsxFragmentProgram *fp)
 Get the count of fragment program attributes.
 
rsxProgramAttribrsxFragmentProgramGetAttribs (const rsxFragmentProgram *fp)
 Get the list of fragment program attributes.
 
s32 rsxFragmentProgramGetAttribIndex (const rsxFragmentProgram *fp, const char *name)
 Get index of fragment program attribute from its name.
 
rsxProgramAttribrsxFragmentProgramGetAttrib (const rsxFragmentProgram *fp, const char *name)
 Get attribute value of fragment program attribute from its name.
 
rsxConstOffsetTablersxFragmentProgramGetConstOffsetTable (const rsxFragmentProgram *fp, u32 table_off)
 Get const offset table from a fragment program.
 

Detailed Description

RSX shader programming management.

Definition in file rsx_program.h.

Macro Definition Documentation

◆ PARAM_BOOL

#define PARAM_BOOL   0

Definition at line 10 of file rsx_program.h.

◆ PARAM_BOOL1

#define PARAM_BOOL1   1

Definition at line 11 of file rsx_program.h.

◆ PARAM_BOOL2

#define PARAM_BOOL2   2

Definition at line 12 of file rsx_program.h.

◆ PARAM_BOOL3

#define PARAM_BOOL3   3

Definition at line 13 of file rsx_program.h.

◆ PARAM_BOOL4

#define PARAM_BOOL4   4

Definition at line 14 of file rsx_program.h.

◆ PARAM_FLOAT

#define PARAM_FLOAT   5

Definition at line 15 of file rsx_program.h.

◆ PARAM_FLOAT1

#define PARAM_FLOAT1   6

Definition at line 16 of file rsx_program.h.

◆ PARAM_FLOAT2

#define PARAM_FLOAT2   7

Definition at line 17 of file rsx_program.h.

◆ PARAM_FLOAT3

#define PARAM_FLOAT3   8

Definition at line 18 of file rsx_program.h.

◆ PARAM_FLOAT3x3

#define PARAM_FLOAT3x3   12

Definition at line 22 of file rsx_program.h.

◆ PARAM_FLOAT3x4

#define PARAM_FLOAT3x4   10

Definition at line 20 of file rsx_program.h.

◆ PARAM_FLOAT4

#define PARAM_FLOAT4   9

Definition at line 19 of file rsx_program.h.

◆ PARAM_FLOAT4x3

#define PARAM_FLOAT4x3   13

Definition at line 23 of file rsx_program.h.

◆ PARAM_FLOAT4x4

#define PARAM_FLOAT4x4   11

Definition at line 21 of file rsx_program.h.

◆ PARAM_SAMPLER1D

#define PARAM_SAMPLER1D   14

Definition at line 24 of file rsx_program.h.

◆ PARAM_SAMPLER2D

#define PARAM_SAMPLER2D   15

Definition at line 25 of file rsx_program.h.

◆ PARAM_SAMPLER3D

#define PARAM_SAMPLER3D   16

Definition at line 26 of file rsx_program.h.

◆ PARAM_SAMPLERCUBE

#define PARAM_SAMPLERCUBE   17

Definition at line 27 of file rsx_program.h.

◆ PARAM_SAMPLERRECT

#define PARAM_SAMPLERRECT   18

Definition at line 28 of file rsx_program.h.

◆ PARAM_UNKNOWN

#define PARAM_UNKNOWN   0xff

Definition at line 29 of file rsx_program.h.

Typedef Documentation

◆ rsxConstOffsetTable

Table of const offsets.

◆ rsxFragmentProgram

typedef struct rsx_fp rsxFragmentProgram

Fragment program data structure.

This data structure is filled by cgcomp, the offline compiler for shader programs.

◆ rsxProgramAttrib

typedef struct rsx_attrib rsxProgramAttrib

Table of program attributes.

◆ rsxProgramConst

typedef struct rsx_const rsxProgramConst

Program const data structure.

◆ rsxVertexProgram

typedef struct rsx_vp rsxVertexProgram

Vertex program data structure.

This data structure is filled by cgcomp, the offline compiler for shader programs.

Function Documentation

◆ rsxFragmentProgramGetAttrib()

rsxProgramAttrib * rsxFragmentProgramGetAttrib ( const rsxFragmentProgram fp,
const char *  name 
)

Get attribute value of fragment program attribute from its name.

Parameters
fpPointer the to fragment program structure.
nameName of the fragment program attribute.
Returns
The requested fragment program attribute value.

◆ rsxFragmentProgramGetAttribIndex()

s32 rsxFragmentProgramGetAttribIndex ( const rsxFragmentProgram fp,
const char *  name 
)

Get index of fragment program attribute from its name.

Parameters
fpPointer the to fragment program structure.
nameName of the fragment program attribute.
Returns
The requested fragment program attribute index.

◆ rsxFragmentProgramGetAttribs()

rsxProgramAttrib * rsxFragmentProgramGetAttribs ( const rsxFragmentProgram fp)

Get the list of fragment program attributes.

Parameters
fpPointer the to fragment program structure.
Returns
Pointer to the list of program attribute structures.

◆ rsxFragmentProgramGetConst()

rsxProgramConst * rsxFragmentProgramGetConst ( const rsxFragmentProgram fp,
const char *  name 
)

Get const value of fragment program const from its name.

Parameters
fpPointer the to fragment program structure.
nameName of the fragment program const.
Returns
The requested fragment program const value.

◆ rsxFragmentProgramGetConstIndex()

s32 rsxFragmentProgramGetConstIndex ( const rsxFragmentProgram fp,
const char *  name 
)

Get index of fragment program const from its name.

Parameters
fpPointer the to fragment program structure.
nameName of the fragment program const.
Returns
The requested fragment program const index.

◆ rsxFragmentProgramGetConstOffsetTable()

rsxConstOffsetTable * rsxFragmentProgramGetConstOffsetTable ( const rsxFragmentProgram fp,
u32  table_off 
)

Get const offset table from a fragment program.

Parameters
fpPointer the to fragment program structure.
table_offOffset of the const offset table.
Returns
Pointer to the requested const offset table.

◆ rsxFragmentProgramGetConsts()

rsxProgramConst * rsxFragmentProgramGetConsts ( const rsxFragmentProgram fp)

Get the list of fragment program consts.

Parameters
fpPointer the to fragment program structure.
Returns
Pointer to the list of program const structures.

◆ rsxFragmentProgramGetNumAttrib()

u16 rsxFragmentProgramGetNumAttrib ( const rsxFragmentProgram fp)

Get the count of fragment program attributes.

Parameters
fpPointer the to fragment program structure.
Returns
Count of attributes in the fragment program.

◆ rsxFragmentProgramGetNumConst()

u16 rsxFragmentProgramGetNumConst ( const rsxFragmentProgram fp)

Get the count of fragment program consts.

Parameters
fpPointer the to fragment program structure.
Returns
Count of constants in the fragment program.

◆ rsxFragmentProgramGetUCode()

void rsxFragmentProgramGetUCode ( const rsxFragmentProgram fp,
void **  ucode,
u32 *  size 
)

Get Ucode from RSX fragment program.

Parameters
fpPointer the to fragment program structure.
ucodePointer-pointer to receive the fragment program ucode.
sizePointer to receive the fragment program ucode size.

◆ rsxVertexProgramGetAttrib()

rsxProgramAttrib * rsxVertexProgramGetAttrib ( const rsxVertexProgram vp,
const char *  name 
)

Get attribute value of vertex program attribute from its name.

Parameters
vpPointer the to vertex program structure.
nameName of the vertex program attribute.
Returns
The requested vertex program attribute value.

◆ rsxVertexProgramGetAttribIndex()

s32 rsxVertexProgramGetAttribIndex ( const rsxVertexProgram vp,
const char *  name 
)

Get index of vertex program attribute from its name.

Parameters
vpPointer the to vertex program structure.
nameName of the vertex program attribute.
Returns
The requested vertex program attribute index.

◆ rsxVertexProgramGetAttribs()

rsxProgramAttrib * rsxVertexProgramGetAttribs ( const rsxVertexProgram vp)

Get the list of vertex program attributes.

Parameters
vpPointer the to vertex program structure.
Returns
Pointer to the list of program attribute structures.

◆ rsxVertexProgramGetConst()

rsxProgramConst * rsxVertexProgramGetConst ( const rsxVertexProgram vp,
const char *  name 
)

Get const value of vertex program const from its name.

Parameters
vpPointer the to vertex program structure.
nameName of the vertex program const.
Returns
The requested vertex program const value.

◆ rsxVertexProgramGetConstIndex()

s32 rsxVertexProgramGetConstIndex ( const rsxVertexProgram vp,
const char *  name 
)

Get index of vertex program const from its name.

Parameters
vpPointer the to vertex program structure.
nameName of the vertex program const.
Returns
The requested vertex program const id.

◆ rsxVertexProgramGetConsts()

rsxProgramConst * rsxVertexProgramGetConsts ( const rsxVertexProgram vp)

Get the list of vertex program consts.

Parameters
vpPointer the to vertex program structure.
Returns
Pointer to the list of program const structures.

◆ rsxVertexProgramGetNumAttrib()

u16 rsxVertexProgramGetNumAttrib ( const rsxVertexProgram vp)

Get the count of vertex program attributes.

Parameters
vpPointer the to vertex program structure.
Returns
Count of attributes in the vertex program.

◆ rsxVertexProgramGetNumConst()

u16 rsxVertexProgramGetNumConst ( const rsxVertexProgram vp)

Get the count of vertex program consts.

Parameters
vpPointer the to vertex program structure.
Returns
Count of constants in the vertex program.

◆ rsxVertexProgramGetUCode()

void rsxVertexProgramGetUCode ( const rsxVertexProgram vp,
void **  ucode,
u32 *  size 
)

Get Ucode from RSX vertex program.

Parameters
vpPointer the to vertex program structure.
ucodePointer-pointer to receive the vertex program ucode.
sizePointer to receive the vertex program ucode size.