psl1ght
A free SDK for Sony's PS3 console
Data Structures | Macros | Typedefs | Functions
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_FLOAT   0
 
#define PARAM_FLOAT2   1
 
#define PARAM_FLOAT3   2
 
#define PARAM_FLOAT4   3
 
#define PARAM_FLOAT4x4   4
 
#define PARAM_SAMPLER1D   5
 
#define PARAM_SAMPLER2D   6
 
#define PARAM_SAMPLER3D   7
 
#define PARAM_SAMPLERCUBE   8
 
#define PARAM_SAMPLERRECT   9
 
#define PARAM_UNKNOWN   0xff
 

Typedefs

typedef struct rsx_vp rsxVertexProgram
 Vertex program data structure. More...
 
typedef struct rsx_fp rsxFragmentProgram
 Fragment program data structure. More...
 
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 (rsxVertexProgram *vp)
 Get Ucode from RSX vertex program. More...
 
rsxProgramConstrsxVertexProgramGetConsts (rsxVertexProgram *vp)
 Get the list of vertex program consts. More...
 
s32 rsxVertexProgramGetConst (rsxVertexProgram *vp, const char *name)
 Get id of vertex program const from its name. More...
 
rsxProgramAttribrsxVertexProgramGetAttribs (rsxVertexProgram *vp)
 Get the list of vertex program attributes. More...
 
s32 rsxVertexProgramGetAttrib (rsxVertexProgram *vp, const char *name)
 Get id of vertex program attribute from its name. More...
 
void * rsxFragmentProgramGetUCode (rsxFragmentProgram *fp, u32 *size)
 Get Ucode from RSX fragment program. More...
 
rsxProgramConstrsxFragmentProgramGetConsts (rsxFragmentProgram *fp)
 Get the list of fragment program consts. More...
 
s32 rsxFragmentProgramGetConst (rsxFragmentProgram *fp, const char *name)
 Get id of fragment program const from its name. More...
 
rsxProgramAttribrsxFragmentProgramGetAttribs (rsxFragmentProgram *fp)
 Get the list of fragment program attributes. More...
 
s32 rsxFragmentProgramGetAttrib (rsxFragmentProgram *fp, const char *name)
 Get id of fragment program attribute from its name. More...
 
rsxConstOffsetTablersxFragmentProgramGetConstOffsetTable (rsxFragmentProgram *fp, u32 table_off)
 Get const offset table from a fragment program. More...
 

Detailed Description

RSX shader programming management.

Typedef Documentation

◆ rsxFragmentProgram

typedef struct rsx_fp rsxFragmentProgram

Fragment program data structure.

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

◆ 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()

s32 rsxFragmentProgramGetAttrib ( rsxFragmentProgram fp,
const char *  name 
)

Get id 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 id.

◆ rsxFragmentProgramGetAttribs()

rsxProgramAttrib* rsxFragmentProgramGetAttribs ( 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()

s32 rsxFragmentProgramGetConst ( rsxFragmentProgram fp,
const char *  name 
)

Get id 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 id.

◆ rsxFragmentProgramGetConstOffsetTable()

rsxConstOffsetTable* rsxFragmentProgramGetConstOffsetTable ( 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 ( 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.

◆ rsxFragmentProgramGetUCode()

void* rsxFragmentProgramGetUCode ( rsxFragmentProgram fp,
u32 *  size 
)

Get Ucode from RSX fragment program.

Parameters
fpPointer the to fragment program structure.
Returns
Pointer to the ucode.

◆ rsxVertexProgramGetAttrib()

s32 rsxVertexProgramGetAttrib ( rsxVertexProgram vp,
const char *  name 
)

Get id 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 id.

◆ rsxVertexProgramGetAttribs()

rsxProgramAttrib* rsxVertexProgramGetAttribs ( 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()

s32 rsxVertexProgramGetConst ( rsxVertexProgram vp,
const char *  name 
)

Get id 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 ( 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.

◆ rsxVertexProgramGetUCode()

void* rsxVertexProgramGetUCode ( rsxVertexProgram vp)

Get Ucode from RSX vertex program.

Parameters
vpPointer the to vertex program structure.
Returns
Pointer to the ucode.