1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../css/manpage.css" type="text/css" />
7<title>glCompressedTexImage2D</title>
8  </head>
9  <body>
10<h1>glCompressedTexImage2D Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14GL_APICALL void GL_APIENTRY glCompressedTexImage2D(
15     GLenum target,
16     GLint level,
17     GLenum internalformat,
18     GLsizei width,
19     GLsizei height,
20     GLint border,
21     GLsizei imageSize,
22     const void * data
23);
24</pre>
25    </div>
26<h2>Arguments</h2>
27    <div class="section">
28      <table class="arguments">
29        <thead>
30          <tr>
31            <td width="15" />
32<th>Name</th>
33<td>Description</td>
34          </tr>
35        </thead>
36        <tr>
37<td>in</td>
38<th>target</th>
39<td>Target texture</td>
40        </tr>
41        <tr>
42<td>in</td>
43<th>level</th>
44<td>Mipmap level of the data to load</td>
45        </tr>
46        <tr>
47<td>in</td>
48<th>internalformat</th>
49<td>Texture format (only <code>GL_ETC1_RGB8_NATIVE_DMP</code> is valid)</td>
50        </tr>
51        <tr>
52<td>in</td>
53<th>width</th>
54<td>Texture width</td>
55        </tr>
56        <tr>
57<td>in</td>
58<th>height</th>
59<td>Texture height</td>
60        </tr>
61        <tr>
62<td>in</td>
63<th>border</th>
64<td>Border width (only 0 is valid)</td>
65        </tr>
66        <tr>
67<td>in</td>
68<th>imageSize</th>
69<td>Texture data size</td>
70        </tr>
71        <tr>
72<td>in</td>
73<th>data</th>
74<td>Pointer to the texture data</td>
75        </tr> </table>
76    </div>
77<h2>Return Values</h2>
78<div class="section">No values are returned. </div>
79<h2>Description</h2>
80    <div class="section">
81<p>Loads compressed-format texture data.</p><P>
82Set <span class="argument">target</span> to one the following values.
83<TABLE><TR><TH>GL_TEXTURE_2D</TH><TD> 2D texture</TD></TR><TR><TH>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</TH><TD> Face of a cube-map texture in the negative X direction</TD></TR><TR><TH>GL_TEXTURE_CUBE_MAP_POSITIVE_X</TH><TD> Face of a cube-map texture in the positive X direction</TD></TR><TR><TH>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</TH><TD> Face of a cube-map texture in the negative Y direction</TD></TR><TR><TH>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</TH><TD> Face of a cube-map texture in the positive Y direction</TD></TR><TR><TH>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</TH><TD> Face of a cube-map texture in the negative Z direction</TD></TR><TR><TH>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</TH><TD> Face of a cube-map texture in the positive Z direction </TD></TR></TABLE><!-- source                      targetにはGL_TEXTURE_2DまたはGL_TEXTURE_CUBE_MAP_NEGATIVE_X、GL_TEXTURE_CUBE_MAP_POSITIVE_X、 GL_TEXTURE_CUBE_MAP_NEGATIVE_Y、GL_TEXTURE_CUBE_MAP_POSITIVE_Y、GL_TEXTURE_CUBE_MAP_NEGATIVE_Z、GL_TEXTURE_CUBE_MAP_POSITIVE_Zが指定できます。                 --></P><P>
84To specify the region that is accessed by the GPU, set <span class="argument">target</span> to a bitwise OR of the aforementioned and the following values.
85<TABLE><TR><TH>NN_GX_MEM_FCRAM</TH><TD>The GPU accesses FCRAM.</TD></TR><TR><TH>NN_GX_MEM_VRAMA</TH><TD>The GPU accesses VRAMA.</TD></TR><TR><TH>NN_GX_MEM_VRAMB</TH><TD>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.</TD></TR><TR><TH>GL_COPY_FCRAM_DMP</TH><TD>Copies of data are generated in FCRAM.</TD></TR><TR><TH>GL_NO_COPY_FCRAM_DMP</TH><TD>Copies of data are not generated in FCRAM.</TD></TR></TABLE><!-- source                      NN_GX_MEM_FCRAM ・・・ FCRAMにGPUがアクセスします。 NN_GX_MEM_VRAMA ・・・ VRAMAにGPUがアクセスします。 NN_GX_MEM_VRAMB ・・・ VRAMBにGPUがアクセスします。 さらに次の値を論理和で指定することで、FCRAMにデータのコピーを生成するか否かを指定することができます。 GL_COPY_FCRAM_DMP ・・・ FCRAMにデータのコピーを生成します。 GL_NO_COPY_FCRAM_DMP ・・・ FCRAMにデータのコピーを生成しません。                 --></P><P>
86These combinations cause data to be transferred as follows.
87<TABLE><TR><TH>(NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP)</TH><TD>The GPU directly accesses the region specified by <span class="argument">data</span>.</TD></TR><TR><TH>(NN_GX_MEM_VRAMA | GL_NO_COPY_FCRAM_DMP)</TH><TD>A region is allocated in VRAMA; <span class="argument">data</span> is transferred to VRAMA via DMA; and then the GPU accesses VRAMA.</TD></TR><TR><TH>(NN_GX_MEM_VRAMB | GL_NO_COPY_FCRAM_DMP)</TH><TD>A region is allocated in VRAMB; <span class="argument">data</span> is transferred to VRAMB via DMA; and then the GPU accesses VRAMB.</TD></TR><TR><TH>(NN_GX_MEM_FCRAM | GL_COPY_FCRAM_DMP)</TH><TD>A region is allocated in FCRAM; <span class="argument">data</span> is copied to FCRAM via the CPU; and then the GPU accesses FCRAM.</TD></TR><TR><TH>(NN_GX_MEM_VRAMA | GL_COPY_FCRAM_DMP)</TH><TD>A region is allocated in VRAMA and FCRAM; <span class="argument">data</span> is copied to FCRAM via the CPU, then transferred from FCRAM to VRAMA via DMA; and then the GPU accesses VRAMA.</TD></TR><TR><TH>(NN_GX_MEM_VRAMB | GL_COPY_FCRAM_DMP)</TH><TD>A region is allocated in VRAMB and FCRAM; <span class="argument">data</span> is copied to FCRAM via the CPU, then transferred from FCRAM to VRAMB via DMA; and then the GPU accesses VRAMB.</TD></TR></TABLE><!-- source                       (NN_GX_MEM_FCRAM | GL_NO_COPY_FCRAM_DMP) ・・・ dataに指定した領域を直接GPUがアクセスする。 (NN_GX_MEM_VRAMA | GL_NO_COPY_FCRAM_DMP) ・・・ VRAMAに領域を確保し、DMAでdataからVRAMAへ転送し、VRAMAをGPUがアクセスする。 (NN_GX_MEM_VRAMB | GL_NO_COPY_FCRAM_DMP) ・・・ VRAMBに領域を確保し、DMAでdataからVRAMBへ転送し、VRAMBをGPUがアクセスする。 (NN_GX_MEM_FCRAM | GL_COPY_FCRAM_DMP) ・・・ FCRAMに領域を確保し、CPUでdataからFCRAMへコピーし、FCRAMをGPUがアクセスする。 (NN_GX_MEM_VRAMA | GL_COPY_FCRAM_DMP) ・・・ VRAMAおよびFCRAMに領域を確保し、CPUでdataからFCRAMへコピーし、DMAでFCRAMからVRAMAへ転送し、VRAMAをGPUがアクセスする。 (NN_GX_MEM_VRAMB | GL_COPY_FCRAM_DMP) ・・・ VRAMBおよびFCRAMに領域を確保し、CPUでdataからFCRAMへコピーし、DMAでFCRAMからVRAMBへ転送し、VRAMBをGPUがアクセスする。                 --></P><P>
88If you do not specify which region is accessed by the GPU or whether data is copied to FCRAM, <code>(NN_GX_MEM_FCRAM | GL_COPY_FCRAM_DMP)</code> is used. (These settings cannot be specified for POD.)
89            </P><P>
90Set <span class="argument">level</span> to a negative value that is equal to the number of mipmaps to load for the texture data stored in <span class="argument">data</span>. (For example, specify a value of -2 to load two mipmap levels and a value of -3 to load three mipmap levels.)
91            </P><P>
92If you set <span class="argument">level</span> to 0 or -1, it is recognized as indicating the minimum single-level mipmap.
93            </P><P>
94You can only set <span class="argument">internalformat</span> to <code>GL_ETC1_RGB8_NATIVE_DMP</code>.
95            </P><P>
96Set <span class="argument">width</span> and <span class="argument">height</span> to the texture size of the data to load. Specify the size of level 0 when you load multiple mipmap levels of data. With <code>GL_ETC1_RGB8_NATIVE_DMP</code>, the texture size must be a power of 2 between 16 and 1024, inclusive.
97            </P><P>
98Specify 0 for <span class="argument">border</span>.
99            </P><P>
100Set <span class="argument">imageSize</span> to the number of bytes of data specified by <span class="argument">data</span>.
101            </P><P>
102Set <span class="argument">data</span> 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 <span class="argument">data</span> is set to NULL, this function simply allocates a region as large as the data size.
103            </P><P>
104This function generates the following errors.
105<TABLE><TR><TH>GL_INVALID_OPERATION</TH><TD>This function was called without any command-list objects bound when DMA transfers were in use.</TD></TR><TR><TH>GL_INVALID_VALUE</TH><TD>The <span class="argument">width</span>, <span class="argument">height</span>, <span class="argument">internalformat</span>, <span class="argument">border</span>, or <span class="argument">level</span> argument was set to an invalid value.</TD></TR><TR><TH>GL_INVALID_OPERATION</TH><TD>The <span class="argument">imageSize</span> argument was set to a value of 0 or less.</TD></TR><TR><TH>GL_INVALID_ENUM</TH><TD>The <span class="argument">target</span> argument was set to an invalid value.</TD></TR><TR><TH>GL_INVALID_OPERATION</TH><TD>The <span class="argument">target</span> argument was set to an invalid transfer method.</TD></TR></TABLE><!-- source                                      DMA転送を使用する場合、コマンドリストオブジェクトをバインドしていない状態で呼び出すとエラーGL_INVALID_OPERATIONを生成します。 width、height、internalformat、border、levelに不正な値を指定した場合エラーGL_INVALID_VALUEを生成します。 imageSizeに0以下の値を指定した場合エラーGL_INVALID_OPERATIONを生成します。 targetに不正な値を指定した場合エラーGL_INVALID_ENUMを生成します。 また、targetに不正な転送処理方式を指定した場合エラーGL_INVALID_OPERATIONを生成します。                 --></P></div>
106<h2>Revision History</h2>
107    <div class="section">
108      <dl class="history">
109        <dt>2010/01/07</dt>
110<dd>Initial version.<br />
111        </dd>
112      </dl>
113    </div>
114  <hr><p>CONFIDENTIAL</p></body>
115</html>