psl1ght
A free SDK for Sony's PS3 console
|
RSX commands. More...
Go to the source code of this file.
Functions | |
void | rsxSetFrontFace (gcmContextData *context, u32 dir) |
Set drawing direction of front face. More... | |
void | rsxSetCullFace (gcmContextData *context, u32 cull) |
Set culling mode. More... | |
void | rsxSetCullFaceEnable (gcmContextData *context, u32 enable) |
Enable/Disable face culling. More... | |
void | rsxSetDepthWriteEnable (gcmContextData *context, u32 enable) |
Enable/Disable write to depth buffer. More... | |
void | rsxDrawVertexEnd (gcmContextData *context) |
Stop the render sequence. More... | |
void | rsxSetShadeModel (gcmContextData *context, u32 shadeModel) |
Set the shading model for the render sequence. More... | |
void | rsxDrawVertexBegin (gcmContextData *context, u32 type) |
Start the render sequence. More... | |
void | rsxDrawVertex2f (gcmContextData *context, u8 idx, f32 x, f32 y) |
void | rsxDrawVertex3f (gcmContextData *context, u8 idx, f32 x, f32 y, f32 z) |
void | rsxDrawVertex4f (gcmContextData *context, u8 idx, f32 x, f32 y, f32 z, f32 w) |
void | rsxSetScissor (gcmContextData *context, u16 x, u16 y, u16 w, u16 h) |
void | rsxSetDepthFunc (gcmContextData *context, u32 func) |
Specify the value used for depth buffer comparisons. More... | |
void | rsxSetDepthTestEnable (gcmContextData *context, u32 enable) |
Enable or disable the depth test. More... | |
void | rsxClearSurface (gcmContextData *context, u32 clear_mask) |
Clear the render surface. More... | |
void | rsxSetClearDepthValue (gcmContextData *context, u32 value) |
Set the clear depth value. More... | |
void | rsxSetReturnCommand (gcmContextData *context) |
void | rsxSetCallCommand (gcmContextData *context, u32 offset) |
void | rsxSetJumpCommand (gcmContextData *context, u32 offset) |
void | rsxSetNopCommand (gcmContextData *context, u32 count) |
void | rsxSetClearColor (gcmContextData *context, u32 color) |
Set the clear color. More... | |
void | rsxSetColorMask (gcmContextData *context, u32 mask) |
Enable or disable write access to the framebuffer color components. More... | |
void | rsxSetColorMaskMRT (gcmContextData *context, u32 mask) |
Enable or disable write access to the framebuffer color components (Multiple Render Target output). More... | |
void | rsxSetSurface (gcmContextData *context, gcmSurface *surface) |
Setup the render surface. More... | |
void | rsxSetReferenceCommand (gcmContextData *context, u32 ref_value) |
void | rsxSetWaitLabel (gcmContextData *context, u8 index, u32 value) |
Enqueues a Wait for label command. More... | |
void | rsxSetWriteCommandLabel (gcmContextData *context, u8 index, u32 value) |
Enqueues a Write Command label command. More... | |
void | rsxSetWriteBackendLabel (gcmContextData *context, u8 index, u32 value) |
Enqueues a Write Backend label command. More... | |
void | rsxSetViewportClip (gcmContextData *context, u8 sel, u16 width, u16 height) |
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. More... | |
void | rsxInvalidateTextureCache (gcmContextData *context, u32 type) |
Invalidates a texture cache. More... | |
void | rsxLoadTexture (gcmContextData *context, u8 index, const gcmTexture *texture) |
Loads a texture. More... | |
void | rsxTextureControl (gcmContextData *context, u8 index, u32 enable, u16 minlod, u16 maxlod, u8 maxaniso) |
Set texture control parameters. More... | |
void | rsxTextureFilter (gcmContextData *context, u8 index, u8 min, u8 mag, u8 conv) |
void | rsxTextureWrapMode (gcmContextData *context, u8 index, u8 wraps, u8 wrapt, u8 wrapr, u8 unsignedRemap, u8 zfunc, u8 gamma) |
void | rsxLoadVertexProgram (gcmContextData *context, rsxVertexProgram *program, const void *ucode) |
Load a compiled vertex shader program. More... | |
void | rsxLoadFragmentProgramLocation (gcmContextData *context, rsxFragmentProgram *program, u32 offset, u32 location) |
Load a compiled fragment shader program. More... | |
void | rsxZControl (gcmContextData *context, u8 cullNearFar, u8 zClampEnable, u8 cullIgnoreW) |
void | rsxLoadVertexProgramBlock (gcmContextData *context, rsxVertexProgram *program, const void *ucode) |
void | rsxLoadVertexProgramParameterBlock (gcmContextData *context, u32 base_const, u32 const_cnt, const f32 *value) |
void | rsxSetVertexProgramParameter (gcmContextData *context, rsxVertexProgram *program, s32 index, const f32 *value) |
void | rsxSetFragmentProgramParameter (gcmContextData *context, rsxFragmentProgram *program, s32 index, const f32 *value, u32 offset) |
void | rsxDrawVertexArray (gcmContextData *context, u32 type, u32 start, u32 count) |
void | rsxBindVertexArrayAttrib (gcmContextData *context, u8 attr, u32 offset, u8 stride, u8 elems, u8 dtype, u8 location) |
void | rsxDrawIndexArray (gcmContextData *context, u32 type, u32 offset, u32 count, u32 data_type, u32 location) |
void | rsxInlineTransfer (gcmContextData *context, const u32 dstOffset, const void *srcAddress, const u32 sizeInWords, const u8 location) |
void | rsxSetUserClipPlaneControl (gcmContextData *context, u32 plane0, u32 plane1, u32 plane2, u32 plane3, u32 plane4, u32 plane5) |
void | rsxSetBlendFunc (gcmContextData *context, u16 sfcolor, u16 dfcolor, u16 sfalpha, u16 dfalpha) |
Specify pixel arithmetic. More... | |
void | rsxSetBlendEquation (gcmContextData *context, u16 color, u16 alpha) |
Set the blend equation. More... | |
void | rsxSetBlendColor (gcmContextData *context, u32 color0, u32 color1) |
Set the blending constant color. More... | |
void | rsxSetBlendEnable (gcmContextData *context, u32 enable) |
Enable or disable blending. More... | |
void | rsxSetTransformBranchBits (gcmContextData *context, u32 branchBits) |
void | rsxSetTransferDataMode (gcmContextData *context, u8 mode) |
Configuration the mode for an upcoming asynchronous RSX DMA transfer. More... | |
void | rsxSetTransferDataOffset (gcmContextData *context, u32 dst, u32 src) |
Specify the memory locations for an RSX DMA transfer. This function should be called after rsxSetTransferDataMode() and rsxSetTransferDataFormat(). More... | |
void | rsxSetTransferDataFormat (gcmContextData *context, s32 inpitch, s32 outpitch, u32 linelength, u32 linecount, u8 inbytes, u8 outbytes) |
Format an upcoming asynchronous RSX DMA transfer. More... | |
void | rsxSetTransferData (gcmContextData *context, u8 mode, u32 dst, u32 outpitch, u32 src, u32 inpitch, u32 linelength, u32 linecount) |
Initiate an asynchronous RSX DMA transfer. More... | |
void | rsxSetTransferScaleMode (gcmContextData *context, const u8 mode, const u8 surface) |
Configure an upcoming asynchronous RSX blit. More... | |
void | rsxSetTransferScaleSurface (gcmContextData *context, const gcmTransferScale *scale, const gcmTransferSurface *surface) |
Initiate an asynchronous RSX blit. More... | |
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. More... | |
void | rsxSetTimeStamp (gcmContextData *context, u32 index) |
RSX commands.
These are functions to enqueue commands into the RSX's command buffer.
void rsxClearSurface | ( | gcmContextData * | context, |
u32 | clear_mask | ||
) |
Clear the render surface.
This function clears the chosen selection of color components, depth and stencil values for all pixels in the destination surface. The clear color can be chosen using rsxSetClearColor, and the clear value for the depth buffer is set using rsxSetClearDepthValue.
context | Pointer to the context object. |
clear_mask | A selection of components to be cleared. Must be an OR combination of the following values:
|
void rsxDrawVertexBegin | ( | gcmContextData * | context, |
u32 | type | ||
) |
Start the render sequence.
Starts the rendering for a primitive.
context | Pointer to the context object. |
type | Type of primitive to render. Possible values are: |
void rsxDrawVertexEnd | ( | gcmContextData * | context | ) |
Stop the render sequence.
Stops the rendering for a primitive, started by rsxDrawVertexBegin.
context | Pointer to the context object. |
void rsxInvalidateTextureCache | ( | gcmContextData * | context, |
u32 | type | ||
) |
Invalidates a texture cache.
context | Pointer to the context object. |
type | Type of texture cache to be invalidated. Possible values are: |
void rsxLoadFragmentProgramLocation | ( | gcmContextData * | context, |
rsxFragmentProgram * | program, | ||
u32 | offset, | ||
u32 | location | ||
) |
Load a compiled fragment shader program.
context | Pointer to the context object |
program | Pointer to the fragment program configuration |
offset | Memory offset of fragment program |
location | Memory location type where the program relies. Possible values are: |
void rsxLoadTexture | ( | gcmContextData * | context, |
u8 | index, | ||
const gcmTexture * | texture | ||
) |
Loads a texture.
context | Pointer to the context object. |
index | Texture index. |
texture | Pointer to the texture data. |
void rsxLoadVertexProgram | ( | gcmContextData * | context, |
rsxVertexProgram * | program, | ||
const void * | ucode | ||
) |
Load a compiled vertex shader program.
context | Pointer to the context object |
program | Pointer to the vertex program configuration |
ucode | Pointer to the shader micro code |
void rsxSetBlendColor | ( | gcmContextData * | context, |
u32 | color0, | ||
u32 | color1 | ||
) |
Set the blending constant color.
context | Pointer to the context object |
color0 | all A, R, G, B components in 8-bit component mode |
color1 | reserved for 16-bit components |
void rsxSetBlendEnable | ( | gcmContextData * | context, |
u32 | enable | ||
) |
Enable or disable blending.
context | Pointer to the context object |
enable |
|
void rsxSetBlendEquation | ( | gcmContextData * | context, |
u16 | color, | ||
u16 | alpha | ||
) |
Set the blend equation.
The blend equations determine how a new pixel (the “source” color) is combined with a pixel already in the framebuffer (the “destination” color). This function specifies one blend equation for the RGB-color components and one blend equation for the alpha component.
These equations use the source and destination blend factors specified by rsxSetBlendFunc. See rsxSetBlendFunc for a description of the various blend factors.
In the equations that follow, source and destination color components are referred to as Rs, Gs, Bs, As and Rd, Gd, Bd, Ad, respectively. The result color is referred to as Rr, Gr, Br, Ar. The source and destination blend factors are denoted sR, sG, sB, sA and dR, dG, dB, dA, respectively. For these equations all color components are understood to have values in the range [0,1].
Mode | Rr | Gr | Br | Ar |
---|---|---|---|---|
GCM_FUNC_ADD | RssR+RddR | GssG+GddG | BssB+BddB | AssA+AddA |
GCM_MIN | min(Rs,Rd) | min(Gs,Gd) | min(Bs,Bd) | min(As,Ad) |
GCM_MAX | max(Rs,Rd) | max(Gs,Gd) | max(Bs,Bd) | max(As,Ad) |
GCM_FUNC_SUBTRACT | RssR-RddR | GssG-GddG | BssB-BddB | AssA-AddA |
GCM_FUNC_REVERSE_SUBTRACT | RddR-RssR | GddG-GssG | BddB-BssB | AddA-AssA |
The results of these equations are clamped to the range [0,1].
The GCM_MIN and GCM_MAX equations are useful for applications that analyze image data (image thresholding against a constant color, for example). The GCM_FUNC_ADD equation is useful for antialiasing and transparency, among other things.
Initially, both the RGB blend equation and the alpha blend equation are set to GCM_FUNC_ADD.
The GCM_MIN, and GCM_MAX equations do not use the source or destination factors, only the source and destination colors.
context | Pointer to the context object |
color | Specifies the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined. |
alpha | Specifies the alpha blend equation, how the alpha component of the source and destination colors are combined. |
void rsxSetBlendFunc | ( | gcmContextData * | context, |
u16 | sfcolor, | ||
u16 | dfcolor, | ||
u16 | sfalpha, | ||
u16 | dfalpha | ||
) |
Specify pixel arithmetic.
In RGBA mode, pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the frame buffer (the destination values). Blending is initially disabled. Use rsxSetBlendEnable to enable and disable blending.
rsxSetBlendFunc
defines the operation of blending when it is enabled. sfcolor
and and sfalpha
specify which method is used to scale the source color and alpha components. dfcolor
and and dfalpha
specify which method is used to scale the destination color and alpha components. The possible methods are described in the following table. Each method defines four scale factors, one each for red, green, blue, and alpha. In the table and in subsequent equations, source and destination color components are referred to as Rs, Gs, Bs, As and Rd, Gd, Bd, Ad, respectively. The color specified by rsxSetBlendColor is referred to as Rc, Gc, Bc, Ac. They are understood to have integer values between 0 and kR, kG, kB, kA, where
kc = 2mc - 1
and mR, mG, mB, mA is the number of red, green, blue, and alpha bitplanes.
Source and destination scale factors are referred to as sR, sG, sB, sA and dR, dG, dB, dA. The scale factors described in the table, denoted fR, fG, fB, fA, represent either source or destination factors. All scale factors have range [0,1].
Parameter | fR | fG | fB | fA |
---|---|---|---|---|
GCM_ZERO | 0 | 0 | 0 | 0 |
GCM_ONE | 1 | 1 | 1 | 1 |
GCM_SRC_COLOR | Rs/kR | Gs/kG | Bs/kB | As/kA |
GCM_ONE_MINUS_SRC_COLOR | 1-Rs/kR | 1-Gs/kG | 1-Bs/kB | 1-As/kA |
GCM_DST_COLOR | Rd/kR | Gd/kG | Bd/kB | Ad/kA |
GCM_ONE_MINUS_DST_COLOR | 1-Rd/kR | 1-Gd/kG | 1-Bd/kB | 1-Ad/kA |
GCM_SRC_ALPHA | As/kA | As/kA | As/kA | As/kA |
GCM_ONE_MINUS_SRC_ALPHA | 1-As/kA | 1-As/kA | 1-As/kA | 1-As/kA |
GCM_DST_ALPHA | Ad/kA | Ad/kA | Ad/kA | Ad/kA |
GCM_ONE_MINUS_DST_ALPHA | 1-Ad/kA | 1-Ad/kA | 1-Ad/kA | 1-Ad/kA |
GCM_CONSTANT_COLOR | Rc | Gc | Bc | Ac |
GCM_ONE_MINUS_CONSTANT_COLOR | 1-Rc | 1-Gc | 1-Bc | 1-Ac |
GCM_CONSTANT_ALPHA | Ac | Ac | Ac | Ac |
GCM_ONE_MINUS_CONSTANT_ALPHA | 1-Ac | 1-Ac | 1-Ac | 1-Ac |
GCM_SRC_ALPHA_SATURATE | i | i | i | 1 |
In the table,
i = min(As/kA, 1 - Ad/kA)
To determine the blended RGBA values of a pixel when drawing in RGBA mode, the equation defined by rsxSetBlendEquation us used. In the default mode (GCM_FUNC_ADD for RGB and alpha equations), the equations are the following:
Despite the apparent precision of the above equations, blending arithmetic is not exactly specified, because blending operates with imprecise integer color values. However, a blend factor that should be equal to 1 is guaranteed not to modify its multiplicand, and a blend factor equal to 0 reduces its multiplicand to 0. For example, when sfcolor
is GCM_SRC_ALPHA, fdcolor
is GCM_ONE_MINUS_SRC_ALPHA, and As is equal to kA, the equations reduce to simple replacement:
Rd = Rs ; Gd = Gs ; Bd = Bs
Transparency is best implemented using blend function (sfcolor
= sfalpha
= GCM_SRC_ALPHA, dfcolor
= dfalpha
= GCM_ONE_MINUS_SRC_ALPHA) with primitives sorted from farthest to nearest. Note that this transparency calculation does not require the presence of alpha bitplanes in the frame buffer.
Blend function (GCM_SRC_ALPHA, GCM_ONE_MINUS_SRC_ALPHA) is also useful for rendering antialiased points and lines in arbitrary order.
Polygon antialiasing is optimized using blend function (GCM_SRC_ALPHA_SATURATE, GCM_ONE) with polygons sorted from nearest to farthest. Destination alpha bitplanes, which must be present for this blend function to operate correctly, store the accumulated coverage.
Incoming (source) alpha is correctly thought of as a material opacity, ranging from 1.0 ( kA ), representing complete opacity, to 0.0 (0), representing complete transparency.
context | Pointer to the context object |
sfcolor | Specifies how the red, green, and blue source blending factors are computed. |
dfcolor | Specifies how the red, green, and blue source blending factors are computed. |
sfalpha | Specifies how the alpha source blending factor is computed. |
dfalpha | Specifies how the alpha destination blending factor is computed. |
void rsxSetClearColor | ( | gcmContextData * | context, |
u32 | color | ||
) |
Set the clear color.
The clear color value is used by the rsxClearSurface function.
context | Pointer to the context object. |
color | The clear color value. |
void rsxSetClearDepthValue | ( | gcmContextData * | context, |
u32 | value | ||
) |
Set the clear depth value.
This value is used by the rsxClearSurface function.
context | Pointer to the context object. |
value | Color value |
void rsxSetColorMask | ( | gcmContextData * | context, |
u32 | mask | ||
) |
Enable or disable write access to the framebuffer color components.
context | Pointer to the context object. |
mask | A selection of the components to enable write access. It is an OR combination of the following values: |
void rsxSetColorMaskMRT | ( | gcmContextData * | context, |
u32 | mask | ||
) |
Enable or disable write access to the framebuffer color components (Multiple Render Target output).
context | Pointer to the context object. |
mask | A selection of the components to enable write access. It is an OR combination of the following values: |
void rsxSetCullFace | ( | gcmContextData * | context, |
u32 | cull | ||
) |
Set culling mode.
context | Pointer to context object. |
cull | Type of cull mode. Possible values are: |
void rsxSetCullFaceEnable | ( | gcmContextData * | context, |
u32 | enable | ||
) |
void rsxSetDepthFunc | ( | gcmContextData * | context, |
u32 | func | ||
) |
Specify the value used for depth buffer comparisons.
context | Pointer to the context object. |
func | Specifies the depth comparison function. Possible values are: |
void rsxSetDepthTestEnable | ( | gcmContextData * | context, |
u32 | enable | ||
) |
Enable or disable the depth test.
If depth test is enabled, the GPU performs depth comparisons and updates the depth buffer. Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled.
void rsxSetDepthWriteEnable | ( | gcmContextData * | context, |
u32 | enable | ||
) |
void rsxSetFrontFace | ( | gcmContextData * | context, |
u32 | dir | ||
) |
Set drawing direction of front face.
context | Pointer to the context object. |
dir | Drawing direction of front face. Possible values are: |
void rsxSetShadeModel | ( | gcmContextData * | context, |
u32 | shadeModel | ||
) |
Set the shading model for the render sequence.
context | Pointer to the context object. |
shadeModel | Type of shading model. Possible values are: |
void rsxSetSurface | ( | gcmContextData * | context, |
gcmSurface * | surface | ||
) |
Setup the render surface.
This function is used to setup the render target where RSX should render the frame into.
context | Pointer to the context object. |
surface | Pointer to the surface object. |
void rsxSetTransferData | ( | gcmContextData * | context, |
u8 | mode, | ||
u32 | dst, | ||
u32 | outpitch, | ||
u32 | src, | ||
u32 | inpitch, | ||
u32 | linelength, | ||
u32 | linecount | ||
) |
Initiate an asynchronous RSX DMA transfer.
context | Pointer to the context object |
mode | Specify source and destination memory areas. Possible values are:
|
dst | Destination memory offset, e.g., a value returned by gcmAddressToOffset() or gcmMapMainMemory(). |
outpitch | Pitch size, in bytes, of the destination buffer (e.g., for a buffer that represents a rectangular image, this would be the width multiplied by the number of bytes in each pixel). |
src | Source memory offset, e.g., a value returned by gcmAddressToOffset() or gcmMapMainMemory(). |
inpitch | Pitch size, in bytes, of the source buffer (e.g., for a buffer that represents a rectangular image, this would be the width multiplied by the number of bytes in each pixel). |
linelength | Size, in bytes, of each line of data that will be transfered. |
linecount | Number of lines of data to transfer. |
void rsxSetTransferDataFormat | ( | gcmContextData * | context, |
s32 | inpitch, | ||
s32 | outpitch, | ||
u32 | linelength, | ||
u32 | linecount, | ||
u8 | inbytes, | ||
u8 | outbytes | ||
) |
Format an upcoming asynchronous RSX DMA transfer.
context | Pointer to the context object |
inpitch | Pitch size, in bytes, of the source buffer (e.g., for a buffer that represents a rectangular image, this would be the width multiplied by the number of bytes in each pixel). |
outpitch | Pitch size, in bytes, of the destination buffer (e.g., for a buffer that represents a rectangular image, this would be the width multiplied by the number of bytes in each pixel). |
linelength | Size, in bytes, of each line of data that will be transfered. |
linecount | Number of lines of data to transfer. |
inbytes | Number of bytes for each block (e.g., pixel) of data to be transfered: 1, 2, or 4. Will perform scatter-gather transfer if different from outbytes. |
outbytes | Number of bytes for each block (e.g., pixel) of data to be transfered: 1, 2, or 4. Will perform scatter-gather transfer if different from inbytes. |
void rsxSetTransferDataMode | ( | gcmContextData * | context, |
u8 | mode | ||
) |
Configuration the mode for an upcoming asynchronous RSX DMA transfer.
context | Pointer to the context object |
mode | Specify source and destination memory areas. Possible values are:
|
void rsxSetTransferDataOffset | ( | gcmContextData * | context, |
u32 | dst, | ||
u32 | src | ||
) |
Specify the memory locations for an RSX DMA transfer. This function should be called after rsxSetTransferDataMode() and rsxSetTransferDataFormat().
context | Pointer to the context object |
dst | Destination memory offset, e.g., a value returned by gcmAddressToOffset() or gcmMapMainMemory(). |
src | Source memory offset, e.g., a value returned by gcmAddressToOffset() or gcmMapMainMemory(). |
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.
context | Pointer to the context object |
mode | Specify source and destination memory areas. Possible values are:
|
dstOffset | Destination memory offset, e.g., a value returned by gcmAddressToOffset() or gcmMapMainMemory(). |
dstPitch | Pitch size, in bytes, of the destination image data (width multiplied by the number of bytes in each pixel). |
dstX | Origin of the destination data, relative to the beginning of the destination buffer. |
dstY | Origin of the destination data, relative to the beginning of the destination buffer. |
srcOffset | Source memory offset, e.g., a value returned by gcmAddressToOffset() or gcmMapMainMemory(). |
srcPitch | Pitch size, in bytes, of the source image data (width multiplied by the number of bytes in each pixel). |
srcX | Origin of the source rectangle, relative to the beginning of the source buffer. |
srcY | Origin of the source rectangle, relative to the beginning of the source buffer. |
width | Width of the transfer rectangle. |
height | Height of the transfer rectangle. |
bytesPerPixel | Number of bytes per pixel to transfer: 2 or 4. |
void rsxSetTransferScaleMode | ( | gcmContextData * | context, |
const u8 | mode, | ||
const u8 | surface | ||
) |
Configure an upcoming asynchronous RSX blit.
context | Pointer to the context object |
mode | Specify source and destination memory areas. Possible values are:
|
surface | Transfer surface mode. Possible values are:
|
void rsxSetTransferScaleSurface | ( | gcmContextData * | context, |
const gcmTransferScale * | scale, | ||
const gcmTransferSurface * | surface | ||
) |
Initiate an asynchronous RSX blit.
context | Pointer to the context object |
scale | Specify the transfer geometry & parameters. |
surface | Specify the surface to blit to. |
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.
This function sets the viewport.
The origin (0,0) of the normalized device coordinate points to the center of the screen.
Performing viewport conversion, where the upper left corner is the origin is as follows:
Performing viewport conversion, where the lower left corner is the origin is as follows (this is equivalent to glViewport):
context | Pointer to the context object. |
x | Origin of the viewport rectangle in pixels (0 - 4095). Initial value is (0,0). |
y | Origin of the viewport rectangle in pixels (0 - 4095). Initial value is (0,0). |
width | Width of the viewport (0 - 4096). Initial value is 4096. |
height | Height of the viewport (0 - 4096). Initial value is 4096. |
min | Minimum Z clip value. Initial value is 0.0. |
max | Maximum Z clip value. Initial value is 1.0. |
scale | Scale values to be used for viewport conversion. Initial values are (2048.0,2048.0,0.5,0.0). |
offset | Offset values to be used for viewport conversion. Initial values are (2048.0,2048.0,0.5,0.0). |
void rsxSetWaitLabel | ( | gcmContextData * | context, |
u8 | index, | ||
u32 | value | ||
) |
Enqueues a Wait for label command.
context | Pointer to the context object. |
index | Label index |
valuie | Label value |
void rsxSetWriteBackendLabel | ( | gcmContextData * | context, |
u8 | index, | ||
u32 | value | ||
) |
Enqueues a Write Backend label command.
context | Pointer to the context object. |
index | Label index |
value | Label value |
void rsxSetWriteCommandLabel | ( | gcmContextData * | context, |
u8 | index, | ||
u32 | value | ||
) |
Enqueues a Write Command label command.
context | Pointer to the context object. |
index | Label index |
value | Label value |
void rsxTextureControl | ( | gcmContextData * | context, |
u8 | index, | ||
u32 | enable, | ||
u16 | minlod, | ||
u16 | maxlod, | ||
u8 | maxaniso | ||
) |
Set texture control parameters.
context | Pointer to the context object. |
index | Texture index. |
enable | Enable flag. Possible values are: |
minlod | minimum level of detail. |
maxlod | maximum level of detail. |
maxaniso | sample level of the anisotropic filter. Possible values are: |