psl1ght
A free SDK for Sony's PS3 console
commands.h
Go to the documentation of this file.
1 
7 #ifndef __RSX_COMMANDS_H__
8 #define __RSX_COMMANDS_H__
9 
10 #include <rsx/gcm_sys.h>
11 #include <rsx/rsx_program.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
23 void rsxSetFrontFace(gcmContextData *context,u32 dir);
24 
32 void rsxSetCullFace(gcmContextData *context,u32 cull);
33 
40 void rsxSetCullFaceEnable(gcmContextData *context,u32 enable);
41 
48 void rsxSetDepthWriteEnable(gcmContextData *context,u32 enable);
49 
55 void rsxDrawVertexEnd(gcmContextData *context);
56 
63 void rsxSetShadeModel(gcmContextData *context,u32 shadeModel);
64 
81 void rsxDrawVertexBegin(gcmContextData *context,u32 type);
82 
83 void rsxDrawVertex2f(gcmContextData *context,u8 idx,f32 x,f32 y);
84 void rsxDrawVertex3f(gcmContextData *context,u8 idx,f32 x,f32 y,f32 z);
85 void rsxDrawVertex4f(gcmContextData *context,u8 idx,f32 x,f32 y,f32 z,f32 w);
86 void rsxSetScissor(gcmContextData *context,u16 x,u16 y,u16 w,u16 h);
87 
100 void rsxSetDepthFunc(gcmContextData *context,u32 func);
101 
113 void rsxSetDepthTestEnable(gcmContextData *context,u32 enable);
114 
134 void rsxClearSurface(gcmContextData *context,u32 clear_mask);
135 
142 void rsxSetClearDepthValue(gcmContextData *context,u32 value);
143 void rsxSetReturnCommand(gcmContextData *context);
144 void rsxSetCallCommand(gcmContextData *context,u32 offset);
145 void rsxSetJumpCommand(gcmContextData *context,u32 offset);
146 void rsxSetNopCommand(gcmContextData *context,u32 count);
147 
154 void rsxSetClearColor(gcmContextData *context,u32 color);
155 
165 void rsxSetColorMask(gcmContextData *context,u32 mask);
166 
177 void rsxSetColorMaskMRT(gcmContextData *context,u32 mask);
178 
185 void rsxSetSurface(gcmContextData *context,gcmSurface *surface);
186 void rsxSetReferenceCommand(gcmContextData *context,u32 ref_value);
187 
193 void rsxSetWaitLabel(gcmContextData *context,u8 index,u32 value);
194 
200 void rsxSetWriteCommandLabel(gcmContextData *context,u8 index,u32 value);
201 
207 void rsxSetWriteBackendLabel(gcmContextData *context,u8 index,u32 value);
208 
209 void rsxSetViewportClip(gcmContextData *context,u8 sel,u16 width,u16 height);
210 
256 void rsxSetViewport(gcmContextData *context,u16 x,u16 y,u16 width,u16 height,f32 min,f32 max,const f32 scale[4],const f32 offset[4]);
257 
264 void rsxInvalidateTextureCache(gcmContextData *context,u32 type);
265 
271 void rsxLoadTexture(gcmContextData *context,u8 index,const gcmTexture *texture);
272 
292 void rsxTextureControl(gcmContextData *context,u8 index,u32 enable,u16 minlod,u16 maxlod,u8 maxaniso);
293 void rsxTextureFilter(gcmContextData *context,u8 index,u8 min,u8 mag,u8 conv);
294 void rsxTextureWrapMode(gcmContextData *context,u8 index,u8 wraps,u8 wrapt,u8 wrapr,u8 unsignedRemap,u8 zfunc,u8 gamma);
295 
301 void rsxLoadVertexProgram(gcmContextData *context,rsxVertexProgram *program,const void *ucode);
302 
311 void rsxLoadFragmentProgramLocation(gcmContextData *context,rsxFragmentProgram *program,u32 offset,u32 location);
312 void rsxZControl(gcmContextData *context,u8 cullNearFar,u8 zClampEnable,u8 cullIgnoreW);
313 void rsxLoadVertexProgramBlock(gcmContextData *context,rsxVertexProgram *program,const void *ucode);
314 void rsxLoadVertexProgramParameterBlock(gcmContextData *context,u32 base_const,u32 const_cnt,const f32 *value);
315 void rsxSetVertexProgramParameter(gcmContextData *context,rsxVertexProgram *program,s32 index,const f32 *value);
316 void rsxSetFragmentProgramParameter(gcmContextData *context,rsxFragmentProgram *program,s32 index,const f32 *value,u32 offset);
317 void rsxDrawVertexArray(gcmContextData *context,u32 type,u32 start,u32 count);
318 void rsxBindVertexArrayAttrib(gcmContextData *context,u8 attr,u32 offset,u8 stride,u8 elems,u8 dtype,u8 location);
319 void rsxDrawIndexArray(gcmContextData *context,u32 type,u32 offset,u32 count,u32 data_type,u32 location);
320 void rsxInlineTransfer(gcmContextData *context,const u32 dstOffset,const void *srcAddress,const u32 sizeInWords,const u8 location);
321 void rsxSetUserClipPlaneControl(gcmContextData *context,u32 plane0,u32 plane1,u32 plane2,u32 plane3,u32 plane4,u32 plane5);
322 
435 void rsxSetBlendFunc(gcmContextData *context,u16 sfcolor,u16 dfcolor,u16 sfalpha,u16 dfalpha);
436 
490 void rsxSetBlendEquation(gcmContextData *context,u16 color,u16 alpha);
491 
492 
498 void rsxSetBlendColor(gcmContextData *context,u32 color0,u32 color1);
499 
506 void rsxSetBlendEnable(gcmContextData *context,u32 enable);
507 
508 void rsxSetTransformBranchBits(gcmContextData *context,u32 branchBits);
509 
518 void rsxSetTransferDataMode(gcmContextData *context,u8 mode);
519 
525 void rsxSetTransferDataOffset(gcmContextData *context,u32 dst,u32 src);
526 
536 void rsxSetTransferDataFormat(gcmContextData *context,s32 inpitch,s32 outpitch,u32 linelength,u32 linecount,u8 inbytes,u8 outbytes);
537 
552 void rsxSetTransferData(gcmContextData *context,u8 mode,u32 dst,u32 outpitch,u32 src,u32 inpitch,u32 linelength,u32 linecount);
553 
565 void rsxSetTransferScaleMode(gcmContextData *context,const u8 mode,const u8 surface);
566 
572 void rsxSetTransferScaleSurface(gcmContextData *context,const gcmTransferScale *scale,const gcmTransferSurface *surface);
573 
593 void rsxSetTransferImage(gcmContextData *context,const u8 mode,const u32 dstOffset,const u32 dstPitch,const u32 dstX,const u32 dstY,const u32 srcOffset,const u32 srcPitch,const u32 srcX,const u32 srcY,const u32 width,const u32 height,const u32 bytesPerPixel);
594 void rsxSetTimeStamp(gcmContextData *context,u32 index);
595 
596 #if 0
597 
599 void rsxSetTransferScaleSwizzle(gcmContextData *context,const gcmTransferScale *scale,const gcmTransferSwizzle *swizzle);
600 #endif
601 
602 #ifdef __cplusplus
603  }
604 #endif
605 
606 #endif
void rsxSetBlendEquation(gcmContextData *context, u16 color, u16 alpha)
Set the blend equation.
void rsxSetBlendColor(gcmContextData *context, u32 color0, u32 color1)
Set the blending constant color.
void rsxSetWaitLabel(gcmContextData *context, u8 index, u32 value)
Enqueues a Wait for label command.
void rsxSetBlendFunc(gcmContextData *context, u16 sfcolor, u16 dfcolor, u16 sfalpha, u16 dfalpha)
Specify pixel arithmetic.
Definition: gcm_sys.h:769
void rsxLoadFragmentProgramLocation(gcmContextData *context, rsxFragmentProgram *program, u32 offset, u32 location)
Load a compiled fragment shader program.
void rsxSetBlendEnable(gcmContextData *context, u32 enable)
Enable or disable blending.
void rsxSetCullFaceEnable(gcmContextData *context, u32 enable)
Enable/Disable face culling.
void rsxLoadTexture(gcmContextData *context, u8 index, const gcmTexture *texture)
Loads a texture.
void rsxSetDepthFunc(gcmContextData *context, u32 func)
Specify the value used for depth buffer comparisons.
RSX target surface data structure.
Definition: gcm_sys.h:449
void rsxSetDepthWriteEnable(gcmContextData *context, u32 enable)
Enable/Disable write to depth buffer.
Fragment program data structure.
Definition: rsx_program.h:50
Vertex program data structure.
Definition: rsx_program.h:29
void rsxSetColorMaskMRT(gcmContextData *context, u32 mask)
Enable or disable write access to the framebuffer color components (Multiple Render Target output).
void rsxSetTransferDataMode(gcmContextData *context, u8 mode)
Configuration the mode for an upcoming asynchronous RSX DMA transfer.
void rsxSetColorMask(gcmContextData *context, u32 mask)
Enable or disable write access to the framebuffer color components.
void rsxSetCullFace(gcmContextData *context, u32 cull)
Set culling mode.
Specify destination surface characteristics for rsxSetTransferScaleSurface().
Definition: gcm_sys.h:750
void rsxSetTransferScaleMode(gcmContextData *context, const u8 mode, const u8 surface)
Configure an upcoming asynchronous RSX blit.
void rsxSetClearDepthValue(gcmContextData *context, u32 value)
Set the clear depth value.
Specify scaled image blit geometry and format for rsxSetTransferScaleSurface().
Definition: gcm_sys.h:639
void rsxSetWriteBackendLabel(gcmContextData *context, u8 index, u32 value)
Enqueues a Write Backend label command.
void rsxInvalidateTextureCache(gcmContextData *context, u32 type)
Invalidates a texture cache.
void rsxLoadVertexProgram(gcmContextData *context, rsxVertexProgram *program, const void *ucode)
Load a compiled vertex shader program.
void rsxSetDepthTestEnable(gcmContextData *context, u32 enable)
Enable or disable the depth test.
RSX shader programming management.
void rsxTextureControl(gcmContextData *context, u8 index, u32 enable, u16 minlod, u16 maxlod, u8 maxaniso)
Set texture control parameters.
void rsxSetSurface(gcmContextData *context, gcmSurface *surface)
Setup the render surface.
void rsxSetTransferScaleSurface(gcmContextData *context, const gcmTransferScale *scale, const gcmTransferSurface *surface)
Initiate an asynchronous RSX blit.
void rsxSetShadeModel(gcmContextData *context, u32 shadeModel)
Set the shading model for the render sequence.
void rsxClearSurface(gcmContextData *context, u32 clear_mask)
Clear the render surface.
RSX Context data structure.
Definition: gcm_sys.h:412
void rsxSetTransferDataOffset(gcmContextData *context, u32 dst, u32 src)
Specify the memory locations for an RSX DMA transfer. This function should be called after rsxSetTran...
void rsxDrawVertexBegin(gcmContextData *context, u32 type)
Start the render sequence.
void rsxSetViewport(gcmContextData *context, u16 x, u16 y, u16 width, u16 height, f32 min, f32 max, const f32 scale[4], const f32 offset[4])
Set viewport.
RSX Texture data structure.
Definition: gcm_sys.h:551
void rsxSetTransferData(gcmContextData *context, u8 mode, u32 dst, u32 outpitch, u32 src, u32 inpitch, u32 linelength, u32 linecount)
Initiate an asynchronous RSX DMA transfer.
void rsxSetTransferImage(gcmContextData *context, const u8 mode, const u32 dstOffset, const u32 dstPitch, const u32 dstX, const u32 dstY, const u32 srcOffset, const u32 srcPitch, const u32 srcX, const u32 srcY, const u32 width, const u32 height, const u32 bytesPerPixel)
Initialiate an asynchronous transfer of a rectangular image from one area of memory to another.
void rsxSetTransferDataFormat(gcmContextData *context, s32 inpitch, s32 outpitch, u32 linelength, u32 linecount, u8 inbytes, u8 outbytes)
Format an upcoming asynchronous RSX DMA transfer.
void rsxDrawVertexEnd(gcmContextData *context)
Stop the render sequence.
RSX low level management.
void rsxSetClearColor(gcmContextData *context, u32 color)
Set the clear color.
void rsxSetFrontFace(gcmContextData *context, u32 dir)
Set drawing direction of front face.
void rsxSetWriteCommandLabel(gcmContextData *context, u8 index, u32 value)
Enqueues a Write Command label command.