GL_APICALL void GL_APIENTRY glCompressedTexImage2D(
GLenum target,
GLint level,
GLenum internalformat,
GLsizei width,
GLsizei height,
GLint border,
GLsizei imageSize,
const void * data
);
| Name | Description | |
|---|---|---|
| in | target | Target texture |
| in | level | Mipmap level of the data to load |
| in | internalformat | Texture format (only GL_ETC1_RGB8_NATIVE_DMP is valid) |
| in | width | Texture width |
| in | height | Texture height |
| in | border | Border width (only 0 is valid) |
| in | imageSize | Texture data size |
| in | data | Pointer to the texture data |
Loads compressed-format texture data.
Set target to one the following values.
| GL_TEXTURE_2D | 2D texture |
|---|---|
| GL_TEXTURE_CUBE_MAP_NEGATIVE_X | Face of a cube-map texture in the negative X direction |
| GL_TEXTURE_CUBE_MAP_POSITIVE_X | Face of a cube-map texture in the positive X direction |
| GL_TEXTURE_CUBE_MAP_NEGATIVE_Y | Face of a cube-map texture in the negative Y direction |
| GL_TEXTURE_CUBE_MAP_POSITIVE_Y | Face of a cube-map texture in the positive Y direction |
| GL_TEXTURE_CUBE_MAP_NEGATIVE_Z | Face of a cube-map texture in the negative Z direction |
| GL_TEXTURE_CUBE_MAP_POSITIVE_Z | Face of a cube-map texture in the positive Z direction |
To specify the region that is accessed by the GPU, set target to a bitwise OR of the aforementioned and the following values.
| NN_GX_MEM_FCRAM | The GPU accesses FCRAM. |
|---|---|
| NN_GX_MEM_VRAMA | The GPU accesses VRAMA. |
| NN_GX_MEM_VRAMB | The GPU accesses VRAMB. You can also specify whether copies of data are generated in FCRAM by including the following values in the bitwise OR. |
| GL_COPY_FCRAM_DMP | Copies of data are generated in FCRAM. |
| GL_NO_COPY_FCRAM_DMP | Copies of data are not generated in FCRAM. |
These combinations cause data to be transferred as follows.
| (NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP) | The GPU directly accesses the region specified by data. |
|---|---|
| (NN_GX_MEM_VRAMA | GL_NO_COPY_FCRAM_DMP) | A region is allocated in VRAMA; data is transferred to VRAMA via DMA; and then the GPU accesses VRAMA. |
| (NN_GX_MEM_VRAMB | GL_NO_COPY_FCRAM_DMP) | A region is allocated in VRAMB; data is transferred to VRAMB via DMA; and then the GPU accesses VRAMB. |
| (NN_GX_MEM_FCRAM | GL_COPY_FCRAM_DMP) | A region is allocated in FCRAM; data is copied to FCRAM via the CPU; and then the GPU accesses FCRAM. |
| (NN_GX_MEM_VRAMA | GL_COPY_FCRAM_DMP) | A region is allocated in VRAMA and FCRAM; data is copied to FCRAM via the CPU, then transferred from FCRAM to VRAMA via DMA; and then the GPU accesses VRAMA. |
| (NN_GX_MEM_VRAMB | GL_COPY_FCRAM_DMP) | A region is allocated in VRAMB and FCRAM; data is copied to FCRAM via the CPU, then transferred from FCRAM to VRAMB via DMA; and then the GPU accesses VRAMB. |
If you do not specify which region is accessed by the GPU or whether data is copied to FCRAM, (NN_GX_MEM_FCRAM | GL_COPY_FCRAM_DMP) is used. (These settings cannot be specified for POD.)
Set level to a negative value that is equal to the number of mipmaps to load for the texture data stored in data. (For example, specify a value of -2 to load two mipmap levels and a value of -3 to load three mipmap levels.)
If you set level to 0 or -1, it is recognized as indicating the minimum single-level mipmap.
You can only set internalformat to GL_ETC1_RGB8_NATIVE_DMP.
Set width and height to the texture size of the data to load. Specify the size of level 0 when you load multiple mipmap levels of data. With GL_ETC1_RGB8_NATIVE_DMP, the texture size must be a power of 2 between 16 and 1024, inclusive.
Specify 0 for border.
Set imageSize to the number of bytes of data specified by data.
Set data to a pointer to the texture data to load. When data is loaded for multiple mipmap levels, it is stored in ascending level order starting with level 0. You cannot separately load the individual mipmap levels of the data. When data is set to NULL, this function simply allocates a region as large as the data size.
This function generates the following errors.
| GL_INVALID_OPERATION | This function was called without any command-list objects bound when DMA transfers were in use. |
|---|---|
| GL_INVALID_VALUE | The width, height, internalformat, border, or level argument was set to an invalid value. |
| GL_INVALID_OPERATION | The imageSize argument was set to a value of 0 or less. |
| GL_INVALID_ENUM | The target argument was set to an invalid value. |
| GL_INVALID_OPERATION | The target argument was set to an invalid transfer method. |
CONFIDENTIAL