2 //Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
5 //Redistribution and use in source and binary forms, with or without
6 //modification, are permitted provided that the following conditions
9 // Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
12 // Redistributions in binary form must reproduce the above
13 // copyright notice, this list of conditions and the following
14 // disclaimer in the documentation and/or other materials provided
15 // with the distribution.
17 // Neither the name of 3Dlabs Inc. Ltd. nor the names of its
18 // contributors may be used to endorse or promote products derived
19 // from this software without specific prior written permission.
21 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 //"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 //LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 //FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 //COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 //INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 //BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 //CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 //LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 //POSSIBILITY OF SUCH DAMAGE.
35 #ifndef _BASICTYPES_INCLUDED_
36 #define _BASICTYPES_INCLUDED_
39 // Basic type. Arrays, vectors, etc., are orthogonal to this.
56 __inline
bool IsSampler(TBasicType type
)
58 return type
>= EbtSampler1D
&& type
<= EbtSampler2DShadow
;
62 // Qualifiers and built-ins. These are mainly used to see what can be read
63 // or written, and by the machine dependent translator to know which registers
64 // to allocate variables in. Since built-ins tend to go to different registers
65 // than varying or uniform, it makes sense they are peers, not sub-classes.
68 EvqTemporary
, // For temporaries (within a function), read/write
69 EvqGlobal
, // For globals read/write
70 EvqConst
, // User defined constants and non-output parameters in functions
71 EvqAttribute
, // Readonly
72 EvqVaryingIn
, // readonly, fragment shaders only
73 EvqVaryingOut
, // vertex shaders only read/write
74 EvqUniform
, // Readonly, vertex and fragment
76 // pack/unpack input and output
86 // built-ins written by vertex shader
91 // built-ins read by fragment shader
95 // built-ins written by fragment shader
104 // This is just for debug print out, carried along with the definitions above.
106 __inline
const char* getQualifierString(TQualifier q
)
109 case EvqTemporary
: return "Temporary"; break;
110 case EvqGlobal
: return "Global"; break;
111 case EvqConst
: return "const"; break;
112 case EvqConstReadOnly
: return "const"; break;
113 case EvqAttribute
: return "attribute"; break;
114 case EvqVaryingIn
: return "varying"; break;
115 case EvqVaryingOut
: return "varying"; break;
116 case EvqUniform
: return "uniform"; break;
117 case EvqIn
: return "in"; break;
118 case EvqOut
: return "out"; break;
119 case EvqInOut
: return "inout"; break;
120 case EvqInput
: return "input"; break;
121 case EvqOutput
: return "output"; break;
122 case EvqPosition
: return "Position"; break;
123 case EvqPointSize
: return "PointSize"; break;
124 case EvqClipVertex
: return "ClipVertex"; break;
125 case EvqFace
: return "Face"; break;
126 case EvqFragCoord
: return "FragCoord"; break;
127 case EvqFragColor
: return "FragColor"; break;
128 case EvqFragDepth
: return "FragDepth"; break;
129 default: return "unknown qualifier";
133 #endif // _BASICTYPES_INCLUDED_