psl1ght
A free SDK for Sony's PS3 console
Loading...
Searching...
No Matches
rsx_program.h
Go to the documentation of this file.
1
5#ifndef __RSX_PROGRAM_H__
6#define __RSX_PROGRAM_H__
7
8#include <ppu-types.h>
9
10#define PARAM_BOOL 0
11#define PARAM_BOOL1 1
12#define PARAM_BOOL2 2
13#define PARAM_BOOL3 3
14#define PARAM_BOOL4 4
15#define PARAM_FLOAT 5
16#define PARAM_FLOAT1 6
17#define PARAM_FLOAT2 7
18#define PARAM_FLOAT3 8
19#define PARAM_FLOAT4 9
20#define PARAM_FLOAT3x4 10
21#define PARAM_FLOAT4x4 11
22#define PARAM_FLOAT3x3 12
23#define PARAM_FLOAT4x3 13
24#define PARAM_SAMPLER1D 14
25#define PARAM_SAMPLER2D 15
26#define PARAM_SAMPLER3D 16
27#define PARAM_SAMPLERCUBE 17
28#define PARAM_SAMPLERRECT 18
29#define PARAM_UNKNOWN 0xff
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
58
83
85typedef struct rsx_const
86{
88 u32 index;
89 u8 type;
91 u8 count;
93 u8 _pad0;
95 union {
96 u32 u;
97 f32 f;
98 } values[4];
105
107typedef struct rsx_co_table
108{
109 u32 num;
110 u32 offset[];
112
114typedef struct rsx_attrib
115{
117 u32 index;
118 u8 type;
119 u8 _pad0[3];
121
127void rsxVertexProgramGetUCode(const rsxVertexProgram *vp,void **ucode,u32 *size);
128
134
140
146s32 rsxVertexProgramGetConstIndex(const rsxVertexProgram *vp,const char *name);
147
154
160
166
173
179s32 rsxVertexProgramGetAttribIndex(const rsxVertexProgram *vp,const char *name);
180
186void rsxFragmentProgramGetUCode(const rsxFragmentProgram *fp,void **ucode,u32 *size);
187
193
199
206
213
219
225
232
239
246
247#ifdef __cplusplus
248 }
249#endif
250
251#endif
uintptr_t size
Definition heap.h:1
s32 rsxVertexProgramGetConstIndex(const rsxVertexProgram *vp, const char *name)
Get index of vertex program const from its name.
rsxConstOffsetTable * rsxFragmentProgramGetConstOffsetTable(const rsxFragmentProgram *fp, u32 table_off)
Get const offset table from a fragment program.
u16 rsxVertexProgramGetNumAttrib(const rsxVertexProgram *vp)
Get the count of vertex program attributes.
rsxProgramAttrib * rsxVertexProgramGetAttribs(const rsxVertexProgram *vp)
Get the list of vertex program attributes.
rsxProgramConst * rsxVertexProgramGetConst(const rsxVertexProgram *vp, const char *name)
Get const value of vertex program const from its name.
s32 rsxFragmentProgramGetConstIndex(const rsxFragmentProgram *fp, const char *name)
Get index of fragment program const from its name.
u16 rsxFragmentProgramGetNumConst(const rsxFragmentProgram *fp)
Get the count of fragment program consts.
rsxProgramAttrib * rsxFragmentProgramGetAttrib(const rsxFragmentProgram *fp, const char *name)
Get attribute value of fragment program attribute from its name.
struct rsx_vp rsxVertexProgram
Vertex program data structure.
struct rsx_fp rsxFragmentProgram
Fragment program data structure.
struct rsx_co_table rsxConstOffsetTable
Table of const offsets.
void rsxVertexProgramGetUCode(const rsxVertexProgram *vp, void **ucode, u32 *size)
Get Ucode from RSX vertex program.
rsxProgramConst * rsxFragmentProgramGetConst(const rsxFragmentProgram *fp, const char *name)
Get const value of fragment program const from its name.
s32 rsxFragmentProgramGetAttribIndex(const rsxFragmentProgram *fp, const char *name)
Get index of fragment program attribute from its name.
u16 rsxFragmentProgramGetNumAttrib(const rsxFragmentProgram *fp)
Get the count of fragment program attributes.
s32 rsxVertexProgramGetAttribIndex(const rsxVertexProgram *vp, const char *name)
Get index of vertex program attribute from its name.
struct rsx_attrib rsxProgramAttrib
Table of program attributes.
rsxProgramConst * rsxFragmentProgramGetConsts(const rsxFragmentProgram *fp)
Get the list of fragment program consts.
rsxProgramAttrib * rsxFragmentProgramGetAttribs(const rsxFragmentProgram *fp)
Get the list of fragment program attributes.
u16 rsxVertexProgramGetNumConst(const rsxVertexProgram *vp)
Get the count of vertex program consts.
struct rsx_const rsxProgramConst
Program const data structure.
rsxProgramAttrib * rsxVertexProgramGetAttrib(const rsxVertexProgram *vp, const char *name)
Get attribute value of vertex program attribute from its name.
rsxProgramConst * rsxVertexProgramGetConsts(const rsxVertexProgram *vp)
Get the list of vertex program consts.
void rsxFragmentProgramGetUCode(const rsxFragmentProgram *fp, void **ucode, u32 *size)
Get Ucode from RSX fragment program.
Table of program attributes.
u8 type
attribute type.
u32 name_off
offset of attribute name.
u32 index
attribute index.
Table of const offsets.
u32 num
number of elements in the array.
u32 offset[]
array of const offsets.
Program const data structure.
Definition rsx_program.h:86
u8 count
number of elements in the const.
Definition rsx_program.h:91
u8 type
program const type.
Definition rsx_program.h:89
u8 _pad0
unused padding byte, most be 0.
Definition rsx_program.h:93
u32 u
integer value.
Definition rsx_program.h:96
u32 name_off
offset of name.
Definition rsx_program.h:87
f32 f
float value.
Definition rsx_program.h:97
u32 index
program const id.
Definition rsx_program.h:88
union rsx_const::@1 values[4]
array of element values.
u8 is_internal
internal flag.
Definition rsx_program.h:90
Fragment program data structure.
Definition rsx_program.h:63
u16 num_regs
number of used registers in the fragment program
Definition rsx_program.h:67
u16 magic
magic identifier
Definition rsx_program.h:64
u32 fp_control
fragment program control mask
Definition rsx_program.h:76
u16 _pad1
unused padding word. most be 0
Definition rsx_program.h:81
u16 _pad0
unused padding word. most be 0
Definition rsx_program.h:65
u16 texcoord3D
bit mask of used 3D texture coords in the fragment program
Definition rsx_program.h:80
u32 const_off
offset to the constant name table
Definition rsx_program.h:73
u16 num_const
number of used constants in the fragment program
Definition rsx_program.h:69
u32 attr_off
offset to the attribute name table
Definition rsx_program.h:72
u16 num_attr
number of used input attributes in the fragment program
Definition rsx_program.h:68
u16 num_insn
number of fragment program instructions
Definition rsx_program.h:70
u16 texcoord2D
bit mask of used 2D texture coords in the fragment program
Definition rsx_program.h:79
u16 texcoords
bit mask of all used texture coords in the fragment program
Definition rsx_program.h:78
u32 ucode_off
offset to the shaders's micro code
Definition rsx_program.h:74
Vertex program data structure.
Definition rsx_program.h:39
u16 num_insn
number of vertex shader instructions
Definition rsx_program.h:46
u16 insn_start
start address to load the vertex program to
Definition rsx_program.h:56
u16 num_const
number of used constants in the vertex program
Definition rsx_program.h:45
u16 num_regs
number of used registers in the vertex program
Definition rsx_program.h:43
u16 magic
magic identifier
Definition rsx_program.h:40
u16 const_start
start address in vertex shader's constant block memory
Definition rsx_program.h:55
u32 const_off
offset to the constant name table
Definition rsx_program.h:49
u16 num_attr
number of used input attributes in the vertex program
Definition rsx_program.h:44
u32 input_mask
mask of input attributes in the vertex shader
Definition rsx_program.h:52
u32 ucode_off
offset to the shader's micro code
Definition rsx_program.h:50
u32 attr_off
offset to the attribute name table
Definition rsx_program.h:48
u32 output_mask
mask of result attributes passed to the fragment shader
Definition rsx_program.h:53
u16 _pad0
unused padding word. most be 0
Definition rsx_program.h:41