Commands
Command Format
Field |
Description |
|---|---|
[31:24] |
Opcode |
[23:0] |
Parameter |
Opcodes
OP_SET_*
Set a fixed point value for a given parameter. Values are 32-bit and passed in two 16-bit chunks, except for V0..V2 coordinates which are sent as a single 16-bit chunk.
Field |
Description |
|---|---|
[0:15] |
16-bit value |
[16] |
0=LSB, 1=MSB (ignored for 16-bit coordinates) |
[31:24] |
Opcode (0..23) |
Parameter Formats: - V0_X, V0_Y, V1_X, V1_Y, V2_X, V2_Y: 12.4 fixed point format (16-bit) - START_W_INV, DW_DX, DW_DY: 4.28 fixed point format (32-bit) - START_S, START_T, DS_DX, DS_DY, DT_DX, DT_DY: 14.18 fixed point format (32-bit) - START_R, START_G, START_B, DR_DX, DR_DY, DG_DX, DG_DY, DB_DX, DB_DY: 12.20 fixed point format (32-bit) - START_SU, START_SV, DSU_DX, DSU_DY, DSV_DX, DSV_DY: 14.18 fixed point format (32-bit) - START_SZ, DSZ_DX, DSZ_DY: 12.20 fixed point format (32-bit)
OP_CLEAR
Field |
Description |
|---|---|
[15:0] |
Color (RGB565) |
[16] |
0=frame buffer, 1=depth buffer |
[31:24] |
Opcode (24) |
OP_DRAW
Field |
Description |
|---|---|
[0] |
0=not textured, 1=textured |
[1] |
0=wrap T, 1=clamp T |
[2] |
0=wrap S, 1=clamp S |
[3] |
0=depth test disabled, 1=depth test enabled |
[4] |
0=perspective correction disabled, 1=perspective correction enabled |
[5] |
0=positive area, 1=negative area (winding sign bit) |
[8:6] |
Texture width scale (0=32, 1=64, 2=128, 3=256, 4=512, 5=1024, 6=2048, 7=4096) |
[11:9] |
Texture height scale (0=32, 1=64, 2=128, 3=256, 4=512, 5=1024, 6=2048, 7=4096) |
[12] |
0=shade, 1=depth only (no texture fetch, no color write; depth is interpolated SZ) |
[13] |
0=shadow compare off, 1=sample the shadow map and darken occluded pixels |
[31:24] |
Opcode (25) |
OP_SET_VIEWPORT
Field |
Description |
|---|---|
[11:0] |
Viewport width in pixels |
[23:12] |
Viewport height in pixels |
[31:24] |
Opcode (38) |
Depth clears cover width * height samples at the current depth address. The rasterizer clips and addresses using this viewport. A power-of-two size (the shadow map) or the framebuffer size configured at elaboration are the supported dimensions.
OP_SET_ZB_ADDR
Absolute depth-buffer address in 16-bit words. Same two-beat encoding as OP_SET_TEX_ADDR.
OP_SET_SHADOW
Absolute shadow-map address in 16-bit words. Same two-beat encoding as OP_SET_TEX_ADDR. Samples are raw 16-bit depth, not RGB4444.
OP_SET_SHADOW_PARAM
Field |
Description |
|---|---|
[2:0] |
Shadow map width scale (0=32 .. 7=4096), same encoding as texture scale |
[5:3] |
Shadow map height scale |
[21:6] |
Constant depth bias added to interpolated SZ before the compare |
[31:24] |
Opcode (41) |
A pixel is darkened by half when it is inside the map, the fetched depth is below 20000, and SZ + bias is greater than the fetched depth. Coordinates outside the map stay lit.
OP_SWAP
Field |
Description |
|---|---|
[0] |
0=do not wait for vsync, 1=wait for vsync |
[31:24] |
Opcode (26) |
OP_SET_TEX_ADDR
Field |
Description |
|---|---|
[0:15] |
16-bit value |
[16] |
0=LSB, 1=MSB |
[31:24] |
Opcode (27) |
OP_SET_FB_ADDR
Field |
Description |
|---|---|
[0:15] |
16-bit value |
[16] |
0=LSB, 1=MSB |
[17] |
0=double buffer (back != front), 1=single buffer (back == front) |
[31:24] |
Opcode (28) |