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>glShaderBinary</title>
8  </head>
9  <body>
10<h1><CODE>glShaderBinary</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14GL_APICALL void GL_APIENTRY glShaderBinary(
15     GLint n,
16     const GLuint * shaders,
17     GLenum binaryformat,
18     const void * binary,
19     GLint length
20);
21</pre>
22    </div>
23<h2>Arguments</h2>
24    <div class="section">
25      <table class="arguments">
26        <thead>
27          <tr>
28            <td width="15" />
29<th>Name</th>
30<td>Description</td>
31          </tr>
32        </thead>
33        <tr>
34<td>in</td>
35<th>n</th>
36<td>Number of shader objects in the <SPAN class="argument">shaders</SPAN> array.</td>
37        </tr>
38        <tr>
39<td>in</td>
40<th>shaders</th>
41<td>Array storing the shader objects.</td>
42        </tr>
43        <tr>
44<td>in</td>
45<th>binaryformat</th>
46<td>Shader binary format.</td>
47        </tr>
48        <tr>
49<td>in</td>
50<th>binary</th>
51<td>Pointer to the shader binary data.</td>
52        </tr>
53        <tr>
54<td>in</td>
55<th>length</th>
56<td>Size (in bytes) of the shader binary data.</td>
57        </tr> </table>
58    </div>
59<h2>Return Values</h2>
60<div class="section">No values are returned. </div>
61<h2>Description</h2>
62    <div class="section">
63<p>Loads shader binaries.</p><P>
64Set <SPAN class="argument">shaders</SPAN> to an array storing <SPAN class="argument">n</SPAN> shader objects. Specify shader objects that have been generated by <CODE>glCreateShader</CODE>.
65
66            </P><P>
67Set <SPAN class="argument">binaryformat</SPAN> to <CODE>GL_PLATFORM_BINARY_DMP</CODE>. Set <SPAN class="argument">binary</SPAN> to a shader binary output by <CODE>ctr_VertexShaderLinker</CODE>.
68            </P><P>
69Set <SPAN class="argument">length</SPAN> to the size (in bytes) of <SPAN class="argument">binary</SPAN>.
70            </P><P>
71The shader binary specified by <SPAN class="argument">binary</SPAN> is loaded into the shader objects specified by <SPAN class="argument">shaders</SPAN>. Shader binaries are loaded into the shader objects in <SPAN class="argument">shaders</SPAN> in the order in which they were specified to <CODE>ctr_VertexShaderLinker</CODE> when the shader binaries were linked. (Shader assemblers with only subroutines that do not include the <CODE>main</CODE> label are excluded.)
72            </P><P>
73Vertex shaders must be loaded into shader objects created with the <CODE>GL_VERTEX_SHADER</CODE> type, and geometry shaders must be loaded into shader objects created with the <CODE>GL_GEOMETRY_SHADER_DMP</CODE> type.
74            </P><P>
75A geometry shader binary cannot be loaded by itself. Geometry shaders must be loaded together with vertex shaders as a binary linked by <CODE>ctr_VertexShaderLinker</CODE>.
76            </P><P>
77You can specify multiple vertex and geometry shader objects in <SPAN class="argument">shaders</SPAN> because <CODE>ctr_VertexShaderLinker</CODE> can link multiple vertex with multiple geometry shaders.
78            </P><P>
79The following errors occur in this function.
80<TABLE><TR><TH><CODE>GL_INVALID_VALUE</CODE></TH><TD><SPAN class="argument">n</SPAN> or <SPAN class="argument">length</SPAN> was set to a negative value; the data in <SPAN class="argument">binary</SPAN> uses a different format than <SPAN class="argument">binaryformat</SPAN>; or <SPAN class="argument">shaders</SPAN> was set to an invalid value.</TD></TR><TR><TH><CODE>GL_INVALID_ENUM</CODE></TH><TD>The <SPAN class="argument">binaryformat</SPAN> argument was set to an invalid value.</TD></TR><TR><TH><CODE>GL_INVALID_OPERATION</CODE></TH><TD>The value specified for the <SPAN class="argument">length</SPAN> argument is smaller than the shader binary file, or the <SPAN class="argument">binary</SPAN> argument was set to a shader binary assembled with an incompatible version of <CODE>ctr_VertexShaderAssembler</CODE>.</TD></TR><TR><TH><CODE>GL_OUT_OF_MEMORY</CODE></TH><TD>Failed to allocate the management region.</TD></TR><TR><TH><CODE>GL_INVALID_OPERATION</CODE></TH><TD>The type of shader object specified with <SPAN class="argument">shaders</SPAN> differs from the type of shader assembler in the shader binary.</TD></TR></TABLE><!-- source                      n、lengthに負の値を指定した場合、binaryのデータがbinaryformatと異なるフォーマットの場合、 および不正な値をshadersに指定した場合エラーGL_INVALID_VALUEを生成します。 binaryformatに不正な値を指定した場合エラーGL_INVALID_ENUMを生成します。 lengthがシェーダバイナリファイルのサイズに満たない場合、および 互換性のないバージョンのctr_VertexShaderAssemblerでアセンブルされたシェーダバイナリをbinaryに指定した場合エラーGL_INVALID_OPERATIONを生成します。 管理用領域の確保に失敗した場合エラーGL_OUT_OF_MEMORYを生成します。 shadersに指定したシェーダオブジェクトのタイプとシェーダバイナリのシェーダアセンブラのタイプが異なる場合エラーGL_INVALID_OPERATIONを生成します。                 --></P></div>
81<h2>Revision History</h2>
82    <div class="section">
83      <dl class="history">
84        <dt>2010/01/07</dt>
85<dd>Initial version.<br />
86        </dd>
87      </dl>
88    </div>
89  <hr><p>CONFIDENTIAL</p></body>
90</html>