nngxAddMemoryFillCommand Function

Syntax

NNGX_APICALL void NNGX_APIENTRY nngxAddMemoryFillCommand(
     GLvoid * startaddr0,
     GLsizei size0,
     GLuint data0,
     GLsizei width0,
     GLvoid * startaddr1,
     GLsizei size1,
     GLuint data1,
     GLsizei width1
);

Arguments

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 Data to use to fill (channel 0)
in width0 Bit width of the pattern to use to fill (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 Data to use to fill (channel 1) *** in *** width1 *** Bit width of the pattern to use to fill (16, 24, or 32) (channel 1)
width1

Return Values

There is no return value.

Description

Adds a memory fill command.

By filling memory with a specified data pattern, this function can be used to clear the color and depth (stencil) buffers. The glClear function provides equivalent functionality, but this function has more general uses.

You can fill two regions using separate parameters for each. Channel 1 is configured by startaddr0, size0, data0, and width0. Channel 2 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.

size0 and size1 bytes of memory are filled. Both size0 and size1 must be multiples of 16.

The data0 and data1 arguments specify the data to use to fill. 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. Given a value of 16, memory is filled 16 bits at a time using bits [15:0] of data0 and data1. Given a value of 24, memory is filled 24 bits at a time using bits [23:0] of data0 and data1. Given a value of 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.

formatdata0 or data1width0 or width1
GL_RGBA8_OESR[31:24], G[23:16], B[15:8], A[7:0]32
GL_RGBA4R[15:12], G[11:8], B[7:4], A[3:0]16
GL_RGB5_A1R[15:11], G[10:6], B[5:1], A[0:0]16
GL_RGB565R[15:11], G[10:5], B[4:0]16
GL_DEPTH24_STENCIL8_EXTstencil[31:24], depth[23:0]32
GL_DEPTH_COMPONENT24_OESdepth[23:0]24
GL_DEPTH_COMPONENT16depth[15:0]16

The following errors occur in this function.

GL_ERROR_8078_DMP0 is bound to the current command list or the command request queue is full.
GL_ERROR_8079_DMPThe startaddr0 or startaddr1 value is not 16-byte aligned.
GL_ERROR_807A_DMPThe size0 or size1 value is not a multiple of 16.
GL_ERROR_807B_DMPThe width0 or width1 value is invalid.
The size0, data0, and width0 arguments are not checked for errors when startaddr0 is set to 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.

Revision History

2010/09/15
Initial version.

CONFIDENTIAL