Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd"> | |
4 | <refentry id="glGetShaderPrecisionFormat"> | |
5 | <refmeta> | |
6 | <refmetainfo> | |
7 | <copyright> | |
8 | <year>2010</year> | |
9 | <holder>Khronos Group</holder> | |
10 | </copyright> | |
11 | </refmetainfo> | |
12 | <refentrytitle>glGetShaderPrecisionFormat</refentrytitle> | |
13 | <manvolnum>3G</manvolnum> | |
14 | </refmeta> | |
15 | <refnamediv> | |
16 | <refname>glGetShaderPrecisionFormat</refname> | |
17 | <refpurpose>retrieve the range and precision for numeric formats supported by the shader compiler</refpurpose> | |
18 | </refnamediv> | |
19 | <refsynopsisdiv><title>C Specification</title> | |
20 | <funcsynopsis> | |
21 | <funcprototype> | |
22 | <funcdef>void <function>glGetShaderPrecisionFormat</function></funcdef> | |
23 | <paramdef>GLenum <parameter>shaderType</parameter></paramdef> | |
24 | <paramdef>GLenum <parameter>precisionType</parameter></paramdef> | |
25 | <paramdef>GLint *<parameter>range</parameter></paramdef> | |
26 | <paramdef>GLint *<parameter>precision</parameter></paramdef> | |
27 | </funcprototype> | |
28 | </funcsynopsis> | |
29 | </refsynopsisdiv> | |
30 | <refsect1 id="parameters"><title>Parameters</title> | |
31 | <variablelist> | |
32 | <varlistentry> | |
33 | <term><parameter>shaderType</parameter></term> | |
34 | <listitem> | |
35 | <para> | |
36 | Specifies the type of shader whose precision to query. <parameter>shaderType</parameter> | |
37 | must be <constant>GL_VERTEX_SHADER</constant> or <constant>GL_FRAGMENT_SHADER</constant>. | |
38 | </para> | |
39 | </listitem> | |
40 | </varlistentry> | |
41 | <varlistentry> | |
42 | <term><parameter>precisionType</parameter></term> | |
43 | <listitem> | |
44 | <para> | |
45 | Specifies the numeric format whose precision and range to query. | |
46 | </para> | |
47 | </listitem> | |
48 | </varlistentry> | |
49 | <varlistentry> | |
50 | <term><parameter>range</parameter></term> | |
51 | <listitem> | |
52 | <para> | |
53 | Specifies the address of array of two integers into which encodings of the implementation's | |
54 | numeric range are returned. | |
55 | </para> | |
56 | </listitem> | |
57 | </varlistentry> | |
58 | <varlistentry> | |
59 | <term><parameter>precision</parameter></term> | |
60 | <listitem> | |
61 | <para> | |
62 | Specifies the address of an integer into which the numeric precision of the implementation | |
63 | is written. | |
64 | </para> | |
65 | </listitem> | |
66 | </varlistentry> | |
67 | </variablelist> | |
68 | </refsect1> | |
69 | <refsect1 id="description"><title>Description</title> | |
70 | <para> | |
71 | <function>glGetShaderPrecisionFormat</function> retrieves the numeric range and precision for | |
72 | the implementation's representation of quantities in different numeric formats in specified | |
73 | shader type. <parameter>shaderType</parameter> specifies the type of shader for which the numeric | |
74 | precision and range is to be retrieved and must be one of <constant>GL_VERTEX_SHADER</constant> | |
75 | or <constant>GL_FRAGMENT_SHADER</constant>. <parameter>precisionType</parameter> specifies the | |
76 | numeric format to query and must be one of <constant>GL_LOW_FLOAT</constant>, <constant>GL_MEDIUM_FLOAT</constant> | |
77 | <constant>GL_HIGH_FLOAT</constant>, <constant>GL_LOW_INT</constant>, <constant>GL_MEDIUM_INT</constant>, | |
78 | or <constant>GL_HIGH_INT</constant>. | |
79 | </para> | |
80 | <para> | |
81 | <parameter>range</parameter> points to an array of two integers into which the format's numeric range | |
82 | will be returned. If min and max are the smallest values representable in the format, then the values | |
83 | returned are defined to be: <parameter>range</parameter>[0] = floor(log2(|min|)) and | |
84 | <parameter>range</parameter>[1] = floor(log2(|max|)). | |
85 | </para> | |
86 | <para> | |
87 | <parameter>precision</parameter> specifies the address of an integer into which will be written | |
88 | the log2 value of the number of bits of precision of the format. If the smallest representable | |
89 | value greater than 1 is 1 + <emphasis>eps</emphasis>, then the integer addressed by <parameter>precision</parameter> | |
90 | will contain floor(-log2(eps)). | |
91 | </para> | |
92 | </refsect1> | |
93 | <refsect1 id="errors"><title>Errors</title> | |
94 | <para> | |
95 | <constant>GL_INVALID_ENUM</constant> is generated if <parameter>shaderType</parameter> or | |
96 | <parameter>precisionType</parameter> is not an accepted value. | |
97 | </para> | |
98 | </refsect1> | |
99 | <refsect1 id="Copyright"><title>Copyright</title> | |
100 | <para> | |
101 | Copyright <trademark class="copyright"></trademark> 2010 Khronos Group. | |
102 | This material may be distributed subject to the terms and conditions set forth in | |
103 | the Open Publication License, v 1.0, 8 June 1999. | |
104 | <ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>. | |
105 | </para> | |
106 | </refsect1> | |
107 | </refentry> |