nngxAddMemoryFillCommand Function
NNGX_APICALL void NNGX_APIENTRY nngxAddMemoryFillCommand(
GLvoid * startaddr0,
GLsizei size0,
GLuint data0,
GLsizei width0,
GLvoid * startaddr1,
GLsizei size1,
GLuint data1,
GLsizei width1
);
| Name | Description | |
|---|---|---|
| in | startaddr0 | Start address of the memory region to fill (channel 0). |
| in | size0 | Size in bytes to fill (channel 0) |
| in | data0 | Fill data to use (channel 0) |
| in | width0 | Bit width of the fill pattern (16, 24, or 32) (channel 0) |
| in | startaddr1 | Start address of the memory region to fill (channel 1). |
| in | size1 | Size in bytes to fill (channel 1) |
| in | data1 | Fill data to use (channel 1) |
| in | width1 | Bit width of the fill pattern (16, 24, or 32) (channel 1) |
Adds a command to fill the memory.
Use this function to clear the color and depth (stencil) buffers by filling memory with a specified data pattern. The glClear function provides equivalent functionality, but this function has more general uses.
You can fill two regions using separate parameters for each. Channel 0 is configured by startaddr0, size0, data0, and width0. Channel 1 is configured by startaddr1, size1, data1, and width1.
Memory is filled starting at addresses startaddr0 and startaddr1. The startaddr0 and startaddr1 addresses must be 16-byte aligned. If an address is 0, its corresponding channel is not used. This function can only fill memory to VRAM. It cannot fill to main memory (FCRAM).
size0 and size1 bytes of memory are filled. Both size0 and size1 must be multiples of 16.
The data0 and data1 arguments specify the fill data. The data specified in each argument is repeated until the specified size is filled.
The number of bits in each fill pattern is specified by width0 and width1. You can specify 16, 24, or 32. If you specify 16, memory is filled 16 bits at a time using bits [15:0] of data0 and data1. If you specify 24, memory is filled 24 bits at a time using bits [23:0] of data0 and data1. If you specify 32, memory is filled 32 bits at a time using bits [31:0] of data0 and data1.
The following table shows sample argument values for each color buffer format.
| Format | data0 or data1 | width0 or width1 |
| GL_RGBA8_OES | R[31:24], G[23:16], B[15:8], A[7:0] | 32 |
| GL_RGBA4 | R[15:12], G[11:8], B[7:4], A[3:0] | 16 |
| GL_RGB5_A1 | R[15:11], G[10:6], B[5:1], A[0:0] | 16 |
| GL_RGB565 | R[15:11], G[10:5], B[4:0] | 16 |
GL_DEPTH24_STENCIL8_EXT | stencil[31:24], depth[23:0] | 32 |
GL_DEPTH_COMPONENT24_OES | depth[23:0] | 24 |
GL_DEPTH_COMPONENT16 | depth[15:0] | 16 |
The following errors occur with this function.
| GL_ERROR_8078_DMP | 0 is bound to the current command list or the command request queue is full. |
|---|---|
| GL_ERROR_8079_DMP | The startaddr0 or startaddr1 value is not 16-byte aligned. |
| GL_ERROR_807A_DMP | The size0 or size1 value is not a multiple of 16. |
| GL_ERROR_807B_DMP | The width0 or width1 value is invalid. |
0. The size1, data1, and width1 arguments are not checked for errors when startaddr1 is set to 0.
Channel 0 and channel 1 are executed simultaneously. If they have overlapping regions, it is undefined which result will ultimately be applied.
CONFIDENTIAL