/src/shaderc/third_party/glslang/glslang/MachineIndependent/Initialize.cpp
Line | Count | Source |
1 | | // |
2 | | // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. |
3 | | // Copyright (C) 2012-2016 LunarG, Inc. |
4 | | // Copyright (C) 2015-2020 Google, Inc. |
5 | | // Copyright (C) 2017, 2022-2024 Arm Limited. |
6 | | // Modifications Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All rights reserved. |
7 | | // |
8 | | // All rights reserved. |
9 | | // |
10 | | // Redistribution and use in source and binary forms, with or without |
11 | | // modification, are permitted provided that the following conditions |
12 | | // are met: |
13 | | // |
14 | | // Redistributions of source code must retain the above copyright |
15 | | // notice, this list of conditions and the following disclaimer. |
16 | | // |
17 | | // Redistributions in binary form must reproduce the above |
18 | | // copyright notice, this list of conditions and the following |
19 | | // disclaimer in the documentation and/or other materials provided |
20 | | // with the distribution. |
21 | | // |
22 | | // Neither the name of 3Dlabs Inc. Ltd. nor the names of its |
23 | | // contributors may be used to endorse or promote products derived |
24 | | // from this software without specific prior written permission. |
25 | | // |
26 | | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
27 | | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
28 | | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
29 | | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
30 | | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
31 | | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
32 | | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
33 | | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
34 | | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
35 | | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
36 | | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
37 | | // POSSIBILITY OF SUCH DAMAGE. |
38 | | // |
39 | | |
40 | | // |
41 | | // Create strings that declare built-in definitions, add built-ins programmatically |
42 | | // that cannot be expressed in the strings, and establish mappings between |
43 | | // built-in functions and operators. |
44 | | // |
45 | | // Where to put a built-in: |
46 | | // TBuiltIns::initialize(version,profile) context-independent textual built-ins; add them to the right string |
47 | | // TBuiltIns::initialize(resources,...) context-dependent textual built-ins; add them to the right string |
48 | | // TBuiltIns::identifyBuiltIns(...,symbolTable) context-independent programmatic additions/mappings to the symbol table, |
49 | | // including identifying what extensions are needed if a version does not allow a symbol |
50 | | // TBuiltIns::identifyBuiltIns(...,symbolTable, resources) context-dependent programmatic additions/mappings to the symbol table, |
51 | | // including identifying what extensions are needed if a version does not allow a symbol |
52 | | // |
53 | | |
54 | | #include <array> |
55 | | #include <sstream> |
56 | | #include "Initialize.h" |
57 | | #include "span.h" |
58 | | |
59 | | namespace glslang { |
60 | | |
61 | | // TODO: ARB_Compatability: do full extension support |
62 | | const bool ARBCompatibility = true; |
63 | | |
64 | | const bool ForwardCompatibility = false; |
65 | | |
66 | | namespace { |
67 | | |
68 | | // |
69 | | // A set of definitions for tabling of the built-in functions. |
70 | | // |
71 | | |
72 | | // Order matters here, as does correlation with the subsequent |
73 | | // "const int ..." declarations and the ArgType enumerants. |
74 | | const char* TypeString[] = { |
75 | | "bool", "bvec2", "bvec3", "bvec4", |
76 | | "float", "vec2", "vec3", "vec4", |
77 | | "int", "ivec2", "ivec3", "ivec4", |
78 | | "uint", "uvec2", "uvec3", "uvec4", |
79 | | }; |
80 | | const int TypeStringCount = sizeof(TypeString) / sizeof(char*); // number of entries in 'TypeString' |
81 | | const int TypeStringRowShift = 2; // shift amount to go downe one row in 'TypeString' |
82 | | const int TypeStringColumnMask = (1 << TypeStringRowShift) - 1; // reduce type to its column number in 'TypeString' |
83 | | const int TypeStringScalarMask = ~TypeStringColumnMask; // take type to its scalar column in 'TypeString' |
84 | | |
85 | | enum ArgType { |
86 | | // numbers hardcoded to correspond to 'TypeString'; order and value matter |
87 | | TypeB = 1 << 0, // Boolean |
88 | | TypeF = 1 << 1, // float 32 |
89 | | TypeI = 1 << 2, // int 32 |
90 | | TypeU = 1 << 3, // uint 32 |
91 | | TypeF16 = 1 << 4, // float 16 |
92 | | TypeF64 = 1 << 5, // float 64 |
93 | | TypeI8 = 1 << 6, // int 8 |
94 | | TypeI16 = 1 << 7, // int 16 |
95 | | TypeI64 = 1 << 8, // int 64 |
96 | | TypeU8 = 1 << 9, // uint 8 |
97 | | TypeU16 = 1 << 10, // uint 16 |
98 | | TypeU64 = 1 << 11, // uint 64 |
99 | | }; |
100 | | // Mixtures of the above, to help the function tables |
101 | | const ArgType TypeFI = static_cast<ArgType>(TypeF | TypeI); |
102 | | const ArgType TypeFIB = static_cast<ArgType>(TypeF | TypeI | TypeB); |
103 | | const ArgType TypeIU = static_cast<ArgType>(TypeI | TypeU); |
104 | | |
105 | | // The relationships between arguments and return type, whether anything is |
106 | | // output, or other unusual situations. |
107 | | enum ArgClass { |
108 | | ClassRegular = 0, // nothing special, just all vector widths with matching return type; traditional arithmetic |
109 | | ClassLS = 1 << 0, // the last argument is also held fixed as a (type-matched) scalar while the others cycle |
110 | | ClassXLS = 1 << 1, // the last argument is exclusively a (type-matched) scalar while the others cycle |
111 | | ClassLS2 = 1 << 2, // the last two arguments are held fixed as a (type-matched) scalar while the others cycle |
112 | | ClassFS = 1 << 3, // the first argument is held fixed as a (type-matched) scalar while the others cycle |
113 | | ClassFS2 = 1 << 4, // the first two arguments are held fixed as a (type-matched) scalar while the others cycle |
114 | | ClassLO = 1 << 5, // the last argument is an output |
115 | | ClassB = 1 << 6, // return type cycles through only bool/bvec, matching vector width of args |
116 | | ClassLB = 1 << 7, // last argument cycles through only bool/bvec, matching vector width of args |
117 | | ClassV1 = 1 << 8, // scalar only |
118 | | ClassFIO = 1 << 9, // first argument is inout |
119 | | ClassRS = 1 << 10, // the return is held scalar as the arguments cycle |
120 | | ClassNS = 1 << 11, // no scalar prototype |
121 | | ClassCVN = 1 << 12, // first argument is 'coherent volatile nontemporal' |
122 | | ClassFO = 1 << 13, // first argument is output |
123 | | ClassV3 = 1 << 14, // vec3 only |
124 | | }; |
125 | | // Mixtures of the above, to help the function tables |
126 | | const ArgClass ClassV1FIOCVN = (ArgClass)(ClassV1 | ClassFIO | ClassCVN); |
127 | | const ArgClass ClassBNS = (ArgClass)(ClassB | ClassNS); |
128 | | const ArgClass ClassRSNS = (ArgClass)(ClassRS | ClassNS); |
129 | | |
130 | | // A descriptor, for a single profile, of when something is available. |
131 | | // If the current profile does not match 'profile' mask below, the other fields |
132 | | // do not apply (nor validate). |
133 | | // profiles == EBadProfile is the end of an array of these |
134 | | struct Versioning { |
135 | | EProfile profiles; // the profile(s) (mask) that the following fields are valid for |
136 | | int minExtendedVersion; // earliest version when extensions are enabled; ignored if numExtensions is 0 |
137 | | int minCoreVersion; // earliest version function is in core; 0 means never |
138 | | int numExtensions; // how many extensions are in the 'extensions' list |
139 | | const char** extensions; // list of extension names enabling the function |
140 | | }; |
141 | | |
142 | | EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECompatibilityProfile); |
143 | | |
144 | | // Declare pointers to put into the table for versioning. |
145 | | const std::array Es300Desktop130Version = { Versioning{ EEsProfile, 0, 300, 0, nullptr }, |
146 | | Versioning{ EDesktopProfile, 0, 130, 0, nullptr }, |
147 | | }; |
148 | | |
149 | | const std::array Es310Desktop400Version = { Versioning{ EEsProfile, 0, 310, 0, nullptr }, |
150 | | Versioning{ EDesktopProfile, 0, 400, 0, nullptr }, |
151 | | }; |
152 | | |
153 | | const std::array Es310Desktop450Version = { Versioning{ EEsProfile, 0, 310, 0, nullptr }, |
154 | | Versioning{ EDesktopProfile, 0, 450, 0, nullptr }, |
155 | | }; |
156 | | |
157 | | // The main descriptor of what a set of function prototypes can look like, and |
158 | | // a pointer to extra versioning information, when needed. |
159 | | struct BuiltInFunction { |
160 | | TOperator op; // operator to map the name to |
161 | | const char* name; // function name |
162 | | int numArguments; // number of arguments (overloads with varying arguments need different entries) |
163 | | ArgType types; // ArgType mask |
164 | | ArgClass classes; // the ways this particular function entry manifests |
165 | | const span<const Versioning> versioning; // An empty span means always a valid version |
166 | | }; |
167 | | |
168 | | // The tables can have the same built-in function name more than one time, |
169 | | // but the exact same prototype must be indicated at most once. |
170 | | // The prototypes that get declared are the union of all those indicated. |
171 | | // This is important when different releases add new prototypes for the same name. |
172 | | // It also also congnitively simpler tiling of the prototype space. |
173 | | // In practice, most names can be fully represented with one entry. |
174 | | // |
175 | | // Table is terminated by an OpNull TOperator. |
176 | | |
177 | | const std::array BaseFunctions = { |
178 | | // TOperator, name, arg-count, ArgType, ArgClass, versioning |
179 | | // --------- ---- --------- ------- -------- ---------- |
180 | | BuiltInFunction{ EOpRadians, "radians", 1, TypeF, ClassRegular, {} }, |
181 | | BuiltInFunction{ EOpDegrees, "degrees", 1, TypeF, ClassRegular, {} }, |
182 | | BuiltInFunction{ EOpSin, "sin", 1, TypeF, ClassRegular, {} }, |
183 | | BuiltInFunction{ EOpCos, "cos", 1, TypeF, ClassRegular, {} }, |
184 | | BuiltInFunction{ EOpTan, "tan", 1, TypeF, ClassRegular, {} }, |
185 | | BuiltInFunction{ EOpAsin, "asin", 1, TypeF, ClassRegular, {} }, |
186 | | BuiltInFunction{ EOpAcos, "acos", 1, TypeF, ClassRegular, {} }, |
187 | | BuiltInFunction{ EOpAtan, "atan", 2, TypeF, ClassRegular, {} }, |
188 | | BuiltInFunction{ EOpAtan, "atan", 1, TypeF, ClassRegular, {} }, |
189 | | BuiltInFunction{ EOpPow, "pow", 2, TypeF, ClassRegular, {} }, |
190 | | BuiltInFunction{ EOpExp, "exp", 1, TypeF, ClassRegular, {} }, |
191 | | BuiltInFunction{ EOpLog, "log", 1, TypeF, ClassRegular, {} }, |
192 | | BuiltInFunction{ EOpExp2, "exp2", 1, TypeF, ClassRegular, {} }, |
193 | | BuiltInFunction{ EOpLog2, "log2", 1, TypeF, ClassRegular, {} }, |
194 | | BuiltInFunction{ EOpSqrt, "sqrt", 1, TypeF, ClassRegular, {} }, |
195 | | BuiltInFunction{ EOpInverseSqrt, "inversesqrt", 1, TypeF, ClassRegular, {} }, |
196 | | BuiltInFunction{ EOpAbs, "abs", 1, TypeF, ClassRegular, {} }, |
197 | | BuiltInFunction{ EOpSign, "sign", 1, TypeF, ClassRegular, {} }, |
198 | | BuiltInFunction{ EOpFloor, "floor", 1, TypeF, ClassRegular, {} }, |
199 | | BuiltInFunction{ EOpCeil, "ceil", 1, TypeF, ClassRegular, {} }, |
200 | | BuiltInFunction{ EOpFract, "fract", 1, TypeF, ClassRegular, {} }, |
201 | | BuiltInFunction{ EOpMod, "mod", 2, TypeF, ClassLS, {} }, |
202 | | BuiltInFunction{ EOpMin, "min", 2, TypeF, ClassLS, {} }, |
203 | | BuiltInFunction{ EOpMax, "max", 2, TypeF, ClassLS, {} }, |
204 | | BuiltInFunction{ EOpClamp, "clamp", 3, TypeF, ClassLS2, {} }, |
205 | | BuiltInFunction{ EOpMix, "mix", 3, TypeF, ClassLS, {} }, |
206 | | BuiltInFunction{ EOpStep, "step", 2, TypeF, ClassFS, {} }, |
207 | | BuiltInFunction{ EOpSmoothStep, "smoothstep", 3, TypeF, ClassFS2, {} }, |
208 | | BuiltInFunction{ EOpNormalize, "normalize", 1, TypeF, ClassRegular, {} }, |
209 | | BuiltInFunction{ EOpFaceForward, "faceforward", 3, TypeF, ClassRegular, {} }, |
210 | | BuiltInFunction{ EOpReflect, "reflect", 2, TypeF, ClassRegular, {} }, |
211 | | BuiltInFunction{ EOpRefract, "refract", 3, TypeF, ClassXLS, {} }, |
212 | | BuiltInFunction{ EOpLength, "length", 1, TypeF, ClassRS, {} }, |
213 | | BuiltInFunction{ EOpDistance, "distance", 2, TypeF, ClassRS, {} }, |
214 | | BuiltInFunction{ EOpDot, "dot", 2, TypeF, ClassRS, {} }, |
215 | | BuiltInFunction{ EOpCross, "cross", 2, TypeF, ClassV3, {} }, |
216 | | BuiltInFunction{ EOpLessThan, "lessThan", 2, TypeFI, ClassBNS, {} }, |
217 | | BuiltInFunction{ EOpLessThanEqual, "lessThanEqual", 2, TypeFI, ClassBNS, {} }, |
218 | | BuiltInFunction{ EOpGreaterThan, "greaterThan", 2, TypeFI, ClassBNS, {} }, |
219 | | BuiltInFunction{ EOpGreaterThanEqual, "greaterThanEqual", 2, TypeFI, ClassBNS, {} }, |
220 | | BuiltInFunction{ EOpVectorEqual, "equal", 2, TypeFIB, ClassBNS, {} }, |
221 | | BuiltInFunction{ EOpVectorNotEqual, "notEqual", 2, TypeFIB, ClassBNS, {} }, |
222 | | BuiltInFunction{ EOpAny, "any", 1, TypeB, ClassRSNS, {} }, |
223 | | BuiltInFunction{ EOpAll, "all", 1, TypeB, ClassRSNS, {} }, |
224 | | BuiltInFunction{ EOpVectorLogicalNot, "not", 1, TypeB, ClassNS, {} }, |
225 | | BuiltInFunction{ EOpSinh, "sinh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, |
226 | | BuiltInFunction{ EOpCosh, "cosh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, |
227 | | BuiltInFunction{ EOpTanh, "tanh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, |
228 | | BuiltInFunction{ EOpAsinh, "asinh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, |
229 | | BuiltInFunction{ EOpAcosh, "acosh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, |
230 | | BuiltInFunction{ EOpAtanh, "atanh", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, |
231 | | BuiltInFunction{ EOpAbs, "abs", 1, TypeI, ClassRegular, {Es300Desktop130Version} }, |
232 | | BuiltInFunction{ EOpSign, "sign", 1, TypeI, ClassRegular, {Es300Desktop130Version} }, |
233 | | BuiltInFunction{ EOpTrunc, "trunc", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, |
234 | | BuiltInFunction{ EOpRound, "round", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, |
235 | | BuiltInFunction{ EOpRoundEven, "roundEven", 1, TypeF, ClassRegular, {Es300Desktop130Version} }, |
236 | | BuiltInFunction{ EOpModf, "modf", 2, TypeF, ClassLO, {Es300Desktop130Version} }, |
237 | | BuiltInFunction{ EOpMin, "min", 2, TypeIU, ClassLS, {Es300Desktop130Version} }, |
238 | | BuiltInFunction{ EOpMax, "max", 2, TypeIU, ClassLS, {Es300Desktop130Version} }, |
239 | | BuiltInFunction{ EOpClamp, "clamp", 3, TypeIU, ClassLS2, {Es300Desktop130Version} }, |
240 | | BuiltInFunction{ EOpMix, "mix", 3, TypeF, ClassLB, {Es300Desktop130Version} }, |
241 | | BuiltInFunction{ EOpIsInf, "isinf", 1, TypeF, ClassB, {Es300Desktop130Version} }, |
242 | | BuiltInFunction{ EOpIsNan, "isnan", 1, TypeF, ClassB, {Es300Desktop130Version} }, |
243 | | BuiltInFunction{ EOpLessThan, "lessThan", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, |
244 | | BuiltInFunction{ EOpLessThanEqual, "lessThanEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, |
245 | | BuiltInFunction{ EOpGreaterThan, "greaterThan", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, |
246 | | BuiltInFunction{ EOpGreaterThanEqual, "greaterThanEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, |
247 | | BuiltInFunction{ EOpVectorEqual, "equal", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, |
248 | | BuiltInFunction{ EOpVectorNotEqual, "notEqual", 2, TypeU, ClassBNS, {Es300Desktop130Version} }, |
249 | | BuiltInFunction{ EOpAtomicAdd, "atomicAdd", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, |
250 | | BuiltInFunction{ EOpAtomicMin, "atomicMin", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, |
251 | | BuiltInFunction{ EOpAtomicMax, "atomicMax", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, |
252 | | BuiltInFunction{ EOpAtomicAnd, "atomicAnd", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, |
253 | | BuiltInFunction{ EOpAtomicOr, "atomicOr", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, |
254 | | BuiltInFunction{ EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, |
255 | | BuiltInFunction{ EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, |
256 | | BuiltInFunction{ EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCVN, {Es310Desktop400Version} }, |
257 | | BuiltInFunction{ EOpMix, "mix", 3, TypeB, ClassRegular, {Es310Desktop450Version} }, |
258 | | BuiltInFunction{ EOpMix, "mix", 3, TypeIU, ClassLB, {Es310Desktop450Version} }, |
259 | | }; |
260 | | |
261 | | const std::array DerivativeFunctions = { |
262 | | BuiltInFunction{ EOpDPdx, "dFdx", 1, TypeF, ClassRegular, {} }, |
263 | | BuiltInFunction{ EOpDPdy, "dFdy", 1, TypeF, ClassRegular, {} }, |
264 | | BuiltInFunction{ EOpFwidth, "fwidth", 1, TypeF, ClassRegular, {} }, |
265 | | }; |
266 | | |
267 | | // For functions declared some other way, but still use the table to relate to operator. |
268 | | struct CustomFunction { |
269 | | TOperator op; // operator to map the name to |
270 | | const char* name; // function name |
271 | | const span<const Versioning> versioning; // An empty span means always a valid version |
272 | | }; |
273 | | |
274 | | const CustomFunction CustomFunctions[] = { |
275 | | { EOpBarrier, "barrier", {} }, |
276 | | { EOpMemoryBarrierShared, "memoryBarrierShared", {} }, |
277 | | { EOpGroupMemoryBarrier, "groupMemoryBarrier", {} }, |
278 | | { EOpMemoryBarrier, "memoryBarrier", {} }, |
279 | | { EOpMemoryBarrierBuffer, "memoryBarrierBuffer", {} }, |
280 | | |
281 | | { EOpPackSnorm2x16, "packSnorm2x16", {} }, |
282 | | { EOpUnpackSnorm2x16, "unpackSnorm2x16", {} }, |
283 | | { EOpPackUnorm2x16, "packUnorm2x16", {} }, |
284 | | { EOpUnpackUnorm2x16, "unpackUnorm2x16", {} }, |
285 | | { EOpPackHalf2x16, "packHalf2x16", {} }, |
286 | | { EOpUnpackHalf2x16, "unpackHalf2x16", {} }, |
287 | | |
288 | | { EOpMul, "matrixCompMult", {} }, |
289 | | { EOpOuterProduct, "outerProduct", {} }, |
290 | | { EOpTranspose, "transpose", {} }, |
291 | | { EOpDeterminant, "determinant", {} }, |
292 | | { EOpMatrixInverse, "inverse", {} }, |
293 | | { EOpFloatBitsToInt, "floatBitsToInt", {} }, |
294 | | { EOpFloatBitsToUint, "floatBitsToUint", {} }, |
295 | | { EOpIntBitsToFloat, "intBitsToFloat", {} }, |
296 | | { EOpUintBitsToFloat, "uintBitsToFloat", {} }, |
297 | | |
298 | | { EOpTextureQuerySize, "textureSize", {} }, |
299 | | { EOpTextureQueryLod, "textureQueryLod", {} }, |
300 | | { EOpTextureQueryLod, "textureQueryLOD", {} }, // extension GL_ARB_texture_query_lod |
301 | | { EOpTextureQueryLevels, "textureQueryLevels", {} }, |
302 | | { EOpTextureQuerySamples, "textureSamples", {} }, |
303 | | { EOpTexture, "texture", {} }, |
304 | | { EOpTextureProj, "textureProj", {} }, |
305 | | { EOpTextureLod, "textureLod", {} }, |
306 | | { EOpTextureOffset, "textureOffset", {} }, |
307 | | { EOpTextureFetch, "texelFetch", {} }, |
308 | | { EOpTextureFetchOffset, "texelFetchOffset", {} }, |
309 | | { EOpTextureProjOffset, "textureProjOffset", {} }, |
310 | | { EOpTextureLodOffset, "textureLodOffset", {} }, |
311 | | { EOpTextureProjLod, "textureProjLod", {} }, |
312 | | { EOpTextureProjLodOffset, "textureProjLodOffset", {} }, |
313 | | { EOpTextureGrad, "textureGrad", {} }, |
314 | | { EOpTextureGradOffset, "textureGradOffset", {} }, |
315 | | { EOpTextureProjGrad, "textureProjGrad", {} }, |
316 | | { EOpTextureProjGradOffset, "textureProjGradOffset", {} }, |
317 | | }; |
318 | | |
319 | | // For the given table of functions, add all the indicated prototypes for each |
320 | | // one, to be returned in the passed in decls. |
321 | | void AddTabledBuiltin(TString& decls, const BuiltInFunction& function) |
322 | 331k | { |
323 | 507k | const auto isScalarType = [](int type) { return (type & TypeStringColumnMask) == 0; }; |
324 | | |
325 | | // loop across these two: |
326 | | // 0: the varying arg set, and |
327 | | // 1: the fixed scalar args |
328 | 331k | const ArgClass ClassFixed = (ArgClass)(ClassLS | ClassXLS | ClassLS2 | ClassFS | ClassFS2); |
329 | 710k | for (int fixed = 0; fixed < ((function.classes & ClassFixed) > 0 ? 2 : 1); ++fixed) { |
330 | | |
331 | 378k | if (fixed == 0 && (function.classes & ClassXLS)) |
332 | 4.34k | continue; |
333 | | |
334 | | // walk the type strings in TypeString[] |
335 | 6.36M | for (int type = 0; type < TypeStringCount; ++type) { |
336 | | // skip types not selected: go from type to row number to type bit |
337 | 5.99M | if ((function.types & (1 << (type >> TypeStringRowShift))) == 0) |
338 | 4.19M | continue; |
339 | | |
340 | | // if we aren't on a scalar, and should be, skip |
341 | 1.80M | if ((function.classes & ClassV1) && !isScalarType(type)) |
342 | 81.2k | continue; |
343 | | |
344 | | // if we aren't on a 3-vector, and should be, skip |
345 | 1.71M | if ((function.classes & ClassV3) && (type & TypeStringColumnMask) != 2) |
346 | 13.0k | continue; |
347 | | |
348 | | // skip replication of all arg scalars between the varying arg set and the fixed args |
349 | 1.70M | if (fixed == 1 && type == (type & TypeStringScalarMask) && (function.classes & ClassXLS) == 0) |
350 | 56.4k | continue; |
351 | | |
352 | | // skip scalars when we are told to |
353 | 1.64M | if ((function.classes & ClassNS) && isScalarType(type)) |
354 | 99.8k | continue; |
355 | | |
356 | | // return type |
357 | 1.54M | if (function.classes & ClassB) |
358 | 295k | decls.append(TypeString[type & TypeStringColumnMask]); |
359 | 1.25M | else if (function.classes & ClassRS) |
360 | 78.1k | decls.append(TypeString[type & TypeStringScalarMask]); |
361 | 1.17M | else |
362 | 1.17M | decls.append(TypeString[type]); |
363 | 1.54M | decls.append(" "); |
364 | 1.54M | decls.append(function.name); |
365 | 1.54M | decls.append("("); |
366 | | |
367 | | // arguments |
368 | 4.17M | for (int arg = 0; arg < function.numArguments; ++arg) { |
369 | 2.62M | if (arg == function.numArguments - 1 && (function.classes & ClassLO)) |
370 | 17.3k | decls.append("out "); |
371 | 2.62M | if (arg == 0) { |
372 | 1.54M | if (function.classes & ClassCVN) |
373 | 27.0k | decls.append("coherent volatile nontemporal "); |
374 | 1.54M | if (function.classes & ClassFIO) |
375 | 27.0k | decls.append("inout "); |
376 | 1.54M | if (function.classes & ClassFO) |
377 | 0 | decls.append("out "); |
378 | 1.54M | } |
379 | 2.62M | if ((function.classes & ClassLB) && arg == function.numArguments - 1) |
380 | 26.5k | decls.append(TypeString[type & TypeStringColumnMask]); |
381 | 2.60M | else if (fixed && ((arg == function.numArguments - 1 && (function.classes & (ClassLS | ClassXLS | |
382 | 186k | ClassLS2))) || |
383 | 295k | (arg == function.numArguments - 2 && (function.classes & ClassLS2)) || |
384 | 256k | (arg == 0 && (function.classes & (ClassFS | ClassFS2))) || |
385 | 230k | (arg == 1 && (function.classes & ClassFS2)))) |
386 | 238k | decls.append(TypeString[type & TypeStringScalarMask]); |
387 | 2.36M | else |
388 | 2.36M | decls.append(TypeString[type]); |
389 | 2.62M | if (arg < function.numArguments - 1) |
390 | 1.07M | decls.append(","); |
391 | 2.62M | } |
392 | 1.54M | decls.append(");\n"); |
393 | 1.54M | } |
394 | 374k | } |
395 | 331k | } |
396 | | |
397 | | // Add long vector prototype for the builtin function. This is similar to |
398 | | // AddTabledBuiltin, but only generates builtins where one type is an |
399 | | // arbitrary vector. See comments on "enum ArgClass" for more details. |
400 | | void AddLongVectorBuiltin(TString& decls, const BuiltInFunction& function) |
401 | 309k | { |
402 | 5.60M | const auto isScalarType = [](int type) { return (type & TypeStringColumnMask) == 0; }; |
403 | | |
404 | | // loop across these two: |
405 | | // 0: the varying arg set, and |
406 | | // 1: the fixed scalar args |
407 | 309k | const ArgClass ClassFixed = (ArgClass)(ClassLS | ClassXLS | ClassLS2 | ClassFS | ClassFS2); |
408 | 664k | for (int fixed = 0; fixed < ((function.classes & ClassFixed) > 0 ? 2 : 1); ++fixed) { |
409 | | |
410 | 354k | if (fixed == 0 && (function.classes & ClassXLS)) |
411 | 4.08k | continue; |
412 | | |
413 | | // Iterate over the different scalar types (needed for ClassRS) |
414 | 5.96M | for (int type = 0; type < TypeStringCount; ++type) { |
415 | 5.60M | if (!isScalarType(type)) |
416 | 4.20M | continue; |
417 | | |
418 | | // skip types not selected: go from type to row number to type bit |
419 | 1.40M | if ((function.types & (1 << (type >> TypeStringRowShift))) == 0) |
420 | 982k | continue; |
421 | | |
422 | | // skip scalar-only |
423 | 420k | if (function.classes & ClassV1) |
424 | 22.9k | continue; |
425 | | |
426 | | // skip 3-vector |
427 | 397k | if (function.classes & ClassV3) |
428 | 4.08k | continue; |
429 | | |
430 | 393k | TString decl; |
431 | | // return type |
432 | 393k | if (function.classes & ClassB) |
433 | 89.8k | decl.append("vector"); |
434 | 303k | else if (function.classes & ClassRS) |
435 | 20.4k | decl.append(TypeString[type & TypeStringScalarMask]); |
436 | 282k | else |
437 | 282k | decl.append("vector"); |
438 | 393k | decl.append(" "); |
439 | 393k | decl.append(function.name); |
440 | 393k | decl.append("("); |
441 | | |
442 | | // arguments |
443 | 1.06M | for (int arg = 0; arg < function.numArguments; ++arg) { |
444 | 675k | if (arg == function.numArguments - 1 && (function.classes & ClassLO)) |
445 | 4.08k | decl.append("out "); |
446 | 675k | if (arg == 0) { |
447 | 393k | if (function.classes & ClassCVN) |
448 | 0 | decl.append("coherent volatile nontemporal "); |
449 | 393k | if (function.classes & ClassFIO) |
450 | 0 | decl.append("inout "); |
451 | 393k | if (function.classes & ClassFO) |
452 | 0 | decl.append("out "); |
453 | 393k | } |
454 | 675k | if ((function.classes & ClassLB) && arg == function.numArguments - 1) |
455 | 5.84k | decl.append("vector"); |
456 | 670k | else if (fixed && ((arg == function.numArguments - 1 && (function.classes & (ClassLS | ClassXLS | |
457 | 57.1k | ClassLS2))) || |
458 | 89.8k | (arg == function.numArguments - 2 && (function.classes & ClassLS2)) || |
459 | 77.5k | (arg == 0 && (function.classes & (ClassFS | ClassFS2))) || |
460 | 69.3k | (arg == 1 && (function.classes & ClassFS2)))) |
461 | 73.4k | decl.append(TypeString[type & TypeStringScalarMask]); |
462 | 596k | else |
463 | 596k | decl.append("vector"); |
464 | 675k | if (arg < function.numArguments - 1) |
465 | 282k | decl.append(","); |
466 | 675k | } |
467 | 393k | decl.append(");\n"); |
468 | | |
469 | 393k | decls.append(decl); |
470 | 393k | } |
471 | 350k | } |
472 | 309k | } |
473 | | |
474 | | // See if the tabled versioning information allows the current version. |
475 | | bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile, const SpvVersion& /* spVersion */) |
476 | 358k | { |
477 | | // nullptr means always valid |
478 | 358k | if (function.versioning.empty()) |
479 | 211k | return true; |
480 | | |
481 | | // check for what is said about our current profile |
482 | 286k | for (const auto& v : function.versioning) { |
483 | 286k | if ((v.profiles & profile) != 0) { |
484 | 147k | if (v.minCoreVersion <= version || (v.numExtensions > 0 && v.minExtendedVersion <= version)) |
485 | 120k | return true; |
486 | 147k | } |
487 | 286k | } |
488 | | |
489 | 27.5k | return false; |
490 | 147k | } |
491 | | |
492 | | // Relate a single table of built-ins to their AST operator. |
493 | | // This can get called redundantly (especially for the common built-ins, when |
494 | | // called once per stage). This is a performance issue only, not a correctness |
495 | | // concern. It is done for quality arising from simplicity, as there are subtleties |
496 | | // to get correct if instead trying to do it surgically. |
497 | | template<class FunctionContainer> |
498 | | void RelateTabledBuiltins(const FunctionContainer& functions, TSymbolTable& symbolTable) |
499 | 70.2k | { |
500 | 2.83M | for (const auto& fn : functions) { |
501 | 2.83M | symbolTable.relateToOperator(fn.name, fn.op); |
502 | 2.83M | } |
503 | 70.2k | } Initialize.cpp:void glslang::(anonymous namespace)::RelateTabledBuiltins<std::__1::array<glslang::(anonymous namespace)::BuiltInFunction, 79ul> >(std::__1::array<glslang::(anonymous namespace)::BuiltInFunction, 79ul> const&, glslang::TSymbolTable&) Line | Count | Source | 499 | 23.4k | { | 500 | 1.84M | for (const auto& fn : functions) { | 501 | 1.84M | symbolTable.relateToOperator(fn.name, fn.op); | 502 | 1.84M | } | 503 | 23.4k | } |
Initialize.cpp:void glslang::(anonymous namespace)::RelateTabledBuiltins<std::__1::array<glslang::(anonymous namespace)::BuiltInFunction, 3ul> >(std::__1::array<glslang::(anonymous namespace)::BuiltInFunction, 3ul> const&, glslang::TSymbolTable&) Line | Count | Source | 499 | 23.4k | { | 500 | 70.2k | for (const auto& fn : functions) { | 501 | 70.2k | symbolTable.relateToOperator(fn.name, fn.op); | 502 | 70.2k | } | 503 | 23.4k | } |
Initialize.cpp:void glslang::(anonymous namespace)::RelateTabledBuiltins<glslang::(anonymous namespace)::CustomFunction [39]>(glslang::(anonymous namespace)::CustomFunction const (&) [39], glslang::TSymbolTable&) Line | Count | Source | 499 | 23.4k | { | 500 | 913k | for (const auto& fn : functions) { | 501 | 913k | symbolTable.relateToOperator(fn.name, fn.op); | 502 | 913k | } | 503 | 23.4k | } |
|
504 | | |
505 | | } // end anonymous namespace |
506 | | |
507 | | // Add declarations for all tables of built-in functions. |
508 | | void TBuiltIns::addTabledBuiltins(int version, EProfile profile, const SpvVersion& spvVersion) |
509 | 4.34k | { |
510 | 9.60k | const auto forEachFunction = [&](TString& decls, const span<const BuiltInFunction>& functions) { |
511 | 358k | for (const auto& fn : functions) { |
512 | 358k | if (ValidVersion(fn, version, profile, spvVersion)) { |
513 | 331k | AddTabledBuiltin(decls, fn); |
514 | 331k | if (profile != EEsProfile) { |
515 | 309k | AddLongVectorBuiltin(decls, fn); |
516 | 309k | } |
517 | 331k | } |
518 | 358k | } |
519 | 9.60k | }; |
520 | | |
521 | 4.34k | forEachFunction(commonBuiltins, BaseFunctions); |
522 | 4.34k | forEachFunction(stageBuiltins[EShLangFragment], DerivativeFunctions); |
523 | | |
524 | 4.34k | if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450)) |
525 | 927 | forEachFunction(stageBuiltins[EShLangCompute], DerivativeFunctions); |
526 | 4.34k | } |
527 | | |
528 | | // Relate all tables of built-ins to the AST operators. |
529 | | void TBuiltIns::relateTabledBuiltins(int /* version */, EProfile /* profile */, const SpvVersion& /* spvVersion */, EShLanguage /* stage */, TSymbolTable& symbolTable) |
530 | 23.4k | { |
531 | 23.4k | RelateTabledBuiltins(BaseFunctions, symbolTable); |
532 | 23.4k | RelateTabledBuiltins(DerivativeFunctions, symbolTable); |
533 | 23.4k | RelateTabledBuiltins(CustomFunctions, symbolTable); |
534 | 23.4k | } |
535 | | |
536 | | inline bool IncludeLegacy(int version, EProfile profile, const SpvVersion& spvVersion) |
537 | 17.0k | { |
538 | 17.0k | return profile != EEsProfile && (version <= 130 || (spvVersion.spv == 0 && version == 140 && ARBCompatibility) || |
539 | 17.0k | profile == ECompatibilityProfile); |
540 | 17.0k | } |
541 | | |
542 | | // Construct TBuiltInParseables base class. This can be used for language-common constructs. |
543 | | TBuiltInParseables::TBuiltInParseables() |
544 | 14.9k | { |
545 | 14.9k | } |
546 | | |
547 | | // Destroy TBuiltInParseables. |
548 | | TBuiltInParseables::~TBuiltInParseables() |
549 | 14.9k | { |
550 | 14.9k | } |
551 | | |
552 | | TBuiltIns::TBuiltIns() |
553 | 14.8k | { |
554 | | // Set up textual representations for making all the permutations |
555 | | // of texturing/imaging functions. |
556 | 14.8k | prefixes[EbtFloat] = ""; |
557 | 14.8k | prefixes[EbtInt] = "i"; |
558 | 14.8k | prefixes[EbtUint] = "u"; |
559 | 14.8k | prefixes[EbtFloat16] = "f16"; |
560 | 14.8k | prefixes[EbtInt8] = "i8"; |
561 | 14.8k | prefixes[EbtUint8] = "u8"; |
562 | 14.8k | prefixes[EbtInt16] = "i16"; |
563 | 14.8k | prefixes[EbtUint16] = "u16"; |
564 | 14.8k | prefixes[EbtInt64] = "i64"; |
565 | 14.8k | prefixes[EbtUint64] = "u64"; |
566 | | |
567 | 14.8k | postfixes[2] = "2"; |
568 | 14.8k | postfixes[3] = "3"; |
569 | 14.8k | postfixes[4] = "4"; |
570 | | |
571 | | // Map from symbolic class of texturing dimension to numeric dimensions. |
572 | 14.8k | dimMap[Esd2D] = 2; |
573 | 14.8k | dimMap[Esd3D] = 3; |
574 | 14.8k | dimMap[EsdCube] = 3; |
575 | 14.8k | dimMap[Esd1D] = 1; |
576 | 14.8k | dimMap[EsdRect] = 2; |
577 | 14.8k | dimMap[EsdBuffer] = 1; |
578 | 14.8k | dimMap[EsdSubpass] = 2; // potentially unused for now |
579 | 14.8k | dimMap[EsdAttachmentEXT] = 2; // potentially unused for now |
580 | 14.8k | } |
581 | | |
582 | | TBuiltIns::~TBuiltIns() |
583 | | { |
584 | | } |
585 | | |
586 | | |
587 | | // |
588 | | // Add all context-independent built-in functions and variables that are present |
589 | | // for the given version and profile. Share common ones across stages, otherwise |
590 | | // make stage-specific entries. |
591 | | // |
592 | | // Most built-ins variables can be added as simple text strings. Some need to |
593 | | // be added programmatically, which is done later in IdentifyBuiltIns() below. |
594 | | // |
595 | | void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvVersion) |
596 | 4.34k | { |
597 | 4.34k | addTabledBuiltins(version, profile, spvVersion); |
598 | | |
599 | | //============================================================================ |
600 | | // |
601 | | // Prototypes for built-in functions used repeatly by different shaders |
602 | | // |
603 | | //============================================================================ |
604 | | |
605 | | // |
606 | | // Derivatives Functions. |
607 | | // |
608 | 4.34k | TString derivativeControls ( |
609 | 4.34k | "float dFdxFine(float p);" |
610 | 4.34k | "vec2 dFdxFine(vec2 p);" |
611 | 4.34k | "vec3 dFdxFine(vec3 p);" |
612 | 4.34k | "vec4 dFdxFine(vec4 p);" |
613 | | |
614 | 4.34k | "float dFdyFine(float p);" |
615 | 4.34k | "vec2 dFdyFine(vec2 p);" |
616 | 4.34k | "vec3 dFdyFine(vec3 p);" |
617 | 4.34k | "vec4 dFdyFine(vec4 p);" |
618 | | |
619 | 4.34k | "float fwidthFine(float p);" |
620 | 4.34k | "vec2 fwidthFine(vec2 p);" |
621 | 4.34k | "vec3 fwidthFine(vec3 p);" |
622 | 4.34k | "vec4 fwidthFine(vec4 p);" |
623 | | |
624 | 4.34k | "float dFdxCoarse(float p);" |
625 | 4.34k | "vec2 dFdxCoarse(vec2 p);" |
626 | 4.34k | "vec3 dFdxCoarse(vec3 p);" |
627 | 4.34k | "vec4 dFdxCoarse(vec4 p);" |
628 | | |
629 | 4.34k | "float dFdyCoarse(float p);" |
630 | 4.34k | "vec2 dFdyCoarse(vec2 p);" |
631 | 4.34k | "vec3 dFdyCoarse(vec3 p);" |
632 | 4.34k | "vec4 dFdyCoarse(vec4 p);" |
633 | | |
634 | 4.34k | "float fwidthCoarse(float p);" |
635 | 4.34k | "vec2 fwidthCoarse(vec2 p);" |
636 | 4.34k | "vec3 fwidthCoarse(vec3 p);" |
637 | 4.34k | "vec4 fwidthCoarse(vec4 p);" |
638 | 4.34k | ); |
639 | | |
640 | 4.34k | TString derivativesAndControl16bits ( |
641 | 4.34k | "float16_t dFdx(float16_t);" |
642 | 4.34k | "f16vec2 dFdx(f16vec2);" |
643 | 4.34k | "f16vec3 dFdx(f16vec3);" |
644 | 4.34k | "f16vec4 dFdx(f16vec4);" |
645 | | |
646 | 4.34k | "float16_t dFdy(float16_t);" |
647 | 4.34k | "f16vec2 dFdy(f16vec2);" |
648 | 4.34k | "f16vec3 dFdy(f16vec3);" |
649 | 4.34k | "f16vec4 dFdy(f16vec4);" |
650 | | |
651 | 4.34k | "float16_t dFdxFine(float16_t);" |
652 | 4.34k | "f16vec2 dFdxFine(f16vec2);" |
653 | 4.34k | "f16vec3 dFdxFine(f16vec3);" |
654 | 4.34k | "f16vec4 dFdxFine(f16vec4);" |
655 | | |
656 | 4.34k | "float16_t dFdyFine(float16_t);" |
657 | 4.34k | "f16vec2 dFdyFine(f16vec2);" |
658 | 4.34k | "f16vec3 dFdyFine(f16vec3);" |
659 | 4.34k | "f16vec4 dFdyFine(f16vec4);" |
660 | | |
661 | 4.34k | "float16_t dFdxCoarse(float16_t);" |
662 | 4.34k | "f16vec2 dFdxCoarse(f16vec2);" |
663 | 4.34k | "f16vec3 dFdxCoarse(f16vec3);" |
664 | 4.34k | "f16vec4 dFdxCoarse(f16vec4);" |
665 | | |
666 | 4.34k | "float16_t dFdyCoarse(float16_t);" |
667 | 4.34k | "f16vec2 dFdyCoarse(f16vec2);" |
668 | 4.34k | "f16vec3 dFdyCoarse(f16vec3);" |
669 | 4.34k | "f16vec4 dFdyCoarse(f16vec4);" |
670 | | |
671 | 4.34k | "float16_t fwidth(float16_t);" |
672 | 4.34k | "f16vec2 fwidth(f16vec2);" |
673 | 4.34k | "f16vec3 fwidth(f16vec3);" |
674 | 4.34k | "f16vec4 fwidth(f16vec4);" |
675 | | |
676 | 4.34k | "float16_t fwidthFine(float16_t);" |
677 | 4.34k | "f16vec2 fwidthFine(f16vec2);" |
678 | 4.34k | "f16vec3 fwidthFine(f16vec3);" |
679 | 4.34k | "f16vec4 fwidthFine(f16vec4);" |
680 | | |
681 | 4.34k | "float16_t fwidthCoarse(float16_t);" |
682 | 4.34k | "f16vec2 fwidthCoarse(f16vec2);" |
683 | 4.34k | "f16vec3 fwidthCoarse(f16vec3);" |
684 | 4.34k | "f16vec4 fwidthCoarse(f16vec4);" |
685 | 4.34k | ); |
686 | | |
687 | 4.34k | TString derivativesAndControl64bits ( |
688 | 4.34k | "float64_t dFdx(float64_t);" |
689 | 4.34k | "f64vec2 dFdx(f64vec2);" |
690 | 4.34k | "f64vec3 dFdx(f64vec3);" |
691 | 4.34k | "f64vec4 dFdx(f64vec4);" |
692 | | |
693 | 4.34k | "float64_t dFdy(float64_t);" |
694 | 4.34k | "f64vec2 dFdy(f64vec2);" |
695 | 4.34k | "f64vec3 dFdy(f64vec3);" |
696 | 4.34k | "f64vec4 dFdy(f64vec4);" |
697 | | |
698 | 4.34k | "float64_t dFdxFine(float64_t);" |
699 | 4.34k | "f64vec2 dFdxFine(f64vec2);" |
700 | 4.34k | "f64vec3 dFdxFine(f64vec3);" |
701 | 4.34k | "f64vec4 dFdxFine(f64vec4);" |
702 | | |
703 | 4.34k | "float64_t dFdyFine(float64_t);" |
704 | 4.34k | "f64vec2 dFdyFine(f64vec2);" |
705 | 4.34k | "f64vec3 dFdyFine(f64vec3);" |
706 | 4.34k | "f64vec4 dFdyFine(f64vec4);" |
707 | | |
708 | 4.34k | "float64_t dFdxCoarse(float64_t);" |
709 | 4.34k | "f64vec2 dFdxCoarse(f64vec2);" |
710 | 4.34k | "f64vec3 dFdxCoarse(f64vec3);" |
711 | 4.34k | "f64vec4 dFdxCoarse(f64vec4);" |
712 | | |
713 | 4.34k | "float64_t dFdyCoarse(float64_t);" |
714 | 4.34k | "f64vec2 dFdyCoarse(f64vec2);" |
715 | 4.34k | "f64vec3 dFdyCoarse(f64vec3);" |
716 | 4.34k | "f64vec4 dFdyCoarse(f64vec4);" |
717 | | |
718 | 4.34k | "float64_t fwidth(float64_t);" |
719 | 4.34k | "f64vec2 fwidth(f64vec2);" |
720 | 4.34k | "f64vec3 fwidth(f64vec3);" |
721 | 4.34k | "f64vec4 fwidth(f64vec4);" |
722 | | |
723 | 4.34k | "float64_t fwidthFine(float64_t);" |
724 | 4.34k | "f64vec2 fwidthFine(f64vec2);" |
725 | 4.34k | "f64vec3 fwidthFine(f64vec3);" |
726 | 4.34k | "f64vec4 fwidthFine(f64vec4);" |
727 | | |
728 | 4.34k | "float64_t fwidthCoarse(float64_t);" |
729 | 4.34k | "f64vec2 fwidthCoarse(f64vec2);" |
730 | 4.34k | "f64vec3 fwidthCoarse(f64vec3);" |
731 | 4.34k | "f64vec4 fwidthCoarse(f64vec4);" |
732 | 4.34k | ); |
733 | | |
734 | | //============================================================================ |
735 | | // |
736 | | // Prototypes for built-in functions seen by both vertex and fragment shaders. |
737 | | // |
738 | | //============================================================================ |
739 | | |
740 | | // |
741 | | // double functions added to desktop 4.00, but not fma, frexp, ldexp, or pack/unpack |
742 | | // |
743 | 4.34k | if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64 |
744 | 1.76k | commonBuiltins.append( |
745 | | |
746 | 1.76k | "double sqrt(double);" |
747 | 1.76k | "dvec2 sqrt(dvec2);" |
748 | 1.76k | "dvec3 sqrt(dvec3);" |
749 | 1.76k | "dvec4 sqrt(dvec4);" |
750 | | |
751 | 1.76k | "double inversesqrt(double);" |
752 | 1.76k | "dvec2 inversesqrt(dvec2);" |
753 | 1.76k | "dvec3 inversesqrt(dvec3);" |
754 | 1.76k | "dvec4 inversesqrt(dvec4);" |
755 | | |
756 | 1.76k | "double abs(double);" |
757 | 1.76k | "dvec2 abs(dvec2);" |
758 | 1.76k | "dvec3 abs(dvec3);" |
759 | 1.76k | "dvec4 abs(dvec4);" |
760 | | |
761 | 1.76k | "double sign(double);" |
762 | 1.76k | "dvec2 sign(dvec2);" |
763 | 1.76k | "dvec3 sign(dvec3);" |
764 | 1.76k | "dvec4 sign(dvec4);" |
765 | | |
766 | 1.76k | "double floor(double);" |
767 | 1.76k | "dvec2 floor(dvec2);" |
768 | 1.76k | "dvec3 floor(dvec3);" |
769 | 1.76k | "dvec4 floor(dvec4);" |
770 | | |
771 | 1.76k | "double trunc(double);" |
772 | 1.76k | "dvec2 trunc(dvec2);" |
773 | 1.76k | "dvec3 trunc(dvec3);" |
774 | 1.76k | "dvec4 trunc(dvec4);" |
775 | | |
776 | 1.76k | "double round(double);" |
777 | 1.76k | "dvec2 round(dvec2);" |
778 | 1.76k | "dvec3 round(dvec3);" |
779 | 1.76k | "dvec4 round(dvec4);" |
780 | | |
781 | 1.76k | "double roundEven(double);" |
782 | 1.76k | "dvec2 roundEven(dvec2);" |
783 | 1.76k | "dvec3 roundEven(dvec3);" |
784 | 1.76k | "dvec4 roundEven(dvec4);" |
785 | | |
786 | 1.76k | "double ceil(double);" |
787 | 1.76k | "dvec2 ceil(dvec2);" |
788 | 1.76k | "dvec3 ceil(dvec3);" |
789 | 1.76k | "dvec4 ceil(dvec4);" |
790 | | |
791 | 1.76k | "double fract(double);" |
792 | 1.76k | "dvec2 fract(dvec2);" |
793 | 1.76k | "dvec3 fract(dvec3);" |
794 | 1.76k | "dvec4 fract(dvec4);" |
795 | | |
796 | 1.76k | "double mod(double, double);" |
797 | 1.76k | "dvec2 mod(dvec2 , double);" |
798 | 1.76k | "dvec3 mod(dvec3 , double);" |
799 | 1.76k | "dvec4 mod(dvec4 , double);" |
800 | 1.76k | "dvec2 mod(dvec2 , dvec2);" |
801 | 1.76k | "dvec3 mod(dvec3 , dvec3);" |
802 | 1.76k | "dvec4 mod(dvec4 , dvec4);" |
803 | | |
804 | 1.76k | "double modf(double, out double);" |
805 | 1.76k | "dvec2 modf(dvec2, out dvec2);" |
806 | 1.76k | "dvec3 modf(dvec3, out dvec3);" |
807 | 1.76k | "dvec4 modf(dvec4, out dvec4);" |
808 | | |
809 | 1.76k | "double min(double, double);" |
810 | 1.76k | "dvec2 min(dvec2, double);" |
811 | 1.76k | "dvec3 min(dvec3, double);" |
812 | 1.76k | "dvec4 min(dvec4, double);" |
813 | 1.76k | "dvec2 min(dvec2, dvec2);" |
814 | 1.76k | "dvec3 min(dvec3, dvec3);" |
815 | 1.76k | "dvec4 min(dvec4, dvec4);" |
816 | | |
817 | 1.76k | "double max(double, double);" |
818 | 1.76k | "dvec2 max(dvec2 , double);" |
819 | 1.76k | "dvec3 max(dvec3 , double);" |
820 | 1.76k | "dvec4 max(dvec4 , double);" |
821 | 1.76k | "dvec2 max(dvec2 , dvec2);" |
822 | 1.76k | "dvec3 max(dvec3 , dvec3);" |
823 | 1.76k | "dvec4 max(dvec4 , dvec4);" |
824 | | |
825 | 1.76k | "double clamp(double, double, double);" |
826 | 1.76k | "dvec2 clamp(dvec2 , double, double);" |
827 | 1.76k | "dvec3 clamp(dvec3 , double, double);" |
828 | 1.76k | "dvec4 clamp(dvec4 , double, double);" |
829 | 1.76k | "dvec2 clamp(dvec2 , dvec2 , dvec2);" |
830 | 1.76k | "dvec3 clamp(dvec3 , dvec3 , dvec3);" |
831 | 1.76k | "dvec4 clamp(dvec4 , dvec4 , dvec4);" |
832 | | |
833 | 1.76k | "double mix(double, double, double);" |
834 | 1.76k | "dvec2 mix(dvec2, dvec2, double);" |
835 | 1.76k | "dvec3 mix(dvec3, dvec3, double);" |
836 | 1.76k | "dvec4 mix(dvec4, dvec4, double);" |
837 | 1.76k | "dvec2 mix(dvec2, dvec2, dvec2);" |
838 | 1.76k | "dvec3 mix(dvec3, dvec3, dvec3);" |
839 | 1.76k | "dvec4 mix(dvec4, dvec4, dvec4);" |
840 | 1.76k | "double mix(double, double, bool);" |
841 | 1.76k | "dvec2 mix(dvec2, dvec2, bvec2);" |
842 | 1.76k | "dvec3 mix(dvec3, dvec3, bvec3);" |
843 | 1.76k | "dvec4 mix(dvec4, dvec4, bvec4);" |
844 | | |
845 | 1.76k | "double step(double, double);" |
846 | 1.76k | "dvec2 step(dvec2 , dvec2);" |
847 | 1.76k | "dvec3 step(dvec3 , dvec3);" |
848 | 1.76k | "dvec4 step(dvec4 , dvec4);" |
849 | 1.76k | "dvec2 step(double, dvec2);" |
850 | 1.76k | "dvec3 step(double, dvec3);" |
851 | 1.76k | "dvec4 step(double, dvec4);" |
852 | | |
853 | 1.76k | "double smoothstep(double, double, double);" |
854 | 1.76k | "dvec2 smoothstep(dvec2 , dvec2 , dvec2);" |
855 | 1.76k | "dvec3 smoothstep(dvec3 , dvec3 , dvec3);" |
856 | 1.76k | "dvec4 smoothstep(dvec4 , dvec4 , dvec4);" |
857 | 1.76k | "dvec2 smoothstep(double, double, dvec2);" |
858 | 1.76k | "dvec3 smoothstep(double, double, dvec3);" |
859 | 1.76k | "dvec4 smoothstep(double, double, dvec4);" |
860 | | |
861 | 1.76k | "bool isnan(double);" |
862 | 1.76k | "bvec2 isnan(dvec2);" |
863 | 1.76k | "bvec3 isnan(dvec3);" |
864 | 1.76k | "bvec4 isnan(dvec4);" |
865 | | |
866 | 1.76k | "bool isinf(double);" |
867 | 1.76k | "bvec2 isinf(dvec2);" |
868 | 1.76k | "bvec3 isinf(dvec3);" |
869 | 1.76k | "bvec4 isinf(dvec4);" |
870 | | |
871 | 1.76k | "double length(double);" |
872 | 1.76k | "double length(dvec2);" |
873 | 1.76k | "double length(dvec3);" |
874 | 1.76k | "double length(dvec4);" |
875 | | |
876 | 1.76k | "double distance(double, double);" |
877 | 1.76k | "double distance(dvec2 , dvec2);" |
878 | 1.76k | "double distance(dvec3 , dvec3);" |
879 | 1.76k | "double distance(dvec4 , dvec4);" |
880 | | |
881 | 1.76k | "double dot(double, double);" |
882 | 1.76k | "double dot(dvec2 , dvec2);" |
883 | 1.76k | "double dot(dvec3 , dvec3);" |
884 | 1.76k | "double dot(dvec4 , dvec4);" |
885 | | |
886 | 1.76k | "dvec3 cross(dvec3, dvec3);" |
887 | | |
888 | 1.76k | "double normalize(double);" |
889 | 1.76k | "dvec2 normalize(dvec2);" |
890 | 1.76k | "dvec3 normalize(dvec3);" |
891 | 1.76k | "dvec4 normalize(dvec4);" |
892 | | |
893 | 1.76k | "double faceforward(double, double, double);" |
894 | 1.76k | "dvec2 faceforward(dvec2, dvec2, dvec2);" |
895 | 1.76k | "dvec3 faceforward(dvec3, dvec3, dvec3);" |
896 | 1.76k | "dvec4 faceforward(dvec4, dvec4, dvec4);" |
897 | | |
898 | 1.76k | "double reflect(double, double);" |
899 | 1.76k | "dvec2 reflect(dvec2 , dvec2 );" |
900 | 1.76k | "dvec3 reflect(dvec3 , dvec3 );" |
901 | 1.76k | "dvec4 reflect(dvec4 , dvec4 );" |
902 | | |
903 | 1.76k | "double refract(double, double, double);" |
904 | 1.76k | "dvec2 refract(dvec2 , dvec2 , double);" |
905 | 1.76k | "dvec3 refract(dvec3 , dvec3 , double);" |
906 | 1.76k | "dvec4 refract(dvec4 , dvec4 , double);" |
907 | | |
908 | 1.76k | "dmat2 matrixCompMult(dmat2, dmat2);" |
909 | 1.76k | "dmat3 matrixCompMult(dmat3, dmat3);" |
910 | 1.76k | "dmat4 matrixCompMult(dmat4, dmat4);" |
911 | 1.76k | "dmat2x3 matrixCompMult(dmat2x3, dmat2x3);" |
912 | 1.76k | "dmat2x4 matrixCompMult(dmat2x4, dmat2x4);" |
913 | 1.76k | "dmat3x2 matrixCompMult(dmat3x2, dmat3x2);" |
914 | 1.76k | "dmat3x4 matrixCompMult(dmat3x4, dmat3x4);" |
915 | 1.76k | "dmat4x2 matrixCompMult(dmat4x2, dmat4x2);" |
916 | 1.76k | "dmat4x3 matrixCompMult(dmat4x3, dmat4x3);" |
917 | | |
918 | 1.76k | "dmat2 outerProduct(dvec2, dvec2);" |
919 | 1.76k | "dmat3 outerProduct(dvec3, dvec3);" |
920 | 1.76k | "dmat4 outerProduct(dvec4, dvec4);" |
921 | 1.76k | "dmat2x3 outerProduct(dvec3, dvec2);" |
922 | 1.76k | "dmat3x2 outerProduct(dvec2, dvec3);" |
923 | 1.76k | "dmat2x4 outerProduct(dvec4, dvec2);" |
924 | 1.76k | "dmat4x2 outerProduct(dvec2, dvec4);" |
925 | 1.76k | "dmat3x4 outerProduct(dvec4, dvec3);" |
926 | 1.76k | "dmat4x3 outerProduct(dvec3, dvec4);" |
927 | | |
928 | 1.76k | "dmat2 transpose(dmat2);" |
929 | 1.76k | "dmat3 transpose(dmat3);" |
930 | 1.76k | "dmat4 transpose(dmat4);" |
931 | 1.76k | "dmat2x3 transpose(dmat3x2);" |
932 | 1.76k | "dmat3x2 transpose(dmat2x3);" |
933 | 1.76k | "dmat2x4 transpose(dmat4x2);" |
934 | 1.76k | "dmat4x2 transpose(dmat2x4);" |
935 | 1.76k | "dmat3x4 transpose(dmat4x3);" |
936 | 1.76k | "dmat4x3 transpose(dmat3x4);" |
937 | | |
938 | 1.76k | "double determinant(dmat2);" |
939 | 1.76k | "double determinant(dmat3);" |
940 | 1.76k | "double determinant(dmat4);" |
941 | | |
942 | 1.76k | "dmat2 inverse(dmat2);" |
943 | 1.76k | "dmat3 inverse(dmat3);" |
944 | 1.76k | "dmat4 inverse(dmat4);" |
945 | | |
946 | 1.76k | "bvec2 lessThan(dvec2, dvec2);" |
947 | 1.76k | "bvec3 lessThan(dvec3, dvec3);" |
948 | 1.76k | "bvec4 lessThan(dvec4, dvec4);" |
949 | | |
950 | 1.76k | "bvec2 lessThanEqual(dvec2, dvec2);" |
951 | 1.76k | "bvec3 lessThanEqual(dvec3, dvec3);" |
952 | 1.76k | "bvec4 lessThanEqual(dvec4, dvec4);" |
953 | | |
954 | 1.76k | "bvec2 greaterThan(dvec2, dvec2);" |
955 | 1.76k | "bvec3 greaterThan(dvec3, dvec3);" |
956 | 1.76k | "bvec4 greaterThan(dvec4, dvec4);" |
957 | | |
958 | 1.76k | "bvec2 greaterThanEqual(dvec2, dvec2);" |
959 | 1.76k | "bvec3 greaterThanEqual(dvec3, dvec3);" |
960 | 1.76k | "bvec4 greaterThanEqual(dvec4, dvec4);" |
961 | | |
962 | 1.76k | "bvec2 equal(dvec2, dvec2);" |
963 | 1.76k | "bvec3 equal(dvec3, dvec3);" |
964 | 1.76k | "bvec4 equal(dvec4, dvec4);" |
965 | | |
966 | 1.76k | "bvec2 notEqual(dvec2, dvec2);" |
967 | 1.76k | "bvec3 notEqual(dvec3, dvec3);" |
968 | 1.76k | "bvec4 notEqual(dvec4, dvec4);" |
969 | | |
970 | 1.76k | "\n"); |
971 | 1.76k | } |
972 | | |
973 | 4.34k | if (profile == EEsProfile && version >= 310) { // Explicit Types |
974 | 259 | commonBuiltins.append( |
975 | | |
976 | 259 | "float64_t sqrt(float64_t);" |
977 | 259 | "f64vec2 sqrt(f64vec2);" |
978 | 259 | "f64vec3 sqrt(f64vec3);" |
979 | 259 | "f64vec4 sqrt(f64vec4);" |
980 | | |
981 | 259 | "float64_t inversesqrt(float64_t);" |
982 | 259 | "f64vec2 inversesqrt(f64vec2);" |
983 | 259 | "f64vec3 inversesqrt(f64vec3);" |
984 | 259 | "f64vec4 inversesqrt(f64vec4);" |
985 | | |
986 | 259 | "float64_t abs(float64_t);" |
987 | 259 | "f64vec2 abs(f64vec2);" |
988 | 259 | "f64vec3 abs(f64vec3);" |
989 | 259 | "f64vec4 abs(f64vec4);" |
990 | | |
991 | 259 | "float64_t sign(float64_t);" |
992 | 259 | "f64vec2 sign(f64vec2);" |
993 | 259 | "f64vec3 sign(f64vec3);" |
994 | 259 | "f64vec4 sign(f64vec4);" |
995 | | |
996 | 259 | "float64_t floor(float64_t);" |
997 | 259 | "f64vec2 floor(f64vec2);" |
998 | 259 | "f64vec3 floor(f64vec3);" |
999 | 259 | "f64vec4 floor(f64vec4);" |
1000 | | |
1001 | 259 | "float64_t trunc(float64_t);" |
1002 | 259 | "f64vec2 trunc(f64vec2);" |
1003 | 259 | "f64vec3 trunc(f64vec3);" |
1004 | 259 | "f64vec4 trunc(f64vec4);" |
1005 | | |
1006 | 259 | "float64_t round(float64_t);" |
1007 | 259 | "f64vec2 round(f64vec2);" |
1008 | 259 | "f64vec3 round(f64vec3);" |
1009 | 259 | "f64vec4 round(f64vec4);" |
1010 | | |
1011 | 259 | "float64_t roundEven(float64_t);" |
1012 | 259 | "f64vec2 roundEven(f64vec2);" |
1013 | 259 | "f64vec3 roundEven(f64vec3);" |
1014 | 259 | "f64vec4 roundEven(f64vec4);" |
1015 | | |
1016 | 259 | "float64_t ceil(float64_t);" |
1017 | 259 | "f64vec2 ceil(f64vec2);" |
1018 | 259 | "f64vec3 ceil(f64vec3);" |
1019 | 259 | "f64vec4 ceil(f64vec4);" |
1020 | | |
1021 | 259 | "float64_t fract(float64_t);" |
1022 | 259 | "f64vec2 fract(f64vec2);" |
1023 | 259 | "f64vec3 fract(f64vec3);" |
1024 | 259 | "f64vec4 fract(f64vec4);" |
1025 | | |
1026 | 259 | "float64_t mod(float64_t, float64_t);" |
1027 | 259 | "f64vec2 mod(f64vec2 , float64_t);" |
1028 | 259 | "f64vec3 mod(f64vec3 , float64_t);" |
1029 | 259 | "f64vec4 mod(f64vec4 , float64_t);" |
1030 | 259 | "f64vec2 mod(f64vec2 , f64vec2);" |
1031 | 259 | "f64vec3 mod(f64vec3 , f64vec3);" |
1032 | 259 | "f64vec4 mod(f64vec4 , f64vec4);" |
1033 | | |
1034 | 259 | "float64_t modf(float64_t, out float64_t);" |
1035 | 259 | "f64vec2 modf(f64vec2, out f64vec2);" |
1036 | 259 | "f64vec3 modf(f64vec3, out f64vec3);" |
1037 | 259 | "f64vec4 modf(f64vec4, out f64vec4);" |
1038 | | |
1039 | 259 | "float64_t min(float64_t, float64_t);" |
1040 | 259 | "f64vec2 min(f64vec2, float64_t);" |
1041 | 259 | "f64vec3 min(f64vec3, float64_t);" |
1042 | 259 | "f64vec4 min(f64vec4, float64_t);" |
1043 | 259 | "f64vec2 min(f64vec2, f64vec2);" |
1044 | 259 | "f64vec3 min(f64vec3, f64vec3);" |
1045 | 259 | "f64vec4 min(f64vec4, f64vec4);" |
1046 | | |
1047 | 259 | "float64_t max(float64_t, float64_t);" |
1048 | 259 | "f64vec2 max(f64vec2 , float64_t);" |
1049 | 259 | "f64vec3 max(f64vec3 , float64_t);" |
1050 | 259 | "f64vec4 max(f64vec4 , float64_t);" |
1051 | 259 | "f64vec2 max(f64vec2 , f64vec2);" |
1052 | 259 | "f64vec3 max(f64vec3 , f64vec3);" |
1053 | 259 | "f64vec4 max(f64vec4 , f64vec4);" |
1054 | | |
1055 | 259 | "float64_t clamp(float64_t, float64_t, float64_t);" |
1056 | 259 | "f64vec2 clamp(f64vec2 , float64_t, float64_t);" |
1057 | 259 | "f64vec3 clamp(f64vec3 , float64_t, float64_t);" |
1058 | 259 | "f64vec4 clamp(f64vec4 , float64_t, float64_t);" |
1059 | 259 | "f64vec2 clamp(f64vec2 , f64vec2 , f64vec2);" |
1060 | 259 | "f64vec3 clamp(f64vec3 , f64vec3 , f64vec3);" |
1061 | 259 | "f64vec4 clamp(f64vec4 , f64vec4 , f64vec4);" |
1062 | | |
1063 | 259 | "float64_t mix(float64_t, float64_t, float64_t);" |
1064 | 259 | "f64vec2 mix(f64vec2, f64vec2, float64_t);" |
1065 | 259 | "f64vec3 mix(f64vec3, f64vec3, float64_t);" |
1066 | 259 | "f64vec4 mix(f64vec4, f64vec4, float64_t);" |
1067 | 259 | "f64vec2 mix(f64vec2, f64vec2, f64vec2);" |
1068 | 259 | "f64vec3 mix(f64vec3, f64vec3, f64vec3);" |
1069 | 259 | "f64vec4 mix(f64vec4, f64vec4, f64vec4);" |
1070 | 259 | "float64_t mix(float64_t, float64_t, bool);" |
1071 | 259 | "f64vec2 mix(f64vec2, f64vec2, bvec2);" |
1072 | 259 | "f64vec3 mix(f64vec3, f64vec3, bvec3);" |
1073 | 259 | "f64vec4 mix(f64vec4, f64vec4, bvec4);" |
1074 | | |
1075 | 259 | "float64_t step(float64_t, float64_t);" |
1076 | 259 | "f64vec2 step(f64vec2 , f64vec2);" |
1077 | 259 | "f64vec3 step(f64vec3 , f64vec3);" |
1078 | 259 | "f64vec4 step(f64vec4 , f64vec4);" |
1079 | 259 | "f64vec2 step(float64_t, f64vec2);" |
1080 | 259 | "f64vec3 step(float64_t, f64vec3);" |
1081 | 259 | "f64vec4 step(float64_t, f64vec4);" |
1082 | | |
1083 | 259 | "float64_t smoothstep(float64_t, float64_t, float64_t);" |
1084 | 259 | "f64vec2 smoothstep(f64vec2 , f64vec2 , f64vec2);" |
1085 | 259 | "f64vec3 smoothstep(f64vec3 , f64vec3 , f64vec3);" |
1086 | 259 | "f64vec4 smoothstep(f64vec4 , f64vec4 , f64vec4);" |
1087 | 259 | "f64vec2 smoothstep(float64_t, float64_t, f64vec2);" |
1088 | 259 | "f64vec3 smoothstep(float64_t, float64_t, f64vec3);" |
1089 | 259 | "f64vec4 smoothstep(float64_t, float64_t, f64vec4);" |
1090 | | |
1091 | 259 | "float64_t length(float64_t);" |
1092 | 259 | "float64_t length(f64vec2);" |
1093 | 259 | "float64_t length(f64vec3);" |
1094 | 259 | "float64_t length(f64vec4);" |
1095 | | |
1096 | 259 | "float64_t distance(float64_t, float64_t);" |
1097 | 259 | "float64_t distance(f64vec2 , f64vec2);" |
1098 | 259 | "float64_t distance(f64vec3 , f64vec3);" |
1099 | 259 | "float64_t distance(f64vec4 , f64vec4);" |
1100 | | |
1101 | 259 | "float64_t dot(float64_t, float64_t);" |
1102 | 259 | "float64_t dot(f64vec2 , f64vec2);" |
1103 | 259 | "float64_t dot(f64vec3 , f64vec3);" |
1104 | 259 | "float64_t dot(f64vec4 , f64vec4);" |
1105 | | |
1106 | 259 | "f64vec3 cross(f64vec3, f64vec3);" |
1107 | | |
1108 | 259 | "float64_t normalize(float64_t);" |
1109 | 259 | "f64vec2 normalize(f64vec2);" |
1110 | 259 | "f64vec3 normalize(f64vec3);" |
1111 | 259 | "f64vec4 normalize(f64vec4);" |
1112 | | |
1113 | 259 | "float64_t faceforward(float64_t, float64_t, float64_t);" |
1114 | 259 | "f64vec2 faceforward(f64vec2, f64vec2, f64vec2);" |
1115 | 259 | "f64vec3 faceforward(f64vec3, f64vec3, f64vec3);" |
1116 | 259 | "f64vec4 faceforward(f64vec4, f64vec4, f64vec4);" |
1117 | | |
1118 | 259 | "float64_t reflect(float64_t, float64_t);" |
1119 | 259 | "f64vec2 reflect(f64vec2 , f64vec2 );" |
1120 | 259 | "f64vec3 reflect(f64vec3 , f64vec3 );" |
1121 | 259 | "f64vec4 reflect(f64vec4 , f64vec4 );" |
1122 | | |
1123 | 259 | "float64_t refract(float64_t, float64_t, float64_t);" |
1124 | 259 | "f64vec2 refract(f64vec2 , f64vec2 , float64_t);" |
1125 | 259 | "f64vec3 refract(f64vec3 , f64vec3 , float64_t);" |
1126 | 259 | "f64vec4 refract(f64vec4 , f64vec4 , float64_t);" |
1127 | | |
1128 | 259 | "f64mat2 matrixCompMult(f64mat2, f64mat2);" |
1129 | 259 | "f64mat3 matrixCompMult(f64mat3, f64mat3);" |
1130 | 259 | "f64mat4 matrixCompMult(f64mat4, f64mat4);" |
1131 | 259 | "f64mat2x3 matrixCompMult(f64mat2x3, f64mat2x3);" |
1132 | 259 | "f64mat2x4 matrixCompMult(f64mat2x4, f64mat2x4);" |
1133 | 259 | "f64mat3x2 matrixCompMult(f64mat3x2, f64mat3x2);" |
1134 | 259 | "f64mat3x4 matrixCompMult(f64mat3x4, f64mat3x4);" |
1135 | 259 | "f64mat4x2 matrixCompMult(f64mat4x2, f64mat4x2);" |
1136 | 259 | "f64mat4x3 matrixCompMult(f64mat4x3, f64mat4x3);" |
1137 | | |
1138 | 259 | "f64mat2 outerProduct(f64vec2, f64vec2);" |
1139 | 259 | "f64mat3 outerProduct(f64vec3, f64vec3);" |
1140 | 259 | "f64mat4 outerProduct(f64vec4, f64vec4);" |
1141 | 259 | "f64mat2x3 outerProduct(f64vec3, f64vec2);" |
1142 | 259 | "f64mat3x2 outerProduct(f64vec2, f64vec3);" |
1143 | 259 | "f64mat2x4 outerProduct(f64vec4, f64vec2);" |
1144 | 259 | "f64mat4x2 outerProduct(f64vec2, f64vec4);" |
1145 | 259 | "f64mat3x4 outerProduct(f64vec4, f64vec3);" |
1146 | 259 | "f64mat4x3 outerProduct(f64vec3, f64vec4);" |
1147 | | |
1148 | 259 | "f64mat2 transpose(f64mat2);" |
1149 | 259 | "f64mat3 transpose(f64mat3);" |
1150 | 259 | "f64mat4 transpose(f64mat4);" |
1151 | 259 | "f64mat2x3 transpose(f64mat3x2);" |
1152 | 259 | "f64mat3x2 transpose(f64mat2x3);" |
1153 | 259 | "f64mat2x4 transpose(f64mat4x2);" |
1154 | 259 | "f64mat4x2 transpose(f64mat2x4);" |
1155 | 259 | "f64mat3x4 transpose(f64mat4x3);" |
1156 | 259 | "f64mat4x3 transpose(f64mat3x4);" |
1157 | | |
1158 | 259 | "float64_t determinant(f64mat2);" |
1159 | 259 | "float64_t determinant(f64mat3);" |
1160 | 259 | "float64_t determinant(f64mat4);" |
1161 | | |
1162 | 259 | "f64mat2 inverse(f64mat2);" |
1163 | 259 | "f64mat3 inverse(f64mat3);" |
1164 | 259 | "f64mat4 inverse(f64mat4);" |
1165 | | |
1166 | 259 | "\n"); |
1167 | 259 | } |
1168 | | |
1169 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { |
1170 | 1.14k | commonBuiltins.append( |
1171 | | |
1172 | 1.14k | "int64_t abs(int64_t);" |
1173 | 1.14k | "i64vec2 abs(i64vec2);" |
1174 | 1.14k | "i64vec3 abs(i64vec3);" |
1175 | 1.14k | "i64vec4 abs(i64vec4);" |
1176 | | |
1177 | 1.14k | "int64_t sign(int64_t);" |
1178 | 1.14k | "i64vec2 sign(i64vec2);" |
1179 | 1.14k | "i64vec3 sign(i64vec3);" |
1180 | 1.14k | "i64vec4 sign(i64vec4);" |
1181 | | |
1182 | 1.14k | "int64_t min(int64_t, int64_t);" |
1183 | 1.14k | "i64vec2 min(i64vec2, int64_t);" |
1184 | 1.14k | "i64vec3 min(i64vec3, int64_t);" |
1185 | 1.14k | "i64vec4 min(i64vec4, int64_t);" |
1186 | 1.14k | "i64vec2 min(i64vec2, i64vec2);" |
1187 | 1.14k | "i64vec3 min(i64vec3, i64vec3);" |
1188 | 1.14k | "i64vec4 min(i64vec4, i64vec4);" |
1189 | 1.14k | "uint64_t min(uint64_t, uint64_t);" |
1190 | 1.14k | "u64vec2 min(u64vec2, uint64_t);" |
1191 | 1.14k | "u64vec3 min(u64vec3, uint64_t);" |
1192 | 1.14k | "u64vec4 min(u64vec4, uint64_t);" |
1193 | 1.14k | "u64vec2 min(u64vec2, u64vec2);" |
1194 | 1.14k | "u64vec3 min(u64vec3, u64vec3);" |
1195 | 1.14k | "u64vec4 min(u64vec4, u64vec4);" |
1196 | | |
1197 | 1.14k | "int64_t max(int64_t, int64_t);" |
1198 | 1.14k | "i64vec2 max(i64vec2, int64_t);" |
1199 | 1.14k | "i64vec3 max(i64vec3, int64_t);" |
1200 | 1.14k | "i64vec4 max(i64vec4, int64_t);" |
1201 | 1.14k | "i64vec2 max(i64vec2, i64vec2);" |
1202 | 1.14k | "i64vec3 max(i64vec3, i64vec3);" |
1203 | 1.14k | "i64vec4 max(i64vec4, i64vec4);" |
1204 | 1.14k | "uint64_t max(uint64_t, uint64_t);" |
1205 | 1.14k | "u64vec2 max(u64vec2, uint64_t);" |
1206 | 1.14k | "u64vec3 max(u64vec3, uint64_t);" |
1207 | 1.14k | "u64vec4 max(u64vec4, uint64_t);" |
1208 | 1.14k | "u64vec2 max(u64vec2, u64vec2);" |
1209 | 1.14k | "u64vec3 max(u64vec3, u64vec3);" |
1210 | 1.14k | "u64vec4 max(u64vec4, u64vec4);" |
1211 | | |
1212 | 1.14k | "int64_t clamp(int64_t, int64_t, int64_t);" |
1213 | 1.14k | "i64vec2 clamp(i64vec2, int64_t, int64_t);" |
1214 | 1.14k | "i64vec3 clamp(i64vec3, int64_t, int64_t);" |
1215 | 1.14k | "i64vec4 clamp(i64vec4, int64_t, int64_t);" |
1216 | 1.14k | "i64vec2 clamp(i64vec2, i64vec2, i64vec2);" |
1217 | 1.14k | "i64vec3 clamp(i64vec3, i64vec3, i64vec3);" |
1218 | 1.14k | "i64vec4 clamp(i64vec4, i64vec4, i64vec4);" |
1219 | 1.14k | "uint64_t clamp(uint64_t, uint64_t, uint64_t);" |
1220 | 1.14k | "u64vec2 clamp(u64vec2, uint64_t, uint64_t);" |
1221 | 1.14k | "u64vec3 clamp(u64vec3, uint64_t, uint64_t);" |
1222 | 1.14k | "u64vec4 clamp(u64vec4, uint64_t, uint64_t);" |
1223 | 1.14k | "u64vec2 clamp(u64vec2, u64vec2, u64vec2);" |
1224 | 1.14k | "u64vec3 clamp(u64vec3, u64vec3, u64vec3);" |
1225 | 1.14k | "u64vec4 clamp(u64vec4, u64vec4, u64vec4);" |
1226 | | |
1227 | 1.14k | "int64_t mix(int64_t, int64_t, bool);" |
1228 | 1.14k | "i64vec2 mix(i64vec2, i64vec2, bvec2);" |
1229 | 1.14k | "i64vec3 mix(i64vec3, i64vec3, bvec3);" |
1230 | 1.14k | "i64vec4 mix(i64vec4, i64vec4, bvec4);" |
1231 | 1.14k | "uint64_t mix(uint64_t, uint64_t, bool);" |
1232 | 1.14k | "u64vec2 mix(u64vec2, u64vec2, bvec2);" |
1233 | 1.14k | "u64vec3 mix(u64vec3, u64vec3, bvec3);" |
1234 | 1.14k | "u64vec4 mix(u64vec4, u64vec4, bvec4);" |
1235 | | |
1236 | 1.14k | "int64_t doubleBitsToInt64(float64_t);" |
1237 | 1.14k | "i64vec2 doubleBitsToInt64(f64vec2);" |
1238 | 1.14k | "i64vec3 doubleBitsToInt64(f64vec3);" |
1239 | 1.14k | "i64vec4 doubleBitsToInt64(f64vec4);" |
1240 | | |
1241 | 1.14k | "uint64_t doubleBitsToUint64(float64_t);" |
1242 | 1.14k | "u64vec2 doubleBitsToUint64(f64vec2);" |
1243 | 1.14k | "u64vec3 doubleBitsToUint64(f64vec3);" |
1244 | 1.14k | "u64vec4 doubleBitsToUint64(f64vec4);" |
1245 | | |
1246 | 1.14k | "float64_t int64BitsToDouble(int64_t);" |
1247 | 1.14k | "f64vec2 int64BitsToDouble(i64vec2);" |
1248 | 1.14k | "f64vec3 int64BitsToDouble(i64vec3);" |
1249 | 1.14k | "f64vec4 int64BitsToDouble(i64vec4);" |
1250 | | |
1251 | 1.14k | "float64_t uint64BitsToDouble(uint64_t);" |
1252 | 1.14k | "f64vec2 uint64BitsToDouble(u64vec2);" |
1253 | 1.14k | "f64vec3 uint64BitsToDouble(u64vec3);" |
1254 | 1.14k | "f64vec4 uint64BitsToDouble(u64vec4);" |
1255 | | |
1256 | 1.14k | "int64_t packInt2x32(ivec2);" |
1257 | 1.14k | "uint64_t packUint2x32(uvec2);" |
1258 | 1.14k | "ivec2 unpackInt2x32(int64_t);" |
1259 | 1.14k | "uvec2 unpackUint2x32(uint64_t);" |
1260 | | |
1261 | 1.14k | "bvec2 lessThan(i64vec2, i64vec2);" |
1262 | 1.14k | "bvec3 lessThan(i64vec3, i64vec3);" |
1263 | 1.14k | "bvec4 lessThan(i64vec4, i64vec4);" |
1264 | 1.14k | "bvec2 lessThan(u64vec2, u64vec2);" |
1265 | 1.14k | "bvec3 lessThan(u64vec3, u64vec3);" |
1266 | 1.14k | "bvec4 lessThan(u64vec4, u64vec4);" |
1267 | | |
1268 | 1.14k | "bvec2 lessThanEqual(i64vec2, i64vec2);" |
1269 | 1.14k | "bvec3 lessThanEqual(i64vec3, i64vec3);" |
1270 | 1.14k | "bvec4 lessThanEqual(i64vec4, i64vec4);" |
1271 | 1.14k | "bvec2 lessThanEqual(u64vec2, u64vec2);" |
1272 | 1.14k | "bvec3 lessThanEqual(u64vec3, u64vec3);" |
1273 | 1.14k | "bvec4 lessThanEqual(u64vec4, u64vec4);" |
1274 | | |
1275 | 1.14k | "bvec2 greaterThan(i64vec2, i64vec2);" |
1276 | 1.14k | "bvec3 greaterThan(i64vec3, i64vec3);" |
1277 | 1.14k | "bvec4 greaterThan(i64vec4, i64vec4);" |
1278 | 1.14k | "bvec2 greaterThan(u64vec2, u64vec2);" |
1279 | 1.14k | "bvec3 greaterThan(u64vec3, u64vec3);" |
1280 | 1.14k | "bvec4 greaterThan(u64vec4, u64vec4);" |
1281 | | |
1282 | 1.14k | "bvec2 greaterThanEqual(i64vec2, i64vec2);" |
1283 | 1.14k | "bvec3 greaterThanEqual(i64vec3, i64vec3);" |
1284 | 1.14k | "bvec4 greaterThanEqual(i64vec4, i64vec4);" |
1285 | 1.14k | "bvec2 greaterThanEqual(u64vec2, u64vec2);" |
1286 | 1.14k | "bvec3 greaterThanEqual(u64vec3, u64vec3);" |
1287 | 1.14k | "bvec4 greaterThanEqual(u64vec4, u64vec4);" |
1288 | | |
1289 | 1.14k | "bvec2 equal(i64vec2, i64vec2);" |
1290 | 1.14k | "bvec3 equal(i64vec3, i64vec3);" |
1291 | 1.14k | "bvec4 equal(i64vec4, i64vec4);" |
1292 | 1.14k | "bvec2 equal(u64vec2, u64vec2);" |
1293 | 1.14k | "bvec3 equal(u64vec3, u64vec3);" |
1294 | 1.14k | "bvec4 equal(u64vec4, u64vec4);" |
1295 | | |
1296 | 1.14k | "bvec2 notEqual(i64vec2, i64vec2);" |
1297 | 1.14k | "bvec3 notEqual(i64vec3, i64vec3);" |
1298 | 1.14k | "bvec4 notEqual(i64vec4, i64vec4);" |
1299 | 1.14k | "bvec2 notEqual(u64vec2, u64vec2);" |
1300 | 1.14k | "bvec3 notEqual(u64vec3, u64vec3);" |
1301 | 1.14k | "bvec4 notEqual(u64vec4, u64vec4);" |
1302 | | |
1303 | 1.14k | "int64_t bitCount(int64_t);" |
1304 | 1.14k | "i64vec2 bitCount(i64vec2);" |
1305 | 1.14k | "i64vec3 bitCount(i64vec3);" |
1306 | 1.14k | "i64vec4 bitCount(i64vec4);" |
1307 | | |
1308 | 1.14k | "int64_t bitCount(uint64_t);" |
1309 | 1.14k | "i64vec2 bitCount(u64vec2);" |
1310 | 1.14k | "i64vec3 bitCount(u64vec3);" |
1311 | 1.14k | "i64vec4 bitCount(u64vec4);" |
1312 | | |
1313 | 1.14k | "int64_t findLSB(int64_t);" |
1314 | 1.14k | "i64vec2 findLSB(i64vec2);" |
1315 | 1.14k | "i64vec3 findLSB(i64vec3);" |
1316 | 1.14k | "i64vec4 findLSB(i64vec4);" |
1317 | | |
1318 | 1.14k | "int64_t findLSB(uint64_t);" |
1319 | 1.14k | "i64vec2 findLSB(u64vec2);" |
1320 | 1.14k | "i64vec3 findLSB(u64vec3);" |
1321 | 1.14k | "i64vec4 findLSB(u64vec4);" |
1322 | | |
1323 | 1.14k | "int64_t findMSB(int64_t);" |
1324 | 1.14k | "i64vec2 findMSB(i64vec2);" |
1325 | 1.14k | "i64vec3 findMSB(i64vec3);" |
1326 | 1.14k | "i64vec4 findMSB(i64vec4);" |
1327 | | |
1328 | 1.14k | "int64_t findMSB(uint64_t);" |
1329 | 1.14k | "i64vec2 findMSB(u64vec2);" |
1330 | 1.14k | "i64vec3 findMSB(u64vec3);" |
1331 | 1.14k | "i64vec4 findMSB(u64vec4);" |
1332 | | |
1333 | 1.14k | "\n" |
1334 | 1.14k | ); |
1335 | 1.14k | } |
1336 | | |
1337 | | // GL_AMD_shader_trinary_minmax |
1338 | 4.34k | if (profile != EEsProfile && version >= 430) { |
1339 | 1.22k | commonBuiltins.append( |
1340 | 1.22k | "float min3(float, float, float);" |
1341 | 1.22k | "vec2 min3(vec2, vec2, vec2);" |
1342 | 1.22k | "vec3 min3(vec3, vec3, vec3);" |
1343 | 1.22k | "vec4 min3(vec4, vec4, vec4);" |
1344 | | |
1345 | 1.22k | "int min3(int, int, int);" |
1346 | 1.22k | "ivec2 min3(ivec2, ivec2, ivec2);" |
1347 | 1.22k | "ivec3 min3(ivec3, ivec3, ivec3);" |
1348 | 1.22k | "ivec4 min3(ivec4, ivec4, ivec4);" |
1349 | | |
1350 | 1.22k | "uint min3(uint, uint, uint);" |
1351 | 1.22k | "uvec2 min3(uvec2, uvec2, uvec2);" |
1352 | 1.22k | "uvec3 min3(uvec3, uvec3, uvec3);" |
1353 | 1.22k | "uvec4 min3(uvec4, uvec4, uvec4);" |
1354 | | |
1355 | 1.22k | "float max3(float, float, float);" |
1356 | 1.22k | "vec2 max3(vec2, vec2, vec2);" |
1357 | 1.22k | "vec3 max3(vec3, vec3, vec3);" |
1358 | 1.22k | "vec4 max3(vec4, vec4, vec4);" |
1359 | | |
1360 | 1.22k | "int max3(int, int, int);" |
1361 | 1.22k | "ivec2 max3(ivec2, ivec2, ivec2);" |
1362 | 1.22k | "ivec3 max3(ivec3, ivec3, ivec3);" |
1363 | 1.22k | "ivec4 max3(ivec4, ivec4, ivec4);" |
1364 | | |
1365 | 1.22k | "uint max3(uint, uint, uint);" |
1366 | 1.22k | "uvec2 max3(uvec2, uvec2, uvec2);" |
1367 | 1.22k | "uvec3 max3(uvec3, uvec3, uvec3);" |
1368 | 1.22k | "uvec4 max3(uvec4, uvec4, uvec4);" |
1369 | | |
1370 | 1.22k | "float mid3(float, float, float);" |
1371 | 1.22k | "vec2 mid3(vec2, vec2, vec2);" |
1372 | 1.22k | "vec3 mid3(vec3, vec3, vec3);" |
1373 | 1.22k | "vec4 mid3(vec4, vec4, vec4);" |
1374 | | |
1375 | 1.22k | "int mid3(int, int, int);" |
1376 | 1.22k | "ivec2 mid3(ivec2, ivec2, ivec2);" |
1377 | 1.22k | "ivec3 mid3(ivec3, ivec3, ivec3);" |
1378 | 1.22k | "ivec4 mid3(ivec4, ivec4, ivec4);" |
1379 | | |
1380 | 1.22k | "uint mid3(uint, uint, uint);" |
1381 | 1.22k | "uvec2 mid3(uvec2, uvec2, uvec2);" |
1382 | 1.22k | "uvec3 mid3(uvec3, uvec3, uvec3);" |
1383 | 1.22k | "uvec4 mid3(uvec4, uvec4, uvec4);" |
1384 | | |
1385 | 1.22k | "float16_t min3(float16_t, float16_t, float16_t);" |
1386 | 1.22k | "f16vec2 min3(f16vec2, f16vec2, f16vec2);" |
1387 | 1.22k | "f16vec3 min3(f16vec3, f16vec3, f16vec3);" |
1388 | 1.22k | "f16vec4 min3(f16vec4, f16vec4, f16vec4);" |
1389 | | |
1390 | 1.22k | "float16_t max3(float16_t, float16_t, float16_t);" |
1391 | 1.22k | "f16vec2 max3(f16vec2, f16vec2, f16vec2);" |
1392 | 1.22k | "f16vec3 max3(f16vec3, f16vec3, f16vec3);" |
1393 | 1.22k | "f16vec4 max3(f16vec4, f16vec4, f16vec4);" |
1394 | | |
1395 | 1.22k | "float16_t mid3(float16_t, float16_t, float16_t);" |
1396 | 1.22k | "f16vec2 mid3(f16vec2, f16vec2, f16vec2);" |
1397 | 1.22k | "f16vec3 mid3(f16vec3, f16vec3, f16vec3);" |
1398 | 1.22k | "f16vec4 mid3(f16vec4, f16vec4, f16vec4);" |
1399 | | |
1400 | 1.22k | "int16_t min3(int16_t, int16_t, int16_t);" |
1401 | 1.22k | "i16vec2 min3(i16vec2, i16vec2, i16vec2);" |
1402 | 1.22k | "i16vec3 min3(i16vec3, i16vec3, i16vec3);" |
1403 | 1.22k | "i16vec4 min3(i16vec4, i16vec4, i16vec4);" |
1404 | | |
1405 | 1.22k | "int16_t max3(int16_t, int16_t, int16_t);" |
1406 | 1.22k | "i16vec2 max3(i16vec2, i16vec2, i16vec2);" |
1407 | 1.22k | "i16vec3 max3(i16vec3, i16vec3, i16vec3);" |
1408 | 1.22k | "i16vec4 max3(i16vec4, i16vec4, i16vec4);" |
1409 | | |
1410 | 1.22k | "int16_t mid3(int16_t, int16_t, int16_t);" |
1411 | 1.22k | "i16vec2 mid3(i16vec2, i16vec2, i16vec2);" |
1412 | 1.22k | "i16vec3 mid3(i16vec3, i16vec3, i16vec3);" |
1413 | 1.22k | "i16vec4 mid3(i16vec4, i16vec4, i16vec4);" |
1414 | | |
1415 | 1.22k | "uint16_t min3(uint16_t, uint16_t, uint16_t);" |
1416 | 1.22k | "u16vec2 min3(u16vec2, u16vec2, u16vec2);" |
1417 | 1.22k | "u16vec3 min3(u16vec3, u16vec3, u16vec3);" |
1418 | 1.22k | "u16vec4 min3(u16vec4, u16vec4, u16vec4);" |
1419 | | |
1420 | 1.22k | "uint16_t max3(uint16_t, uint16_t, uint16_t);" |
1421 | 1.22k | "u16vec2 max3(u16vec2, u16vec2, u16vec2);" |
1422 | 1.22k | "u16vec3 max3(u16vec3, u16vec3, u16vec3);" |
1423 | 1.22k | "u16vec4 max3(u16vec4, u16vec4, u16vec4);" |
1424 | | |
1425 | 1.22k | "uint16_t mid3(uint16_t, uint16_t, uint16_t);" |
1426 | 1.22k | "u16vec2 mid3(u16vec2, u16vec2, u16vec2);" |
1427 | 1.22k | "u16vec3 mid3(u16vec3, u16vec3, u16vec3);" |
1428 | 1.22k | "u16vec4 mid3(u16vec4, u16vec4, u16vec4);" |
1429 | | |
1430 | 1.22k | "\n" |
1431 | 1.22k | ); |
1432 | 1.22k | } |
1433 | | |
1434 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
1435 | 4.08k | (profile != EEsProfile && version >= 430)) { |
1436 | 1.48k | commonBuiltins.append( |
1437 | 1.48k | "uint atomicAdd(coherent volatile nontemporal inout uint, uint, int, int, int);" |
1438 | 1.48k | " int atomicAdd(coherent volatile nontemporal inout int, int, int, int, int);" |
1439 | | |
1440 | 1.48k | "uint atomicMin(coherent volatile nontemporal inout uint, uint, int, int, int);" |
1441 | 1.48k | " int atomicMin(coherent volatile nontemporal inout int, int, int, int, int);" |
1442 | | |
1443 | 1.48k | "uint atomicMax(coherent volatile nontemporal inout uint, uint, int, int, int);" |
1444 | 1.48k | " int atomicMax(coherent volatile nontemporal inout int, int, int, int, int);" |
1445 | | |
1446 | 1.48k | "uint atomicAnd(coherent volatile nontemporal inout uint, uint, int, int, int);" |
1447 | 1.48k | " int atomicAnd(coherent volatile nontemporal inout int, int, int, int, int);" |
1448 | | |
1449 | 1.48k | "uint atomicOr (coherent volatile nontemporal inout uint, uint, int, int, int);" |
1450 | 1.48k | " int atomicOr (coherent volatile nontemporal inout int, int, int, int, int);" |
1451 | | |
1452 | 1.48k | "uint atomicXor(coherent volatile nontemporal inout uint, uint, int, int, int);" |
1453 | 1.48k | " int atomicXor(coherent volatile nontemporal inout int, int, int, int, int);" |
1454 | | |
1455 | 1.48k | "uint atomicExchange(coherent volatile nontemporal inout uint, uint, int, int, int);" |
1456 | 1.48k | " int atomicExchange(coherent volatile nontemporal inout int, int, int, int, int);" |
1457 | | |
1458 | 1.48k | "uint atomicCompSwap(coherent volatile nontemporal inout uint, uint, uint, int, int, int, int, int);" |
1459 | 1.48k | " int atomicCompSwap(coherent volatile nontemporal inout int, int, int, int, int, int, int, int);" |
1460 | | |
1461 | 1.48k | "uint atomicLoad(coherent volatile nontemporal in uint, int, int, int);" |
1462 | 1.48k | " int atomicLoad(coherent volatile nontemporal in int, int, int, int);" |
1463 | | |
1464 | 1.48k | "void atomicStore(coherent volatile nontemporal out uint, uint, int, int, int);" |
1465 | 1.48k | "void atomicStore(coherent volatile nontemporal out int, int, int, int, int);" |
1466 | | |
1467 | 1.48k | "\n"); |
1468 | 1.48k | } |
1469 | | |
1470 | 4.34k | if (profile != EEsProfile && version >= 440) { |
1471 | 951 | commonBuiltins.append( |
1472 | 951 | "uint64_t atomicMin(coherent volatile nontemporal inout uint64_t, uint64_t);" |
1473 | 951 | " int64_t atomicMin(coherent volatile nontemporal inout int64_t, int64_t);" |
1474 | 951 | "uint64_t atomicMin(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" |
1475 | 951 | " int64_t atomicMin(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" |
1476 | 951 | "float16_t atomicMin(coherent volatile nontemporal inout float16_t, float16_t);" |
1477 | 951 | "float16_t atomicMin(coherent volatile nontemporal inout float16_t, float16_t, int, int, int);" |
1478 | 951 | " float atomicMin(coherent volatile nontemporal inout float, float);" |
1479 | 951 | " float atomicMin(coherent volatile nontemporal inout float, float, int, int, int);" |
1480 | 951 | " double atomicMin(coherent volatile nontemporal inout double, double);" |
1481 | 951 | " double atomicMin(coherent volatile nontemporal inout double, double, int, int, int);" |
1482 | | |
1483 | 951 | "uint64_t atomicMax(coherent volatile nontemporal inout uint64_t, uint64_t);" |
1484 | 951 | " int64_t atomicMax(coherent volatile nontemporal inout int64_t, int64_t);" |
1485 | 951 | "uint64_t atomicMax(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" |
1486 | 951 | " int64_t atomicMax(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" |
1487 | 951 | "float16_t atomicMax(coherent volatile nontemporal inout float16_t, float16_t);" |
1488 | 951 | "float16_t atomicMax(coherent volatile nontemporal inout float16_t, float16_t, int, int, int);" |
1489 | 951 | " float atomicMax(coherent volatile nontemporal inout float, float);" |
1490 | 951 | " float atomicMax(coherent volatile nontemporal inout float, float, int, int, int);" |
1491 | 951 | " double atomicMax(coherent volatile nontemporal inout double, double);" |
1492 | 951 | " double atomicMax(coherent volatile nontemporal inout double, double, int, int, int);" |
1493 | | |
1494 | 951 | "uint64_t atomicAnd(coherent volatile nontemporal inout uint64_t, uint64_t);" |
1495 | 951 | " int64_t atomicAnd(coherent volatile nontemporal inout int64_t, int64_t);" |
1496 | 951 | "uint64_t atomicAnd(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" |
1497 | 951 | " int64_t atomicAnd(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" |
1498 | | |
1499 | 951 | "uint64_t atomicOr (coherent volatile nontemporal inout uint64_t, uint64_t);" |
1500 | 951 | " int64_t atomicOr (coherent volatile nontemporal inout int64_t, int64_t);" |
1501 | 951 | "uint64_t atomicOr (coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" |
1502 | 951 | " int64_t atomicOr (coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" |
1503 | | |
1504 | 951 | "uint64_t atomicXor(coherent volatile nontemporal inout uint64_t, uint64_t);" |
1505 | 951 | " int64_t atomicXor(coherent volatile nontemporal inout int64_t, int64_t);" |
1506 | 951 | "uint64_t atomicXor(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" |
1507 | 951 | " int64_t atomicXor(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" |
1508 | | |
1509 | 951 | "uint64_t atomicAdd(coherent volatile nontemporal inout uint64_t, uint64_t);" |
1510 | 951 | " int64_t atomicAdd(coherent volatile nontemporal inout int64_t, int64_t);" |
1511 | 951 | "uint64_t atomicAdd(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" |
1512 | 951 | " int64_t atomicAdd(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" |
1513 | 951 | "float16_t atomicAdd(coherent volatile nontemporal inout float16_t, float16_t);" |
1514 | 951 | "float16_t atomicAdd(coherent volatile nontemporal inout float16_t, float16_t, int, int, int);" |
1515 | 951 | " float atomicAdd(coherent volatile nontemporal inout float, float);" |
1516 | 951 | " float atomicAdd(coherent volatile nontemporal inout float, float, int, int, int);" |
1517 | 951 | " double atomicAdd(coherent volatile nontemporal inout double, double);" |
1518 | 951 | " double atomicAdd(coherent volatile nontemporal inout double, double, int, int, int);" |
1519 | | |
1520 | 951 | "uint64_t atomicExchange(coherent volatile nontemporal inout uint64_t, uint64_t);" |
1521 | 951 | " int64_t atomicExchange(coherent volatile nontemporal inout int64_t, int64_t);" |
1522 | 951 | "uint64_t atomicExchange(coherent volatile nontemporal inout uint64_t, uint64_t, int, int, int);" |
1523 | 951 | " int64_t atomicExchange(coherent volatile nontemporal inout int64_t, int64_t, int, int, int);" |
1524 | 951 | "float16_t atomicExchange(coherent volatile nontemporal inout float16_t, float16_t);" |
1525 | 951 | "float16_t atomicExchange(coherent volatile nontemporal inout float16_t, float16_t, int, int, int);" |
1526 | 951 | " float atomicExchange(coherent volatile nontemporal inout float, float);" |
1527 | 951 | " float atomicExchange(coherent volatile nontemporal inout float, float, int, int, int);" |
1528 | 951 | " double atomicExchange(coherent volatile nontemporal inout double, double);" |
1529 | 951 | " double atomicExchange(coherent volatile nontemporal inout double, double, int, int, int);" |
1530 | | |
1531 | 951 | "uint64_t atomicCompSwap(coherent volatile nontemporal inout uint64_t, uint64_t, uint64_t);" |
1532 | 951 | " int64_t atomicCompSwap(coherent volatile nontemporal inout int64_t, int64_t, int64_t);" |
1533 | 951 | "uint64_t atomicCompSwap(coherent volatile nontemporal inout uint64_t, uint64_t, uint64_t, int, int, int, int, int);" |
1534 | 951 | " int64_t atomicCompSwap(coherent volatile nontemporal inout int64_t, int64_t, int64_t, int, int, int, int, int);" |
1535 | | |
1536 | 951 | "uint64_t atomicLoad(coherent volatile nontemporal in uint64_t, int, int, int);" |
1537 | 951 | " int64_t atomicLoad(coherent volatile nontemporal in int64_t, int, int, int);" |
1538 | 951 | "float16_t atomicLoad(coherent volatile nontemporal in float16_t, int, int, int);" |
1539 | 951 | " float atomicLoad(coherent volatile nontemporal in float, int, int, int);" |
1540 | 951 | " double atomicLoad(coherent volatile nontemporal in double, int, int, int);" |
1541 | | |
1542 | 951 | "void atomicStore(coherent volatile nontemporal out uint64_t, uint64_t, int, int, int);" |
1543 | 951 | "void atomicStore(coherent volatile nontemporal out int64_t, int64_t, int, int, int);" |
1544 | 951 | "void atomicStore(coherent volatile nontemporal out float16_t, float16_t, int, int, int);" |
1545 | 951 | "void atomicStore(coherent volatile nontemporal out float, float, int, int, int);" |
1546 | 951 | "void atomicStore(coherent volatile nontemporal out double, double, int, int, int);" |
1547 | 951 | "\n"); |
1548 | 951 | } |
1549 | | |
1550 | | // NV_shader_atomic_fp16_vector |
1551 | 4.34k | if (profile != EEsProfile && version >= 430) { |
1552 | 1.22k | commonBuiltins.append( |
1553 | 1.22k | "f16vec2 atomicAdd(coherent volatile nontemporal inout f16vec2, f16vec2);" |
1554 | 1.22k | "f16vec4 atomicAdd(coherent volatile nontemporal inout f16vec4, f16vec4);" |
1555 | 1.22k | "f16vec2 atomicMin(coherent volatile nontemporal inout f16vec2, f16vec2);" |
1556 | 1.22k | "f16vec4 atomicMin(coherent volatile nontemporal inout f16vec4, f16vec4);" |
1557 | 1.22k | "f16vec2 atomicMax(coherent volatile nontemporal inout f16vec2, f16vec2);" |
1558 | 1.22k | "f16vec4 atomicMax(coherent volatile nontemporal inout f16vec4, f16vec4);" |
1559 | 1.22k | "f16vec2 atomicExchange(coherent volatile nontemporal inout f16vec2, f16vec2);" |
1560 | 1.22k | "f16vec4 atomicExchange(coherent volatile nontemporal inout f16vec4, f16vec4);" |
1561 | 1.22k | "\n"); |
1562 | 1.22k | } |
1563 | | |
1564 | 4.34k | if ((profile == EEsProfile && version >= 300) || |
1565 | 4.08k | (profile != EEsProfile && version >= 150)) { // GL_ARB_shader_bit_encoding |
1566 | 2.02k | commonBuiltins.append( |
1567 | 2.02k | "int floatBitsToInt(highp float value);" |
1568 | 2.02k | "ivec2 floatBitsToInt(highp vec2 value);" |
1569 | 2.02k | "ivec3 floatBitsToInt(highp vec3 value);" |
1570 | 2.02k | "ivec4 floatBitsToInt(highp vec4 value);" |
1571 | | |
1572 | 2.02k | "uint floatBitsToUint(highp float value);" |
1573 | 2.02k | "uvec2 floatBitsToUint(highp vec2 value);" |
1574 | 2.02k | "uvec3 floatBitsToUint(highp vec3 value);" |
1575 | 2.02k | "uvec4 floatBitsToUint(highp vec4 value);" |
1576 | | |
1577 | 2.02k | "float intBitsToFloat(highp int value);" |
1578 | 2.02k | "vec2 intBitsToFloat(highp ivec2 value);" |
1579 | 2.02k | "vec3 intBitsToFloat(highp ivec3 value);" |
1580 | 2.02k | "vec4 intBitsToFloat(highp ivec4 value);" |
1581 | | |
1582 | 2.02k | "float uintBitsToFloat(highp uint value);" |
1583 | 2.02k | "vec2 uintBitsToFloat(highp uvec2 value);" |
1584 | 2.02k | "vec3 uintBitsToFloat(highp uvec3 value);" |
1585 | 2.02k | "vec4 uintBitsToFloat(highp uvec4 value);" |
1586 | | |
1587 | 2.02k | "\n"); |
1588 | 2.02k | } |
1589 | | |
1590 | 4.34k | if ((profile != EEsProfile && version >= 150) || // GL_NV_gpu_shader5 |
1591 | 2.57k | (profile == EEsProfile && version >= 310)) { // GL_OES_gpu_shader5 |
1592 | | |
1593 | 2.02k | commonBuiltins.append( |
1594 | 2.02k | "float fma(float, float, float );" |
1595 | 2.02k | "vec2 fma(vec2, vec2, vec2 );" |
1596 | 2.02k | "vec3 fma(vec3, vec3, vec3 );" |
1597 | 2.02k | "vec4 fma(vec4, vec4, vec4 );" |
1598 | 2.02k | "\n"); |
1599 | 2.02k | } |
1600 | | |
1601 | 4.34k | if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64 |
1602 | 1.76k | commonBuiltins.append( |
1603 | 1.76k | "double fma(double, double, double);" |
1604 | 1.76k | "dvec2 fma(dvec2, dvec2, dvec2 );" |
1605 | 1.76k | "dvec3 fma(dvec3, dvec3, dvec3 );" |
1606 | 1.76k | "dvec4 fma(dvec4, dvec4, dvec4 );" |
1607 | 1.76k | "\n"); |
1608 | 1.76k | } |
1609 | | |
1610 | 4.34k | if (profile == EEsProfile && version >= 310) { // ARB_gpu_shader_fp64 |
1611 | 259 | commonBuiltins.append( |
1612 | 259 | "float64_t fma(float64_t, float64_t, float64_t);" |
1613 | 259 | "f64vec2 fma(f64vec2, f64vec2, f64vec2 );" |
1614 | 259 | "f64vec3 fma(f64vec3, f64vec3, f64vec3 );" |
1615 | 259 | "f64vec4 fma(f64vec4, f64vec4, f64vec4 );" |
1616 | 259 | "\n"); |
1617 | 259 | } |
1618 | | |
1619 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
1620 | 4.08k | (profile != EEsProfile && version >= 150)) { // GL_NV_gpu_shader5 |
1621 | 2.02k | commonBuiltins.append( |
1622 | 2.02k | "float frexp(highp float, out highp int);" |
1623 | 2.02k | "vec2 frexp(highp vec2, out highp ivec2);" |
1624 | 2.02k | "vec3 frexp(highp vec3, out highp ivec3);" |
1625 | 2.02k | "vec4 frexp(highp vec4, out highp ivec4);" |
1626 | | |
1627 | 2.02k | "float ldexp(highp float, highp int);" |
1628 | 2.02k | "vec2 ldexp(highp vec2, highp ivec2);" |
1629 | 2.02k | "vec3 ldexp(highp vec3, highp ivec3);" |
1630 | 2.02k | "vec4 ldexp(highp vec4, highp ivec4);" |
1631 | | |
1632 | 2.02k | "\n"); |
1633 | 2.02k | } |
1634 | | |
1635 | 4.34k | if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64 |
1636 | 1.76k | commonBuiltins.append( |
1637 | 1.76k | "double frexp(double, out int);" |
1638 | 1.76k | "dvec2 frexp( dvec2, out ivec2);" |
1639 | 1.76k | "dvec3 frexp( dvec3, out ivec3);" |
1640 | 1.76k | "dvec4 frexp( dvec4, out ivec4);" |
1641 | | |
1642 | 1.76k | "double ldexp(double, int);" |
1643 | 1.76k | "dvec2 ldexp( dvec2, ivec2);" |
1644 | 1.76k | "dvec3 ldexp( dvec3, ivec3);" |
1645 | 1.76k | "dvec4 ldexp( dvec4, ivec4);" |
1646 | | |
1647 | 1.76k | "double packDouble2x32(uvec2);" |
1648 | 1.76k | "uvec2 unpackDouble2x32(double);" |
1649 | | |
1650 | 1.76k | "\n"); |
1651 | 1.76k | } |
1652 | | |
1653 | 4.34k | if (profile == EEsProfile && version >= 310) { // ARB_gpu_shader_fp64 |
1654 | 259 | commonBuiltins.append( |
1655 | 259 | "float64_t frexp(float64_t, out int);" |
1656 | 259 | "f64vec2 frexp( f64vec2, out ivec2);" |
1657 | 259 | "f64vec3 frexp( f64vec3, out ivec3);" |
1658 | 259 | "f64vec4 frexp( f64vec4, out ivec4);" |
1659 | | |
1660 | 259 | "float64_t ldexp(float64_t, int);" |
1661 | 259 | "f64vec2 ldexp( f64vec2, ivec2);" |
1662 | 259 | "f64vec3 ldexp( f64vec3, ivec3);" |
1663 | 259 | "f64vec4 ldexp( f64vec4, ivec4);" |
1664 | | |
1665 | 259 | "\n"); |
1666 | 259 | } |
1667 | | |
1668 | 4.34k | if ((profile == EEsProfile && version >= 300) || |
1669 | 4.08k | (profile != EEsProfile && version >= 150)) { |
1670 | 2.02k | commonBuiltins.append( |
1671 | 2.02k | "highp uint packUnorm2x16(vec2);" |
1672 | 2.02k | "vec2 unpackUnorm2x16(highp uint);" |
1673 | 2.02k | "\n"); |
1674 | 2.02k | } |
1675 | | |
1676 | 4.34k | if ((profile == EEsProfile && version >= 300) || |
1677 | 4.08k | (profile != EEsProfile && version >= 150)) { |
1678 | 2.02k | commonBuiltins.append( |
1679 | 2.02k | "highp uint packSnorm2x16(vec2);" |
1680 | 2.02k | " vec2 unpackSnorm2x16(highp uint);" |
1681 | 2.02k | "highp uint packHalf2x16(vec2);" |
1682 | 2.02k | "\n"); |
1683 | 2.02k | } |
1684 | | |
1685 | 4.34k | if (profile == EEsProfile && version >= 300) { |
1686 | 259 | commonBuiltins.append( |
1687 | 259 | "mediump vec2 unpackHalf2x16(highp uint);" |
1688 | 259 | "\n"); |
1689 | 4.08k | } else if (profile != EEsProfile && version >= 150) { |
1690 | 1.76k | commonBuiltins.append( |
1691 | 1.76k | " vec2 unpackHalf2x16(highp uint);" |
1692 | 1.76k | "\n"); |
1693 | 1.76k | } |
1694 | | |
1695 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
1696 | 4.08k | (profile != EEsProfile && version >= 150)) { |
1697 | 2.02k | commonBuiltins.append( |
1698 | 2.02k | "highp uint packSnorm4x8(vec4);" |
1699 | 2.02k | "highp uint packUnorm4x8(vec4);" |
1700 | 2.02k | "\n"); |
1701 | 2.02k | } |
1702 | | |
1703 | 4.34k | if (profile == EEsProfile && version >= 310) { |
1704 | 259 | commonBuiltins.append( |
1705 | 259 | "mediump vec4 unpackSnorm4x8(highp uint);" |
1706 | 259 | "mediump vec4 unpackUnorm4x8(highp uint);" |
1707 | 259 | "\n"); |
1708 | 4.08k | } else if (profile != EEsProfile && version >= 150) { |
1709 | 1.76k | commonBuiltins.append( |
1710 | 1.76k | "vec4 unpackSnorm4x8(highp uint);" |
1711 | 1.76k | "vec4 unpackUnorm4x8(highp uint);" |
1712 | 1.76k | "\n"); |
1713 | 1.76k | } |
1714 | | |
1715 | | // |
1716 | | // Matrix Functions. |
1717 | | // |
1718 | 4.34k | commonBuiltins.append( |
1719 | 4.34k | "mat2 matrixCompMult(mat2 x, mat2 y);" |
1720 | 4.34k | "mat3 matrixCompMult(mat3 x, mat3 y);" |
1721 | 4.34k | "mat4 matrixCompMult(mat4 x, mat4 y);" |
1722 | | |
1723 | 4.34k | "\n"); |
1724 | | |
1725 | | // 120 is correct for both ES and desktop |
1726 | 4.34k | if (version >= 120) { |
1727 | 4.34k | commonBuiltins.append( |
1728 | 4.34k | "mat2 outerProduct(vec2 c, vec2 r);" |
1729 | 4.34k | "mat3 outerProduct(vec3 c, vec3 r);" |
1730 | 4.34k | "mat4 outerProduct(vec4 c, vec4 r);" |
1731 | 4.34k | "mat2x3 outerProduct(vec3 c, vec2 r);" |
1732 | 4.34k | "mat3x2 outerProduct(vec2 c, vec3 r);" |
1733 | 4.34k | "mat2x4 outerProduct(vec4 c, vec2 r);" |
1734 | 4.34k | "mat4x2 outerProduct(vec2 c, vec4 r);" |
1735 | 4.34k | "mat3x4 outerProduct(vec4 c, vec3 r);" |
1736 | 4.34k | "mat4x3 outerProduct(vec3 c, vec4 r);" |
1737 | | |
1738 | 4.34k | "mat2 transpose(mat2 m);" |
1739 | 4.34k | "mat3 transpose(mat3 m);" |
1740 | 4.34k | "mat4 transpose(mat4 m);" |
1741 | 4.34k | "mat2x3 transpose(mat3x2 m);" |
1742 | 4.34k | "mat3x2 transpose(mat2x3 m);" |
1743 | 4.34k | "mat2x4 transpose(mat4x2 m);" |
1744 | 4.34k | "mat4x2 transpose(mat2x4 m);" |
1745 | 4.34k | "mat3x4 transpose(mat4x3 m);" |
1746 | 4.34k | "mat4x3 transpose(mat3x4 m);" |
1747 | | |
1748 | 4.34k | "mat2x3 matrixCompMult(mat2x3, mat2x3);" |
1749 | 4.34k | "mat2x4 matrixCompMult(mat2x4, mat2x4);" |
1750 | 4.34k | "mat3x2 matrixCompMult(mat3x2, mat3x2);" |
1751 | 4.34k | "mat3x4 matrixCompMult(mat3x4, mat3x4);" |
1752 | 4.34k | "mat4x2 matrixCompMult(mat4x2, mat4x2);" |
1753 | 4.34k | "mat4x3 matrixCompMult(mat4x3, mat4x3);" |
1754 | | |
1755 | 4.34k | "\n"); |
1756 | | |
1757 | | // 150 is correct for both ES and desktop |
1758 | 4.34k | if (version >= 150) { |
1759 | 2.02k | commonBuiltins.append( |
1760 | 2.02k | "float determinant(mat2 m);" |
1761 | 2.02k | "float determinant(mat3 m);" |
1762 | 2.02k | "float determinant(mat4 m);" |
1763 | | |
1764 | 2.02k | "mat2 inverse(mat2 m);" |
1765 | 2.02k | "mat3 inverse(mat3 m);" |
1766 | 2.02k | "mat4 inverse(mat4 m);" |
1767 | | |
1768 | 2.02k | "\n"); |
1769 | 2.02k | } |
1770 | 4.34k | } |
1771 | | |
1772 | | // |
1773 | | // Original-style texture functions existing in all stages. |
1774 | | // (Per-stage functions below.) |
1775 | | // |
1776 | 4.34k | if ((profile == EEsProfile && version == 100) || |
1777 | 4.34k | profile == ECompatibilityProfile || |
1778 | 4.32k | (profile == ECoreProfile && version < 420) || |
1779 | 3.80k | profile == ENoProfile) { |
1780 | 2.84k | if (spvVersion.spv == 0) { |
1781 | 0 | commonBuiltins.append( |
1782 | 0 | "vec4 texture2D(sampler2D, vec2);" |
1783 | |
|
1784 | 0 | "vec4 texture2DProj(sampler2D, vec3);" |
1785 | 0 | "vec4 texture2DProj(sampler2D, vec4);" |
1786 | |
|
1787 | 0 | "vec4 texture3D(sampler3D, vec3);" // OES_texture_3D, but caught by keyword check |
1788 | 0 | "vec4 texture3DProj(sampler3D, vec4);" // OES_texture_3D, but caught by keyword check |
1789 | |
|
1790 | 0 | "vec4 textureCube(samplerCube, vec3);" |
1791 | |
|
1792 | 0 | "\n"); |
1793 | 0 | } |
1794 | 2.84k | } |
1795 | | |
1796 | 4.34k | if ( profile == ECompatibilityProfile || |
1797 | 4.32k | (profile == ECoreProfile && version < 420) || |
1798 | 3.80k | profile == ENoProfile) { |
1799 | 2.84k | if (spvVersion.spv == 0) { |
1800 | 0 | commonBuiltins.append( |
1801 | 0 | "vec4 texture1D(sampler1D, float);" |
1802 | |
|
1803 | 0 | "vec4 texture1DProj(sampler1D, vec2);" |
1804 | 0 | "vec4 texture1DProj(sampler1D, vec4);" |
1805 | |
|
1806 | 0 | "vec4 shadow1D(sampler1DShadow, vec3);" |
1807 | 0 | "vec4 shadow2D(sampler2DShadow, vec3);" |
1808 | 0 | "vec4 shadow1DProj(sampler1DShadow, vec4);" |
1809 | 0 | "vec4 shadow2DProj(sampler2DShadow, vec4);" |
1810 | |
|
1811 | 0 | "vec4 texture2DRect(sampler2DRect, vec2);" // GL_ARB_texture_rectangle, caught by keyword check |
1812 | 0 | "vec4 texture2DRectProj(sampler2DRect, vec3);" // GL_ARB_texture_rectangle, caught by keyword check |
1813 | 0 | "vec4 texture2DRectProj(sampler2DRect, vec4);" // GL_ARB_texture_rectangle, caught by keyword check |
1814 | 0 | "vec4 shadow2DRect(sampler2DRectShadow, vec3);" // GL_ARB_texture_rectangle, caught by keyword check |
1815 | 0 | "vec4 shadow2DRectProj(sampler2DRectShadow, vec4);" // GL_ARB_texture_rectangle, caught by keyword check |
1816 | |
|
1817 | 0 | "vec4 texture1DArray(sampler1DArray, vec2);" // GL_EXT_texture_array |
1818 | 0 | "vec4 texture2DArray(sampler2DArray, vec3);" // GL_EXT_texture_array |
1819 | 0 | "vec4 shadow1DArray(sampler1DArrayShadow, vec3);" // GL_EXT_texture_array |
1820 | 0 | "vec4 shadow2DArray(sampler2DArrayShadow, vec4);" // GL_EXT_texture_array |
1821 | 0 | "vec4 texture1DArray(sampler1DArray, vec2, float);" // GL_EXT_texture_array |
1822 | 0 | "vec4 texture2DArray(sampler2DArray, vec3, float);" // GL_EXT_texture_array |
1823 | 0 | "vec4 shadow1DArray(sampler1DArrayShadow, vec3, float);" // GL_EXT_texture_array |
1824 | 0 | "vec4 texture1DArrayLod(sampler1DArray, vec2, float);" // GL_EXT_texture_array |
1825 | 0 | "vec4 texture2DArrayLod(sampler2DArray, vec3, float);" // GL_EXT_texture_array |
1826 | 0 | "vec4 shadow1DArrayLod(sampler1DArrayShadow, vec3, float);" // GL_EXT_texture_array |
1827 | 0 | "\n"); |
1828 | 0 | } |
1829 | 2.84k | } |
1830 | | |
1831 | 4.34k | if (profile == EEsProfile) { |
1832 | 259 | if (spvVersion.spv == 0) { |
1833 | 0 | if (version < 300) { |
1834 | 0 | commonBuiltins.append( |
1835 | 0 | "vec4 texture2D(samplerExternalOES, vec2 coord);" // GL_OES_EGL_image_external |
1836 | 0 | "vec4 texture2DProj(samplerExternalOES, vec3);" // GL_OES_EGL_image_external |
1837 | 0 | "vec4 texture2DProj(samplerExternalOES, vec4);" // GL_OES_EGL_image_external |
1838 | 0 | "\n"); |
1839 | 0 | } else { |
1840 | 0 | commonBuiltins.append( |
1841 | 0 | "highp ivec2 textureSize(samplerExternalOES, int lod);" // GL_OES_EGL_image_external_essl3 |
1842 | 0 | "vec4 texture(samplerExternalOES, vec2);" // GL_OES_EGL_image_external_essl3 |
1843 | 0 | "vec4 texture(samplerExternalOES, vec2, float bias);" // GL_OES_EGL_image_external_essl3 |
1844 | 0 | "vec4 textureProj(samplerExternalOES, vec3);" // GL_OES_EGL_image_external_essl3 |
1845 | 0 | "vec4 textureProj(samplerExternalOES, vec3, float bias);" // GL_OES_EGL_image_external_essl3 |
1846 | 0 | "vec4 textureProj(samplerExternalOES, vec4);" // GL_OES_EGL_image_external_essl3 |
1847 | 0 | "vec4 textureProj(samplerExternalOES, vec4, float bias);" // GL_OES_EGL_image_external_essl3 |
1848 | 0 | "vec4 texelFetch(samplerExternalOES, ivec2, int lod);" // GL_OES_EGL_image_external_essl3 |
1849 | 0 | "\n"); |
1850 | 0 | } |
1851 | 0 | commonBuiltins.append( |
1852 | 0 | "highp ivec2 textureSize(__samplerExternal2DY2YEXT, int lod);" // GL_EXT_YUV_target |
1853 | 0 | "vec4 texture(__samplerExternal2DY2YEXT, vec2);" // GL_EXT_YUV_target |
1854 | 0 | "vec4 texture(__samplerExternal2DY2YEXT, vec2, float bias);" // GL_EXT_YUV_target |
1855 | 0 | "vec4 textureProj(__samplerExternal2DY2YEXT, vec3);" // GL_EXT_YUV_target |
1856 | 0 | "vec4 textureProj(__samplerExternal2DY2YEXT, vec3, float bias);" // GL_EXT_YUV_target |
1857 | 0 | "vec4 textureProj(__samplerExternal2DY2YEXT, vec4);" // GL_EXT_YUV_target |
1858 | 0 | "vec4 textureProj(__samplerExternal2DY2YEXT, vec4, float bias);" // GL_EXT_YUV_target |
1859 | 0 | "vec4 texelFetch(__samplerExternal2DY2YEXT sampler, ivec2, int lod);" // GL_EXT_YUV_target |
1860 | 0 | "\n"); |
1861 | 0 | commonBuiltins.append( |
1862 | 0 | "vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);" // GL_EXT_shader_texture_lod |
1863 | 0 | "vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);" // GL_EXT_shader_texture_lod |
1864 | 0 | "vec4 texture2DProjGradEXT(sampler2D, vec4, vec2, vec2);" // GL_EXT_shader_texture_lod |
1865 | 0 | "vec4 textureCubeGradEXT(samplerCube, vec3, vec3, vec3);" // GL_EXT_shader_texture_lod |
1866 | |
|
1867 | 0 | "float shadow2DEXT(sampler2DShadow, vec3);" // GL_EXT_shadow_samplers |
1868 | 0 | "float shadow2DProjEXT(sampler2DShadow, vec4);" // GL_EXT_shadow_samplers |
1869 | |
|
1870 | 0 | "\n"); |
1871 | 0 | } |
1872 | 259 | } |
1873 | | |
1874 | | // |
1875 | | // Noise functions. |
1876 | | // |
1877 | 4.34k | if (spvVersion.spv == 0 && profile != EEsProfile) { |
1878 | 0 | commonBuiltins.append( |
1879 | 0 | "float noise1(float x);" |
1880 | 0 | "float noise1(vec2 x);" |
1881 | 0 | "float noise1(vec3 x);" |
1882 | 0 | "float noise1(vec4 x);" |
1883 | |
|
1884 | 0 | "vec2 noise2(float x);" |
1885 | 0 | "vec2 noise2(vec2 x);" |
1886 | 0 | "vec2 noise2(vec3 x);" |
1887 | 0 | "vec2 noise2(vec4 x);" |
1888 | |
|
1889 | 0 | "vec3 noise3(float x);" |
1890 | 0 | "vec3 noise3(vec2 x);" |
1891 | 0 | "vec3 noise3(vec3 x);" |
1892 | 0 | "vec3 noise3(vec4 x);" |
1893 | |
|
1894 | 0 | "vec4 noise4(float x);" |
1895 | 0 | "vec4 noise4(vec2 x);" |
1896 | 0 | "vec4 noise4(vec3 x);" |
1897 | 0 | "vec4 noise4(vec4 x);" |
1898 | |
|
1899 | 0 | "\n"); |
1900 | 0 | } |
1901 | | |
1902 | 4.34k | if (spvVersion.vulkan == 0) { |
1903 | | // |
1904 | | // Atomic counter functions. |
1905 | | // |
1906 | 0 | if ((profile != EEsProfile && version >= 300) || |
1907 | 0 | (profile == EEsProfile && version >= 310)) { |
1908 | 0 | commonBuiltins.append( |
1909 | 0 | "uint atomicCounterIncrement(atomic_uint);" |
1910 | 0 | "uint atomicCounterDecrement(atomic_uint);" |
1911 | 0 | "uint atomicCounter(atomic_uint);" |
1912 | |
|
1913 | 0 | "\n"); |
1914 | 0 | } |
1915 | 0 | if (profile != EEsProfile && version == 450) { |
1916 | 0 | commonBuiltins.append( |
1917 | 0 | "uint atomicCounterAddARB(atomic_uint, uint);" |
1918 | 0 | "uint atomicCounterSubtractARB(atomic_uint, uint);" |
1919 | 0 | "uint atomicCounterMinARB(atomic_uint, uint);" |
1920 | 0 | "uint atomicCounterMaxARB(atomic_uint, uint);" |
1921 | 0 | "uint atomicCounterAndARB(atomic_uint, uint);" |
1922 | 0 | "uint atomicCounterOrARB(atomic_uint, uint);" |
1923 | 0 | "uint atomicCounterXorARB(atomic_uint, uint);" |
1924 | 0 | "uint atomicCounterExchangeARB(atomic_uint, uint);" |
1925 | 0 | "uint atomicCounterCompSwapARB(atomic_uint, uint, uint);" |
1926 | |
|
1927 | 0 | "\n"); |
1928 | 0 | } |
1929 | | |
1930 | |
|
1931 | 0 | if (profile != EEsProfile && version >= 460) { |
1932 | 0 | commonBuiltins.append( |
1933 | 0 | "uint atomicCounterAdd(atomic_uint, uint);" |
1934 | 0 | "uint atomicCounterSubtract(atomic_uint, uint);" |
1935 | 0 | "uint atomicCounterMin(atomic_uint, uint);" |
1936 | 0 | "uint atomicCounterMax(atomic_uint, uint);" |
1937 | 0 | "uint atomicCounterAnd(atomic_uint, uint);" |
1938 | 0 | "uint atomicCounterOr(atomic_uint, uint);" |
1939 | 0 | "uint atomicCounterXor(atomic_uint, uint);" |
1940 | 0 | "uint atomicCounterExchange(atomic_uint, uint);" |
1941 | 0 | "uint atomicCounterCompSwap(atomic_uint, uint, uint);" |
1942 | |
|
1943 | 0 | "\n"); |
1944 | 0 | } |
1945 | 0 | } |
1946 | 4.34k | else if (spvVersion.vulkanRelaxed) { |
1947 | | // |
1948 | | // Atomic counter functions act as aliases to normal atomic functions. |
1949 | | // replace definitions to take 'volatile coherent nontemporal uint' instead of 'atomic_uint' |
1950 | | // and map to equivalent non-counter atomic op |
1951 | | // |
1952 | 0 | if ((profile != EEsProfile && version >= 300) || |
1953 | 0 | (profile == EEsProfile && version >= 310)) { |
1954 | 0 | commonBuiltins.append( |
1955 | 0 | "uint atomicCounterIncrement(volatile coherent nontemporal uint);" |
1956 | 0 | "uint atomicCounterDecrement(volatile coherent nontemporal uint);" |
1957 | 0 | "uint atomicCounter(volatile coherent nontemporal uint);" |
1958 | |
|
1959 | 0 | "\n"); |
1960 | 0 | } |
1961 | 0 | if (profile != EEsProfile && version >= 460) { |
1962 | 0 | commonBuiltins.append( |
1963 | 0 | "uint atomicCounterAdd(volatile coherent nontemporal uint, uint);" |
1964 | 0 | "uint atomicCounterSubtract(volatile coherent nontemporal uint, uint);" |
1965 | 0 | "uint atomicCounterMin(volatile coherent nontemporal uint, uint);" |
1966 | 0 | "uint atomicCounterMax(volatile coherent nontemporal uint, uint);" |
1967 | 0 | "uint atomicCounterAnd(volatile coherent nontemporal uint, uint);" |
1968 | 0 | "uint atomicCounterOr(volatile coherent nontemporal uint, uint);" |
1969 | 0 | "uint atomicCounterXor(volatile coherent nontemporal uint, uint);" |
1970 | 0 | "uint atomicCounterExchange(volatile coherent nontemporal uint, uint);" |
1971 | 0 | "uint atomicCounterCompSwap(volatile coherent nontemporal uint, uint, uint);" |
1972 | |
|
1973 | 0 | "\n"); |
1974 | 0 | } |
1975 | 0 | } |
1976 | | |
1977 | | // Bitfield |
1978 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
1979 | 4.08k | (profile != EEsProfile && version >= 150)) { // ARB_gpu_shader5/NV_gpu_shader5 |
1980 | 2.02k | commonBuiltins.append( |
1981 | 2.02k | " int bitfieldExtract( int, int, int);" |
1982 | 2.02k | "ivec2 bitfieldExtract(ivec2, int, int);" |
1983 | 2.02k | "ivec3 bitfieldExtract(ivec3, int, int);" |
1984 | 2.02k | "ivec4 bitfieldExtract(ivec4, int, int);" |
1985 | | |
1986 | 2.02k | " uint bitfieldExtract( uint, int, int);" |
1987 | 2.02k | "uvec2 bitfieldExtract(uvec2, int, int);" |
1988 | 2.02k | "uvec3 bitfieldExtract(uvec3, int, int);" |
1989 | 2.02k | "uvec4 bitfieldExtract(uvec4, int, int);" |
1990 | | |
1991 | 2.02k | " int bitfieldInsert( int base, int, int, int);" |
1992 | 2.02k | "ivec2 bitfieldInsert(ivec2 base, ivec2, int, int);" |
1993 | 2.02k | "ivec3 bitfieldInsert(ivec3 base, ivec3, int, int);" |
1994 | 2.02k | "ivec4 bitfieldInsert(ivec4 base, ivec4, int, int);" |
1995 | | |
1996 | 2.02k | " uint bitfieldInsert( uint base, uint, int, int);" |
1997 | 2.02k | "uvec2 bitfieldInsert(uvec2 base, uvec2, int, int);" |
1998 | 2.02k | "uvec3 bitfieldInsert(uvec3 base, uvec3, int, int);" |
1999 | 2.02k | "uvec4 bitfieldInsert(uvec4 base, uvec4, int, int);" |
2000 | | |
2001 | 2.02k | "\n"); |
2002 | 2.02k | } |
2003 | | |
2004 | 4.34k | if (profile != EEsProfile && version >= 150) { //GL_ARB_gpu_shader5/GL_NV_gpu_shader5 |
2005 | 1.76k | commonBuiltins.append( |
2006 | 1.76k | " int findLSB( int);" |
2007 | 1.76k | "ivec2 findLSB(ivec2);" |
2008 | 1.76k | "ivec3 findLSB(ivec3);" |
2009 | 1.76k | "ivec4 findLSB(ivec4);" |
2010 | | |
2011 | 1.76k | " int findLSB( uint);" |
2012 | 1.76k | "ivec2 findLSB(uvec2);" |
2013 | 1.76k | "ivec3 findLSB(uvec3);" |
2014 | 1.76k | "ivec4 findLSB(uvec4);" |
2015 | | |
2016 | 1.76k | "\n"); |
2017 | 2.57k | } else if (profile == EEsProfile && version >= 310) { |
2018 | 259 | commonBuiltins.append( |
2019 | 259 | "lowp int findLSB( int);" |
2020 | 259 | "lowp ivec2 findLSB(ivec2);" |
2021 | 259 | "lowp ivec3 findLSB(ivec3);" |
2022 | 259 | "lowp ivec4 findLSB(ivec4);" |
2023 | | |
2024 | 259 | "lowp int findLSB( uint);" |
2025 | 259 | "lowp ivec2 findLSB(uvec2);" |
2026 | 259 | "lowp ivec3 findLSB(uvec3);" |
2027 | 259 | "lowp ivec4 findLSB(uvec4);" |
2028 | | |
2029 | 259 | "\n"); |
2030 | 259 | } |
2031 | | |
2032 | 4.34k | if (profile != EEsProfile && version >= 150) { //GL_ARB_gpu_shader5/GL_NV_gpu_shader5 |
2033 | 1.76k | commonBuiltins.append( |
2034 | 1.76k | " int bitCount( int);" |
2035 | 1.76k | "ivec2 bitCount(ivec2);" |
2036 | 1.76k | "ivec3 bitCount(ivec3);" |
2037 | 1.76k | "ivec4 bitCount(ivec4);" |
2038 | | |
2039 | 1.76k | " int bitCount( uint);" |
2040 | 1.76k | "ivec2 bitCount(uvec2);" |
2041 | 1.76k | "ivec3 bitCount(uvec3);" |
2042 | 1.76k | "ivec4 bitCount(uvec4);" |
2043 | | |
2044 | 1.76k | " int findMSB(highp int);" |
2045 | 1.76k | "ivec2 findMSB(highp ivec2);" |
2046 | 1.76k | "ivec3 findMSB(highp ivec3);" |
2047 | 1.76k | "ivec4 findMSB(highp ivec4);" |
2048 | | |
2049 | 1.76k | " int findMSB(highp uint);" |
2050 | 1.76k | "ivec2 findMSB(highp uvec2);" |
2051 | 1.76k | "ivec3 findMSB(highp uvec3);" |
2052 | 1.76k | "ivec4 findMSB(highp uvec4);" |
2053 | 1.76k | "\n"); |
2054 | 1.76k | } |
2055 | | |
2056 | 4.34k | if (profile != EEsProfile && version >= 150 && version < 450) { //GL_NV_gpu_shader5 |
2057 | 886 | commonBuiltins.append( |
2058 | 886 | "int64_t packInt2x32(ivec2);" |
2059 | 886 | "uint64_t packUint2x32(uvec2);" |
2060 | 886 | "ivec2 unpackInt2x32(int64_t);" |
2061 | 886 | "uvec2 unpackUint2x32(uint64_t);" |
2062 | | |
2063 | 886 | "uint packFloat2x16(f16vec2);" |
2064 | 886 | "f16vec2 unpackFloat2x16(uint);" |
2065 | | |
2066 | 886 | "int64_t doubleBitsToInt64(double);" |
2067 | 886 | "i64vec2 doubleBitsToInt64(dvec2);" |
2068 | 886 | "i64vec3 doubleBitsToInt64(dvec3);" |
2069 | 886 | "i64vec4 doubleBitsToInt64(dvec4);" |
2070 | | |
2071 | 886 | "uint64_t doubleBitsToUint64(double);" |
2072 | 886 | "u64vec2 doubleBitsToUint64(dvec2);" |
2073 | 886 | "u64vec3 doubleBitsToUint64(dvec3);" |
2074 | 886 | "u64vec4 doubleBitsToUint64(dvec4);" |
2075 | | |
2076 | 886 | "double int64BitsToDouble(int64_t);" |
2077 | 886 | "dvec2 int64BitsToDouble(i64vec2);" |
2078 | 886 | "dvec3 int64BitsToDouble(i64vec3);" |
2079 | 886 | "dvec4 int64BitsToDouble(i64vec4);" |
2080 | | |
2081 | 886 | "double uint64BitsToDouble(uint64_t);" |
2082 | 886 | "dvec2 uint64BitsToDouble(u64vec2);" |
2083 | 886 | "dvec3 uint64BitsToDouble(u64vec3);" |
2084 | 886 | "dvec4 uint64BitsToDouble(u64vec4);" |
2085 | | // Modifications to Vector Relational Functions |
2086 | | // Introduction of explicitly sized types |
2087 | 886 | "bvec2 lessThan(i64vec2, i64vec2);" |
2088 | 886 | "bvec3 lessThan(i64vec3, i64vec3);" |
2089 | 886 | "bvec4 lessThan(i64vec4, i64vec4);" |
2090 | 886 | "bvec2 lessThan(u64vec2, u64vec2);" |
2091 | 886 | "bvec3 lessThan(u64vec3, u64vec3);" |
2092 | 886 | "bvec4 lessThan(u64vec4, u64vec4);" |
2093 | | |
2094 | 886 | "bvec2 lessThanEqual(i64vec2, i64vec2);" |
2095 | 886 | "bvec3 lessThanEqual(i64vec3, i64vec3);" |
2096 | 886 | "bvec4 lessThanEqual(i64vec4, i64vec4);" |
2097 | 886 | "bvec2 lessThanEqual(u64vec2, u64vec2);" |
2098 | 886 | "bvec3 lessThanEqual(u64vec3, u64vec3);" |
2099 | 886 | "bvec4 lessThanEqual(u64vec4, u64vec4);" |
2100 | | |
2101 | 886 | "bvec2 greaterThan(i64vec2, i64vec2);" |
2102 | 886 | "bvec3 greaterThan(i64vec3, i64vec3);" |
2103 | 886 | "bvec4 greaterThan(i64vec4, i64vec4);" |
2104 | 886 | "bvec2 greaterThan(u64vec2, u64vec2);" |
2105 | 886 | "bvec3 greaterThan(u64vec3, u64vec3);" |
2106 | 886 | "bvec4 greaterThan(u64vec4, u64vec4);" |
2107 | | |
2108 | 886 | "bvec2 greaterThanEqual(i64vec2, i64vec2);" |
2109 | 886 | "bvec3 greaterThanEqual(i64vec3, i64vec3);" |
2110 | 886 | "bvec4 greaterThanEqual(i64vec4, i64vec4);" |
2111 | 886 | "bvec2 greaterThanEqual(u64vec2, u64vec2);" |
2112 | 886 | "bvec3 greaterThanEqual(u64vec3, u64vec3);" |
2113 | 886 | "bvec4 greaterThanEqual(u64vec4, u64vec4);" |
2114 | | |
2115 | 886 | "bvec2 equal(i64vec2, i64vec2);" |
2116 | 886 | "bvec3 equal(i64vec3, i64vec3);" |
2117 | 886 | "bvec4 equal(i64vec4, i64vec4);" |
2118 | 886 | "bvec2 equal(u64vec2, u64vec2);" |
2119 | 886 | "bvec3 equal(u64vec3, u64vec3);" |
2120 | 886 | "bvec4 equal(u64vec4, u64vec4);" |
2121 | | |
2122 | 886 | "bvec2 notEqual(i64vec2, i64vec2);" |
2123 | 886 | "bvec3 notEqual(i64vec3, i64vec3);" |
2124 | 886 | "bvec4 notEqual(i64vec4, i64vec4);" |
2125 | 886 | "bvec2 notEqual(u64vec2, u64vec2);" |
2126 | 886 | "bvec3 notEqual(u64vec3, u64vec3);" |
2127 | 886 | "bvec4 notEqual(u64vec4, u64vec4);" |
2128 | | |
2129 | 886 | "bvec2 lessThan(f16vec2, f16vec2);" |
2130 | 886 | "bvec3 lessThan(f16vec3, f16vec3);" |
2131 | 886 | "bvec4 lessThan(f16vec4, f16vec4);" |
2132 | | |
2133 | 886 | "bvec2 lessThanEqual(f16vec2, f16vec2);" |
2134 | 886 | "bvec3 lessThanEqual(f16vec3, f16vec3);" |
2135 | 886 | "bvec4 lessThanEqual(f16vec4, f16vec4);" |
2136 | | |
2137 | 886 | "bvec2 greaterThan(f16vec2, f16vec2);" |
2138 | 886 | "bvec3 greaterThan(f16vec3, f16vec3);" |
2139 | 886 | "bvec4 greaterThan(f16vec4, f16vec4);" |
2140 | | |
2141 | 886 | "bvec2 greaterThanEqual(f16vec2, f16vec2);" |
2142 | 886 | "bvec3 greaterThanEqual(f16vec3, f16vec3);" |
2143 | 886 | "bvec4 greaterThanEqual(f16vec4, f16vec4);" |
2144 | | |
2145 | 886 | "bvec2 equal(f16vec2, f16vec2);" |
2146 | 886 | "bvec3 equal(f16vec3, f16vec3);" |
2147 | 886 | "bvec4 equal(f16vec4, f16vec4);" |
2148 | | |
2149 | 886 | "bvec2 notEqual(f16vec2, f16vec2);" |
2150 | 886 | "bvec3 notEqual(f16vec3, f16vec3);" |
2151 | 886 | "bvec4 notEqual(f16vec4, f16vec4);" |
2152 | | |
2153 | | // Dependency on GL_ARB_gpu_shader_fp64 |
2154 | 886 | "bvec2 lessThan(dvec2, dvec2);" |
2155 | 886 | "bvec3 lessThan(dvec3, dvec3);" |
2156 | 886 | "bvec4 lessThan(dvec4, dvec4);" |
2157 | | |
2158 | 886 | "bvec2 lessThanEqual(dvec2, dvec2);" |
2159 | 886 | "bvec3 lessThanEqual(dvec3, dvec3);" |
2160 | 886 | "bvec4 lessThanEqual(dvec4, dvec4);" |
2161 | | |
2162 | 886 | "bvec2 greaterThan(dvec2, dvec2);" |
2163 | 886 | "bvec3 greaterThan(dvec3, dvec3);" |
2164 | 886 | "bvec4 greaterThan(dvec4, dvec4);" |
2165 | | |
2166 | 886 | "bvec2 greaterThanEqual(dvec2, dvec2);" |
2167 | 886 | "bvec3 greaterThanEqual(dvec3, dvec3);" |
2168 | 886 | "bvec4 greaterThanEqual(dvec4, dvec4);" |
2169 | | |
2170 | 886 | "bvec2 equal(dvec2, dvec2);" |
2171 | 886 | "bvec3 equal(dvec3, dvec3);" |
2172 | 886 | "bvec4 equal(dvec4, dvec4);" |
2173 | | |
2174 | 886 | "bvec2 notEqual(dvec2, dvec2);" |
2175 | 886 | "bvec3 notEqual(dvec3, dvec3);" |
2176 | 886 | "bvec4 notEqual(dvec4, dvec4);" |
2177 | | |
2178 | 886 | "\n"); |
2179 | 886 | } |
2180 | | |
2181 | | |
2182 | 4.34k | if (profile != EEsProfile && version >= 150) { |
2183 | 1.76k | commonBuiltins.append( |
2184 | 1.76k | "bool anyThreadNV(bool);" |
2185 | 1.76k | "bool allThreadsNV(bool);" |
2186 | 1.76k | "bool allThreadsEqualNV(bool);" |
2187 | | |
2188 | 1.76k | "\n"); |
2189 | 1.76k | } |
2190 | | |
2191 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
2192 | 4.08k | (profile != EEsProfile && version >= 150)) { // NV_gpu_shader5 |
2193 | 2.02k | commonBuiltins.append( |
2194 | 2.02k | " uint uaddCarry(highp uint, highp uint, out lowp uint carry);" |
2195 | 2.02k | "uvec2 uaddCarry(highp uvec2, highp uvec2, out lowp uvec2 carry);" |
2196 | 2.02k | "uvec3 uaddCarry(highp uvec3, highp uvec3, out lowp uvec3 carry);" |
2197 | 2.02k | "uvec4 uaddCarry(highp uvec4, highp uvec4, out lowp uvec4 carry);" |
2198 | | |
2199 | 2.02k | " uint usubBorrow(highp uint, highp uint, out lowp uint borrow);" |
2200 | 2.02k | "uvec2 usubBorrow(highp uvec2, highp uvec2, out lowp uvec2 borrow);" |
2201 | 2.02k | "uvec3 usubBorrow(highp uvec3, highp uvec3, out lowp uvec3 borrow);" |
2202 | 2.02k | "uvec4 usubBorrow(highp uvec4, highp uvec4, out lowp uvec4 borrow);" |
2203 | | |
2204 | 2.02k | "void umulExtended(highp uint, highp uint, out highp uint, out highp uint lsb);" |
2205 | 2.02k | "void umulExtended(highp uvec2, highp uvec2, out highp uvec2, out highp uvec2 lsb);" |
2206 | 2.02k | "void umulExtended(highp uvec3, highp uvec3, out highp uvec3, out highp uvec3 lsb);" |
2207 | 2.02k | "void umulExtended(highp uvec4, highp uvec4, out highp uvec4, out highp uvec4 lsb);" |
2208 | | |
2209 | 2.02k | "void imulExtended(highp int, highp int, out highp int, out highp int lsb);" |
2210 | 2.02k | "void imulExtended(highp ivec2, highp ivec2, out highp ivec2, out highp ivec2 lsb);" |
2211 | 2.02k | "void imulExtended(highp ivec3, highp ivec3, out highp ivec3, out highp ivec3 lsb);" |
2212 | 2.02k | "void imulExtended(highp ivec4, highp ivec4, out highp ivec4, out highp ivec4 lsb);" |
2213 | | |
2214 | 2.02k | " int bitfieldReverse(highp int);" |
2215 | 2.02k | "ivec2 bitfieldReverse(highp ivec2);" |
2216 | 2.02k | "ivec3 bitfieldReverse(highp ivec3);" |
2217 | 2.02k | "ivec4 bitfieldReverse(highp ivec4);" |
2218 | | |
2219 | 2.02k | " uint bitfieldReverse(highp uint);" |
2220 | 2.02k | "uvec2 bitfieldReverse(highp uvec2);" |
2221 | 2.02k | "uvec3 bitfieldReverse(highp uvec3);" |
2222 | 2.02k | "uvec4 bitfieldReverse(highp uvec4);" |
2223 | | |
2224 | 2.02k | "\n"); |
2225 | 2.02k | } |
2226 | | |
2227 | 4.34k | if (profile == EEsProfile && version >= 310) { |
2228 | 259 | commonBuiltins.append( |
2229 | 259 | "lowp int bitCount( int);" |
2230 | 259 | "lowp ivec2 bitCount(ivec2);" |
2231 | 259 | "lowp ivec3 bitCount(ivec3);" |
2232 | 259 | "lowp ivec4 bitCount(ivec4);" |
2233 | | |
2234 | 259 | "lowp int bitCount( uint);" |
2235 | 259 | "lowp ivec2 bitCount(uvec2);" |
2236 | 259 | "lowp ivec3 bitCount(uvec3);" |
2237 | 259 | "lowp ivec4 bitCount(uvec4);" |
2238 | | |
2239 | 259 | "lowp int findMSB(highp int);" |
2240 | 259 | "lowp ivec2 findMSB(highp ivec2);" |
2241 | 259 | "lowp ivec3 findMSB(highp ivec3);" |
2242 | 259 | "lowp ivec4 findMSB(highp ivec4);" |
2243 | | |
2244 | 259 | "lowp int findMSB(highp uint);" |
2245 | 259 | "lowp ivec2 findMSB(highp uvec2);" |
2246 | 259 | "lowp ivec3 findMSB(highp uvec3);" |
2247 | 259 | "lowp ivec4 findMSB(highp uvec4);" |
2248 | | |
2249 | 259 | "\n"); |
2250 | 259 | } |
2251 | | |
2252 | | // GL_ARB_shader_ballot |
2253 | 4.34k | if (profile != EEsProfile && version >= 450) { |
2254 | 883 | commonBuiltins.append( |
2255 | 883 | "uint64_t ballotARB(bool);" |
2256 | | |
2257 | 883 | "float readInvocationARB(float, uint);" |
2258 | 883 | "vec2 readInvocationARB(vec2, uint);" |
2259 | 883 | "vec3 readInvocationARB(vec3, uint);" |
2260 | 883 | "vec4 readInvocationARB(vec4, uint);" |
2261 | | |
2262 | 883 | "int readInvocationARB(int, uint);" |
2263 | 883 | "ivec2 readInvocationARB(ivec2, uint);" |
2264 | 883 | "ivec3 readInvocationARB(ivec3, uint);" |
2265 | 883 | "ivec4 readInvocationARB(ivec4, uint);" |
2266 | | |
2267 | 883 | "uint readInvocationARB(uint, uint);" |
2268 | 883 | "uvec2 readInvocationARB(uvec2, uint);" |
2269 | 883 | "uvec3 readInvocationARB(uvec3, uint);" |
2270 | 883 | "uvec4 readInvocationARB(uvec4, uint);" |
2271 | | |
2272 | 883 | "float readFirstInvocationARB(float);" |
2273 | 883 | "vec2 readFirstInvocationARB(vec2);" |
2274 | 883 | "vec3 readFirstInvocationARB(vec3);" |
2275 | 883 | "vec4 readFirstInvocationARB(vec4);" |
2276 | | |
2277 | 883 | "int readFirstInvocationARB(int);" |
2278 | 883 | "ivec2 readFirstInvocationARB(ivec2);" |
2279 | 883 | "ivec3 readFirstInvocationARB(ivec3);" |
2280 | 883 | "ivec4 readFirstInvocationARB(ivec4);" |
2281 | | |
2282 | 883 | "uint readFirstInvocationARB(uint);" |
2283 | 883 | "uvec2 readFirstInvocationARB(uvec2);" |
2284 | 883 | "uvec3 readFirstInvocationARB(uvec3);" |
2285 | 883 | "uvec4 readFirstInvocationARB(uvec4);" |
2286 | | |
2287 | 883 | "\n"); |
2288 | 883 | } |
2289 | | |
2290 | | // GL_ARB_shader_group_vote |
2291 | 4.34k | if (profile != EEsProfile && version >= 430) { |
2292 | 1.22k | commonBuiltins.append( |
2293 | 1.22k | "bool anyInvocationARB(bool);" |
2294 | 1.22k | "bool allInvocationsARB(bool);" |
2295 | 1.22k | "bool allInvocationsEqualARB(bool);" |
2296 | | |
2297 | 1.22k | "\n"); |
2298 | 1.22k | } |
2299 | | |
2300 | | // GL_EXT_integer_dot_product |
2301 | 4.34k | if ((profile == EEsProfile && version >= 300) || |
2302 | 4.08k | (profile != EEsProfile && version >= 450)) { |
2303 | 1.14k | commonBuiltins.append( |
2304 | | |
2305 | 1.14k | "uint dotEXT(uvec2 a, uvec2 b);" |
2306 | 1.14k | "int dotEXT(ivec2 a, ivec2 b);" |
2307 | 1.14k | "int dotEXT(ivec2 a, uvec2 b);" |
2308 | 1.14k | "int dotEXT(uvec2 a, ivec2 b);" |
2309 | | |
2310 | 1.14k | "uint dotEXT(uvec3 a, uvec3 b);" |
2311 | 1.14k | "int dotEXT(ivec3 a, ivec3 b);" |
2312 | 1.14k | "int dotEXT(ivec3 a, uvec3 b);" |
2313 | 1.14k | "int dotEXT(uvec3 a, ivec3 b);" |
2314 | | |
2315 | 1.14k | "uint dotEXT(uvec4 a, uvec4 b);" |
2316 | 1.14k | "int dotEXT(ivec4 a, ivec4 b);" |
2317 | 1.14k | "int dotEXT(ivec4 a, uvec4 b);" |
2318 | 1.14k | "int dotEXT(uvec4 a, ivec4 b);" |
2319 | | |
2320 | 1.14k | "uint dotPacked4x8EXT(uint a, uint b);" |
2321 | 1.14k | "int dotPacked4x8EXT(int a, uint b);" |
2322 | 1.14k | "int dotPacked4x8EXT(uint a, int b);" |
2323 | 1.14k | "int dotPacked4x8EXT(int a, int b);" |
2324 | | |
2325 | 1.14k | "uint dotEXT(u8vec2 a, u8vec2 b);" |
2326 | 1.14k | "int dotEXT(i8vec2 a, u8vec2 b);" |
2327 | 1.14k | "int dotEXT(u8vec2 a, i8vec2 b);" |
2328 | 1.14k | "int dotEXT(i8vec2 a, i8vec2 b);" |
2329 | | |
2330 | 1.14k | "uint dotEXT(u8vec3 a, u8vec3 b);" |
2331 | 1.14k | "int dotEXT(i8vec3 a, u8vec3 b);" |
2332 | 1.14k | "int dotEXT(u8vec3 a, i8vec3 b);" |
2333 | 1.14k | "int dotEXT(i8vec3 a, i8vec3 b);" |
2334 | | |
2335 | 1.14k | "uint dotEXT(u8vec4 a, u8vec4 b);" |
2336 | 1.14k | "int dotEXT(i8vec4 a, u8vec4 b);" |
2337 | 1.14k | "int dotEXT(u8vec4 a, i8vec4 b);" |
2338 | 1.14k | "int dotEXT(i8vec4 a, i8vec4 b);" |
2339 | | |
2340 | 1.14k | "uint dotEXT(u16vec2 a, u16vec2 b);" |
2341 | 1.14k | "int dotEXT(i16vec2 a, u16vec2 b);" |
2342 | 1.14k | "int dotEXT(u16vec2 a, i16vec2 b);" |
2343 | 1.14k | "int dotEXT(i16vec2 a, i16vec2 b);" |
2344 | | |
2345 | 1.14k | "uint dotEXT(u16vec3 a, u16vec3 b);" |
2346 | 1.14k | "int dotEXT(i16vec3 a, u16vec3 b);" |
2347 | 1.14k | "int dotEXT(u16vec3 a, i16vec3 b);" |
2348 | 1.14k | "int dotEXT(i16vec3 a, i16vec3 b);" |
2349 | | |
2350 | 1.14k | "uint dotEXT(u16vec4 a, u16vec4 b);" |
2351 | 1.14k | "int dotEXT(i16vec4 a, u16vec4 b);" |
2352 | 1.14k | "int dotEXT(u16vec4 a, i16vec4 b);" |
2353 | 1.14k | "int dotEXT(i16vec4 a, i16vec4 b);" |
2354 | | |
2355 | 1.14k | "uint64_t dotEXT(u64vec2 a, u64vec2 b);" |
2356 | 1.14k | "int64_t dotEXT(i64vec2 a, u64vec2 b);" |
2357 | 1.14k | "int64_t dotEXT(u64vec2 a, i64vec2 b);" |
2358 | 1.14k | "int64_t dotEXT(i64vec2 a, i64vec2 b);" |
2359 | | |
2360 | 1.14k | "uint64_t dotEXT(u64vec3 a, u64vec3 b);" |
2361 | 1.14k | "int64_t dotEXT(i64vec3 a, u64vec3 b);" |
2362 | 1.14k | "int64_t dotEXT(u64vec3 a, i64vec3 b);" |
2363 | 1.14k | "int64_t dotEXT(i64vec3 a, i64vec3 b);" |
2364 | | |
2365 | 1.14k | "uint64_t dotEXT(u64vec4 a, u64vec4 b);" |
2366 | 1.14k | "int64_t dotEXT(i64vec4 a, u64vec4 b);" |
2367 | 1.14k | "int64_t dotEXT(u64vec4 a, i64vec4 b);" |
2368 | 1.14k | "int64_t dotEXT(i64vec4 a, i64vec4 b);" |
2369 | | |
2370 | 1.14k | "uint dotAccSatEXT(uvec2 a, uvec2 b, uint c);" |
2371 | 1.14k | "int dotAccSatEXT(ivec2 a, uvec2 b, int c);" |
2372 | 1.14k | "int dotAccSatEXT(uvec2 a, ivec2 b, int c);" |
2373 | 1.14k | "int dotAccSatEXT(ivec2 a, ivec2 b, int c);" |
2374 | | |
2375 | 1.14k | "uint dotAccSatEXT(uvec3 a, uvec3 b, uint c);" |
2376 | 1.14k | "int dotAccSatEXT(ivec3 a, uvec3 b, int c);" |
2377 | 1.14k | "int dotAccSatEXT(uvec3 a, ivec3 b, int c);" |
2378 | 1.14k | "int dotAccSatEXT(ivec3 a, ivec3 b, int c);" |
2379 | | |
2380 | 1.14k | "uint dotAccSatEXT(uvec4 a, uvec4 b, uint c);" |
2381 | 1.14k | "int dotAccSatEXT(ivec4 a, uvec4 b, int c);" |
2382 | 1.14k | "int dotAccSatEXT(uvec4 a, ivec4 b, int c);" |
2383 | 1.14k | "int dotAccSatEXT(ivec4 a, ivec4 b, int c);" |
2384 | | |
2385 | 1.14k | "uint dotPacked4x8AccSatEXT(uint a, uint b, uint c);" |
2386 | 1.14k | "int dotPacked4x8AccSatEXT(int a, uint b, int c);" |
2387 | 1.14k | "int dotPacked4x8AccSatEXT(uint a, int b, int c);" |
2388 | 1.14k | "int dotPacked4x8AccSatEXT(int a, int b, int c);" |
2389 | | |
2390 | 1.14k | "uint dotAccSatEXT(u8vec2 a, u8vec2 b, uint c);" |
2391 | 1.14k | "int dotAccSatEXT(i8vec2 a, u8vec2 b, int c);" |
2392 | 1.14k | "int dotAccSatEXT(u8vec2 a, i8vec2 b, int c);" |
2393 | 1.14k | "int dotAccSatEXT(i8vec2 a, i8vec2 b, int c);" |
2394 | | |
2395 | 1.14k | "uint dotAccSatEXT(u8vec3 a, u8vec3 b, uint c);" |
2396 | 1.14k | "int dotAccSatEXT(i8vec3 a, u8vec3 b, int c);" |
2397 | 1.14k | "int dotAccSatEXT(u8vec3 a, i8vec3 b, int c);" |
2398 | 1.14k | "int dotAccSatEXT(i8vec3 a, i8vec3 b, int c);" |
2399 | | |
2400 | 1.14k | "uint dotAccSatEXT(u8vec4 a, u8vec4 b, uint c);" |
2401 | 1.14k | "int dotAccSatEXT(i8vec4 a, u8vec4 b, int c);" |
2402 | 1.14k | "int dotAccSatEXT(u8vec4 a, i8vec4 b, int c);" |
2403 | 1.14k | "int dotAccSatEXT(i8vec4 a, i8vec4 b, int c);" |
2404 | | |
2405 | 1.14k | "uint dotAccSatEXT(u16vec2 a, u16vec2 b, uint c);" |
2406 | 1.14k | "int dotAccSatEXT(i16vec2 a, u16vec2 b, int c);" |
2407 | 1.14k | "int dotAccSatEXT(u16vec2 a, i16vec2 b, int c);" |
2408 | 1.14k | "int dotAccSatEXT(i16vec2 a, i16vec2 b, int c);" |
2409 | | |
2410 | 1.14k | "uint dotAccSatEXT(u16vec3 a, u16vec3 b, uint c);" |
2411 | 1.14k | "int dotAccSatEXT(i16vec3 a, u16vec3 b, int c);" |
2412 | 1.14k | "int dotAccSatEXT(u16vec3 a, i16vec3 b, int c);" |
2413 | 1.14k | "int dotAccSatEXT(i16vec3 a, i16vec3 b, int c);" |
2414 | | |
2415 | 1.14k | "uint dotAccSatEXT(u16vec4 a, u16vec4 b, uint c);" |
2416 | 1.14k | "int dotAccSatEXT(i16vec4 a, u16vec4 b, int c);" |
2417 | 1.14k | "int dotAccSatEXT(u16vec4 a, i16vec4 b, int c);" |
2418 | 1.14k | "int dotAccSatEXT(i16vec4 a, i16vec4 b, int c);" |
2419 | | |
2420 | 1.14k | "uint64_t dotAccSatEXT(u64vec2 a, u64vec2 b, uint64_t c);" |
2421 | 1.14k | "int64_t dotAccSatEXT(i64vec2 a, u64vec2 b, int64_t c);" |
2422 | 1.14k | "int64_t dotAccSatEXT(u64vec2 a, i64vec2 b, int64_t c);" |
2423 | 1.14k | "int64_t dotAccSatEXT(i64vec2 a, i64vec2 b, int64_t c);" |
2424 | | |
2425 | 1.14k | "uint64_t dotAccSatEXT(u64vec3 a, u64vec3 b, uint64_t c);" |
2426 | 1.14k | "int64_t dotAccSatEXT(i64vec3 a, u64vec3 b, int64_t c);" |
2427 | 1.14k | "int64_t dotAccSatEXT(u64vec3 a, i64vec3 b, int64_t c);" |
2428 | 1.14k | "int64_t dotAccSatEXT(i64vec3 a, i64vec3 b, int64_t c);" |
2429 | | |
2430 | 1.14k | "uint64_t dotAccSatEXT(u64vec4 a, u64vec4 b, uint64_t c);" |
2431 | 1.14k | "int64_t dotAccSatEXT(i64vec4 a, u64vec4 b, int64_t c);" |
2432 | 1.14k | "int64_t dotAccSatEXT(u64vec4 a, i64vec4 b, int64_t c);" |
2433 | 1.14k | "int64_t dotAccSatEXT(i64vec4 a, i64vec4 b, int64_t c);" |
2434 | 1.14k | "\n"); |
2435 | 1.14k | } |
2436 | | |
2437 | | // GL_KHR_shader_subgroup |
2438 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
2439 | 4.34k | (profile != EEsProfile && version >= 140)) { |
2440 | 4.34k | commonBuiltins.append( |
2441 | 4.34k | "void subgroupBarrier();" |
2442 | 4.34k | "void subgroupMemoryBarrier();" |
2443 | 4.34k | "void subgroupMemoryBarrierBuffer();" |
2444 | 4.34k | "void subgroupMemoryBarrierImage();" |
2445 | 4.34k | "bool subgroupElect();" |
2446 | | |
2447 | 4.34k | "bool subgroupAll(bool);\n" |
2448 | 4.34k | "bool subgroupAny(bool);\n" |
2449 | 4.34k | "uvec4 subgroupBallot(bool);\n" |
2450 | 4.34k | "bool subgroupInverseBallot(uvec4);\n" |
2451 | 4.34k | "bool subgroupBallotBitExtract(uvec4, uint);\n" |
2452 | 4.34k | "uint subgroupBallotBitCount(uvec4);\n" |
2453 | 4.34k | "uint subgroupBallotInclusiveBitCount(uvec4);\n" |
2454 | 4.34k | "uint subgroupBallotExclusiveBitCount(uvec4);\n" |
2455 | 4.34k | "uint subgroupBallotFindLSB(uvec4);\n" |
2456 | 4.34k | "uint subgroupBallotFindMSB(uvec4);\n" |
2457 | 4.34k | ); |
2458 | | |
2459 | | // Generate all flavors of subgroup ops. |
2460 | 4.34k | static const char *subgroupOps[] = |
2461 | 4.34k | { |
2462 | 4.34k | "bool subgroupAllEqual(%s);\n", |
2463 | 4.34k | "%s subgroupBroadcast(%s, uint);\n", |
2464 | 4.34k | "%s subgroupBroadcastFirst(%s);\n", |
2465 | 4.34k | "%s subgroupShuffle(%s, uint);\n", |
2466 | 4.34k | "%s subgroupShuffleXor(%s, uint);\n", |
2467 | 4.34k | "%s subgroupShuffleUp(%s, uint delta);\n", |
2468 | 4.34k | "%s subgroupShuffleDown(%s, uint delta);\n", |
2469 | 4.34k | "%s subgroupRotate(%s, uint);\n", |
2470 | 4.34k | "%s subgroupClusteredRotate(%s, uint, uint);\n", |
2471 | 4.34k | "%s subgroupAdd(%s);\n", |
2472 | 4.34k | "%s subgroupMul(%s);\n", |
2473 | 4.34k | "%s subgroupMin(%s);\n", |
2474 | 4.34k | "%s subgroupMax(%s);\n", |
2475 | 4.34k | "%s subgroupAnd(%s);\n", |
2476 | 4.34k | "%s subgroupOr(%s);\n", |
2477 | 4.34k | "%s subgroupXor(%s);\n", |
2478 | 4.34k | "%s subgroupInclusiveAdd(%s);\n", |
2479 | 4.34k | "%s subgroupInclusiveMul(%s);\n", |
2480 | 4.34k | "%s subgroupInclusiveMin(%s);\n", |
2481 | 4.34k | "%s subgroupInclusiveMax(%s);\n", |
2482 | 4.34k | "%s subgroupInclusiveAnd(%s);\n", |
2483 | 4.34k | "%s subgroupInclusiveOr(%s);\n", |
2484 | 4.34k | "%s subgroupInclusiveXor(%s);\n", |
2485 | 4.34k | "%s subgroupExclusiveAdd(%s);\n", |
2486 | 4.34k | "%s subgroupExclusiveMul(%s);\n", |
2487 | 4.34k | "%s subgroupExclusiveMin(%s);\n", |
2488 | 4.34k | "%s subgroupExclusiveMax(%s);\n", |
2489 | 4.34k | "%s subgroupExclusiveAnd(%s);\n", |
2490 | 4.34k | "%s subgroupExclusiveOr(%s);\n", |
2491 | 4.34k | "%s subgroupExclusiveXor(%s);\n", |
2492 | 4.34k | "%s subgroupClusteredAdd(%s, uint);\n", |
2493 | 4.34k | "%s subgroupClusteredMul(%s, uint);\n", |
2494 | 4.34k | "%s subgroupClusteredMin(%s, uint);\n", |
2495 | 4.34k | "%s subgroupClusteredMax(%s, uint);\n", |
2496 | 4.34k | "%s subgroupClusteredAnd(%s, uint);\n", |
2497 | 4.34k | "%s subgroupClusteredOr(%s, uint);\n", |
2498 | 4.34k | "%s subgroupClusteredXor(%s, uint);\n", |
2499 | 4.34k | "%s subgroupQuadBroadcast(%s, uint);\n", |
2500 | 4.34k | "%s subgroupQuadSwapHorizontal(%s);\n", |
2501 | 4.34k | "%s subgroupQuadSwapVertical(%s);\n", |
2502 | 4.34k | "%s subgroupQuadSwapDiagonal(%s);\n", |
2503 | 4.34k | "uvec4 subgroupPartitionNV(%s);\n", |
2504 | 4.34k | "%s subgroupPartitionedAddNV(%s, uvec4 ballot);\n", |
2505 | 4.34k | "%s subgroupPartitionedMulNV(%s, uvec4 ballot);\n", |
2506 | 4.34k | "%s subgroupPartitionedMinNV(%s, uvec4 ballot);\n", |
2507 | 4.34k | "%s subgroupPartitionedMaxNV(%s, uvec4 ballot);\n", |
2508 | 4.34k | "%s subgroupPartitionedAndNV(%s, uvec4 ballot);\n", |
2509 | 4.34k | "%s subgroupPartitionedOrNV(%s, uvec4 ballot);\n", |
2510 | 4.34k | "%s subgroupPartitionedXorNV(%s, uvec4 ballot);\n", |
2511 | 4.34k | "%s subgroupPartitionedInclusiveAddNV(%s, uvec4 ballot);\n", |
2512 | 4.34k | "%s subgroupPartitionedInclusiveMulNV(%s, uvec4 ballot);\n", |
2513 | 4.34k | "%s subgroupPartitionedInclusiveMinNV(%s, uvec4 ballot);\n", |
2514 | 4.34k | "%s subgroupPartitionedInclusiveMaxNV(%s, uvec4 ballot);\n", |
2515 | 4.34k | "%s subgroupPartitionedInclusiveAndNV(%s, uvec4 ballot);\n", |
2516 | 4.34k | "%s subgroupPartitionedInclusiveOrNV(%s, uvec4 ballot);\n", |
2517 | 4.34k | "%s subgroupPartitionedInclusiveXorNV(%s, uvec4 ballot);\n", |
2518 | 4.34k | "%s subgroupPartitionedExclusiveAddNV(%s, uvec4 ballot);\n", |
2519 | 4.34k | "%s subgroupPartitionedExclusiveMulNV(%s, uvec4 ballot);\n", |
2520 | 4.34k | "%s subgroupPartitionedExclusiveMinNV(%s, uvec4 ballot);\n", |
2521 | 4.34k | "%s subgroupPartitionedExclusiveMaxNV(%s, uvec4 ballot);\n", |
2522 | 4.34k | "%s subgroupPartitionedExclusiveAndNV(%s, uvec4 ballot);\n", |
2523 | 4.34k | "%s subgroupPartitionedExclusiveOrNV(%s, uvec4 ballot);\n", |
2524 | 4.34k | "%s subgroupPartitionedExclusiveXorNV(%s, uvec4 ballot);\n", |
2525 | 4.34k | }; |
2526 | | |
2527 | 4.34k | static const char *floatTypes[] = { |
2528 | 4.34k | "float", "vec2", "vec3", "vec4", |
2529 | 4.34k | "float16_t", "f16vec2", "f16vec3", "f16vec4", |
2530 | 4.34k | }; |
2531 | 4.34k | static const char *doubleTypes[] = { |
2532 | 4.34k | "double", "dvec2", "dvec3", "dvec4", |
2533 | 4.34k | }; |
2534 | 4.34k | static const char *intTypes[] = { |
2535 | 4.34k | "int8_t", "i8vec2", "i8vec3", "i8vec4", |
2536 | 4.34k | "int16_t", "i16vec2", "i16vec3", "i16vec4", |
2537 | 4.34k | "int", "ivec2", "ivec3", "ivec4", |
2538 | 4.34k | "int64_t", "i64vec2", "i64vec3", "i64vec4", |
2539 | 4.34k | "uint8_t", "u8vec2", "u8vec3", "u8vec4", |
2540 | 4.34k | "uint16_t", "u16vec2", "u16vec3", "u16vec4", |
2541 | 4.34k | "uint", "uvec2", "uvec3", "uvec4", |
2542 | 4.34k | "uint64_t", "u64vec2", "u64vec3", "u64vec4", |
2543 | 4.34k | }; |
2544 | 4.34k | static const char *boolTypes[] = { |
2545 | 4.34k | "bool", "bvec2", "bvec3", "bvec4", |
2546 | 4.34k | }; |
2547 | | |
2548 | 277k | for (size_t i = 0; i < sizeof(subgroupOps)/sizeof(subgroupOps[0]); ++i) { |
2549 | 273k | const char *op = subgroupOps[i]; |
2550 | | |
2551 | | // Logical operations don't support float |
2552 | 273k | bool logicalOp = strstr(op, "Or") || strstr(op, "And") || |
2553 | 212k | (strstr(op, "Xor") && !strstr(op, "ShuffleXor")); |
2554 | | // Math operations don't support bool |
2555 | 273k | bool mathOp = strstr(op, "Add") || strstr(op, "Mul") || strstr(op, "Min") || strstr(op, "Max"); |
2556 | | |
2557 | 273k | const int bufSize = 256; |
2558 | 273k | char buf[bufSize]; |
2559 | | |
2560 | 273k | if (!logicalOp) { |
2561 | 1.64M | for (size_t j = 0; j < sizeof(floatTypes)/sizeof(floatTypes[0]); ++j) { |
2562 | 1.45M | snprintf(buf, bufSize, op, floatTypes[j], floatTypes[j]); |
2563 | 1.45M | commonBuiltins.append(buf); |
2564 | 1.45M | } |
2565 | 182k | if (profile != EEsProfile && version >= 400) { |
2566 | 300k | for (size_t j = 0; j < sizeof(doubleTypes)/sizeof(doubleTypes[0]); ++j) { |
2567 | 240k | snprintf(buf, bufSize, op, doubleTypes[j], doubleTypes[j]); |
2568 | 240k | commonBuiltins.append(buf); |
2569 | 240k | } |
2570 | 60.1k | } |
2571 | 182k | } |
2572 | 273k | if (!mathOp) { |
2573 | 759k | for (size_t j = 0; j < sizeof(boolTypes)/sizeof(boolTypes[0]); ++j) { |
2574 | 607k | snprintf(buf, bufSize, op, boolTypes[j], boolTypes[j]); |
2575 | 607k | commonBuiltins.append(buf); |
2576 | 607k | } |
2577 | 151k | } |
2578 | 9.02M | for (size_t j = 0; j < sizeof(intTypes)/sizeof(intTypes[0]); ++j) { |
2579 | 8.75M | snprintf(buf, bufSize, op, intTypes[j], intTypes[j]); |
2580 | 8.75M | commonBuiltins.append(buf); |
2581 | 8.75M | } |
2582 | 273k | snprintf(buf, bufSize, op, "vector", "vector"); |
2583 | 273k | commonBuiltins.append(buf); |
2584 | 273k | } |
2585 | | |
2586 | 4.34k | stageBuiltins[EShLangCompute].append( |
2587 | 4.34k | "void subgroupMemoryBarrierShared();" |
2588 | | |
2589 | 4.34k | "\n" |
2590 | 4.34k | ); |
2591 | 4.34k | stageBuiltins[EShLangMesh].append( |
2592 | 4.34k | "void subgroupMemoryBarrierShared();" |
2593 | 4.34k | "\n" |
2594 | 4.34k | ); |
2595 | 4.34k | stageBuiltins[EShLangTask].append( |
2596 | 4.34k | "void subgroupMemoryBarrierShared();" |
2597 | 4.34k | "\n" |
2598 | 4.34k | ); |
2599 | 4.34k | } |
2600 | | |
2601 | | // GL_EXT_shader_quad_control |
2602 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
2603 | 4.34k | (profile != EEsProfile && version >= 140)) { |
2604 | 4.34k | commonBuiltins.append( |
2605 | 4.34k | "bool subgroupQuadAll(bool);\n" |
2606 | 4.34k | "bool subgroupQuadAny(bool);\n" |
2607 | 4.34k | ); |
2608 | 4.34k | } |
2609 | | |
2610 | 4.34k | if (profile != EEsProfile && version >= 460) { |
2611 | 108 | commonBuiltins.append( |
2612 | 108 | "bool anyInvocation(bool);" |
2613 | 108 | "bool allInvocations(bool);" |
2614 | 108 | "bool allInvocationsEqual(bool);" |
2615 | | |
2616 | 108 | "\n"); |
2617 | 108 | } |
2618 | | |
2619 | | // GL_AMD_shader_ballot |
2620 | 4.34k | if (profile != EEsProfile && version >= 450) { |
2621 | 883 | commonBuiltins.append( |
2622 | 883 | "float minInvocationsAMD(float);" |
2623 | 883 | "vec2 minInvocationsAMD(vec2);" |
2624 | 883 | "vec3 minInvocationsAMD(vec3);" |
2625 | 883 | "vec4 minInvocationsAMD(vec4);" |
2626 | | |
2627 | 883 | "int minInvocationsAMD(int);" |
2628 | 883 | "ivec2 minInvocationsAMD(ivec2);" |
2629 | 883 | "ivec3 minInvocationsAMD(ivec3);" |
2630 | 883 | "ivec4 minInvocationsAMD(ivec4);" |
2631 | | |
2632 | 883 | "uint minInvocationsAMD(uint);" |
2633 | 883 | "uvec2 minInvocationsAMD(uvec2);" |
2634 | 883 | "uvec3 minInvocationsAMD(uvec3);" |
2635 | 883 | "uvec4 minInvocationsAMD(uvec4);" |
2636 | | |
2637 | 883 | "double minInvocationsAMD(double);" |
2638 | 883 | "dvec2 minInvocationsAMD(dvec2);" |
2639 | 883 | "dvec3 minInvocationsAMD(dvec3);" |
2640 | 883 | "dvec4 minInvocationsAMD(dvec4);" |
2641 | | |
2642 | 883 | "int64_t minInvocationsAMD(int64_t);" |
2643 | 883 | "i64vec2 minInvocationsAMD(i64vec2);" |
2644 | 883 | "i64vec3 minInvocationsAMD(i64vec3);" |
2645 | 883 | "i64vec4 minInvocationsAMD(i64vec4);" |
2646 | | |
2647 | 883 | "uint64_t minInvocationsAMD(uint64_t);" |
2648 | 883 | "u64vec2 minInvocationsAMD(u64vec2);" |
2649 | 883 | "u64vec3 minInvocationsAMD(u64vec3);" |
2650 | 883 | "u64vec4 minInvocationsAMD(u64vec4);" |
2651 | | |
2652 | 883 | "float16_t minInvocationsAMD(float16_t);" |
2653 | 883 | "f16vec2 minInvocationsAMD(f16vec2);" |
2654 | 883 | "f16vec3 minInvocationsAMD(f16vec3);" |
2655 | 883 | "f16vec4 minInvocationsAMD(f16vec4);" |
2656 | | |
2657 | 883 | "int16_t minInvocationsAMD(int16_t);" |
2658 | 883 | "i16vec2 minInvocationsAMD(i16vec2);" |
2659 | 883 | "i16vec3 minInvocationsAMD(i16vec3);" |
2660 | 883 | "i16vec4 minInvocationsAMD(i16vec4);" |
2661 | | |
2662 | 883 | "uint16_t minInvocationsAMD(uint16_t);" |
2663 | 883 | "u16vec2 minInvocationsAMD(u16vec2);" |
2664 | 883 | "u16vec3 minInvocationsAMD(u16vec3);" |
2665 | 883 | "u16vec4 minInvocationsAMD(u16vec4);" |
2666 | | |
2667 | 883 | "float minInvocationsInclusiveScanAMD(float);" |
2668 | 883 | "vec2 minInvocationsInclusiveScanAMD(vec2);" |
2669 | 883 | "vec3 minInvocationsInclusiveScanAMD(vec3);" |
2670 | 883 | "vec4 minInvocationsInclusiveScanAMD(vec4);" |
2671 | | |
2672 | 883 | "int minInvocationsInclusiveScanAMD(int);" |
2673 | 883 | "ivec2 minInvocationsInclusiveScanAMD(ivec2);" |
2674 | 883 | "ivec3 minInvocationsInclusiveScanAMD(ivec3);" |
2675 | 883 | "ivec4 minInvocationsInclusiveScanAMD(ivec4);" |
2676 | | |
2677 | 883 | "uint minInvocationsInclusiveScanAMD(uint);" |
2678 | 883 | "uvec2 minInvocationsInclusiveScanAMD(uvec2);" |
2679 | 883 | "uvec3 minInvocationsInclusiveScanAMD(uvec3);" |
2680 | 883 | "uvec4 minInvocationsInclusiveScanAMD(uvec4);" |
2681 | | |
2682 | 883 | "double minInvocationsInclusiveScanAMD(double);" |
2683 | 883 | "dvec2 minInvocationsInclusiveScanAMD(dvec2);" |
2684 | 883 | "dvec3 minInvocationsInclusiveScanAMD(dvec3);" |
2685 | 883 | "dvec4 minInvocationsInclusiveScanAMD(dvec4);" |
2686 | | |
2687 | 883 | "int64_t minInvocationsInclusiveScanAMD(int64_t);" |
2688 | 883 | "i64vec2 minInvocationsInclusiveScanAMD(i64vec2);" |
2689 | 883 | "i64vec3 minInvocationsInclusiveScanAMD(i64vec3);" |
2690 | 883 | "i64vec4 minInvocationsInclusiveScanAMD(i64vec4);" |
2691 | | |
2692 | 883 | "uint64_t minInvocationsInclusiveScanAMD(uint64_t);" |
2693 | 883 | "u64vec2 minInvocationsInclusiveScanAMD(u64vec2);" |
2694 | 883 | "u64vec3 minInvocationsInclusiveScanAMD(u64vec3);" |
2695 | 883 | "u64vec4 minInvocationsInclusiveScanAMD(u64vec4);" |
2696 | | |
2697 | 883 | "float16_t minInvocationsInclusiveScanAMD(float16_t);" |
2698 | 883 | "f16vec2 minInvocationsInclusiveScanAMD(f16vec2);" |
2699 | 883 | "f16vec3 minInvocationsInclusiveScanAMD(f16vec3);" |
2700 | 883 | "f16vec4 minInvocationsInclusiveScanAMD(f16vec4);" |
2701 | | |
2702 | 883 | "int16_t minInvocationsInclusiveScanAMD(int16_t);" |
2703 | 883 | "i16vec2 minInvocationsInclusiveScanAMD(i16vec2);" |
2704 | 883 | "i16vec3 minInvocationsInclusiveScanAMD(i16vec3);" |
2705 | 883 | "i16vec4 minInvocationsInclusiveScanAMD(i16vec4);" |
2706 | | |
2707 | 883 | "uint16_t minInvocationsInclusiveScanAMD(uint16_t);" |
2708 | 883 | "u16vec2 minInvocationsInclusiveScanAMD(u16vec2);" |
2709 | 883 | "u16vec3 minInvocationsInclusiveScanAMD(u16vec3);" |
2710 | 883 | "u16vec4 minInvocationsInclusiveScanAMD(u16vec4);" |
2711 | | |
2712 | 883 | "float minInvocationsExclusiveScanAMD(float);" |
2713 | 883 | "vec2 minInvocationsExclusiveScanAMD(vec2);" |
2714 | 883 | "vec3 minInvocationsExclusiveScanAMD(vec3);" |
2715 | 883 | "vec4 minInvocationsExclusiveScanAMD(vec4);" |
2716 | | |
2717 | 883 | "int minInvocationsExclusiveScanAMD(int);" |
2718 | 883 | "ivec2 minInvocationsExclusiveScanAMD(ivec2);" |
2719 | 883 | "ivec3 minInvocationsExclusiveScanAMD(ivec3);" |
2720 | 883 | "ivec4 minInvocationsExclusiveScanAMD(ivec4);" |
2721 | | |
2722 | 883 | "uint minInvocationsExclusiveScanAMD(uint);" |
2723 | 883 | "uvec2 minInvocationsExclusiveScanAMD(uvec2);" |
2724 | 883 | "uvec3 minInvocationsExclusiveScanAMD(uvec3);" |
2725 | 883 | "uvec4 minInvocationsExclusiveScanAMD(uvec4);" |
2726 | | |
2727 | 883 | "double minInvocationsExclusiveScanAMD(double);" |
2728 | 883 | "dvec2 minInvocationsExclusiveScanAMD(dvec2);" |
2729 | 883 | "dvec3 minInvocationsExclusiveScanAMD(dvec3);" |
2730 | 883 | "dvec4 minInvocationsExclusiveScanAMD(dvec4);" |
2731 | | |
2732 | 883 | "int64_t minInvocationsExclusiveScanAMD(int64_t);" |
2733 | 883 | "i64vec2 minInvocationsExclusiveScanAMD(i64vec2);" |
2734 | 883 | "i64vec3 minInvocationsExclusiveScanAMD(i64vec3);" |
2735 | 883 | "i64vec4 minInvocationsExclusiveScanAMD(i64vec4);" |
2736 | | |
2737 | 883 | "uint64_t minInvocationsExclusiveScanAMD(uint64_t);" |
2738 | 883 | "u64vec2 minInvocationsExclusiveScanAMD(u64vec2);" |
2739 | 883 | "u64vec3 minInvocationsExclusiveScanAMD(u64vec3);" |
2740 | 883 | "u64vec4 minInvocationsExclusiveScanAMD(u64vec4);" |
2741 | | |
2742 | 883 | "float16_t minInvocationsExclusiveScanAMD(float16_t);" |
2743 | 883 | "f16vec2 minInvocationsExclusiveScanAMD(f16vec2);" |
2744 | 883 | "f16vec3 minInvocationsExclusiveScanAMD(f16vec3);" |
2745 | 883 | "f16vec4 minInvocationsExclusiveScanAMD(f16vec4);" |
2746 | | |
2747 | 883 | "int16_t minInvocationsExclusiveScanAMD(int16_t);" |
2748 | 883 | "i16vec2 minInvocationsExclusiveScanAMD(i16vec2);" |
2749 | 883 | "i16vec3 minInvocationsExclusiveScanAMD(i16vec3);" |
2750 | 883 | "i16vec4 minInvocationsExclusiveScanAMD(i16vec4);" |
2751 | | |
2752 | 883 | "uint16_t minInvocationsExclusiveScanAMD(uint16_t);" |
2753 | 883 | "u16vec2 minInvocationsExclusiveScanAMD(u16vec2);" |
2754 | 883 | "u16vec3 minInvocationsExclusiveScanAMD(u16vec3);" |
2755 | 883 | "u16vec4 minInvocationsExclusiveScanAMD(u16vec4);" |
2756 | | |
2757 | 883 | "float maxInvocationsAMD(float);" |
2758 | 883 | "vec2 maxInvocationsAMD(vec2);" |
2759 | 883 | "vec3 maxInvocationsAMD(vec3);" |
2760 | 883 | "vec4 maxInvocationsAMD(vec4);" |
2761 | | |
2762 | 883 | "int maxInvocationsAMD(int);" |
2763 | 883 | "ivec2 maxInvocationsAMD(ivec2);" |
2764 | 883 | "ivec3 maxInvocationsAMD(ivec3);" |
2765 | 883 | "ivec4 maxInvocationsAMD(ivec4);" |
2766 | | |
2767 | 883 | "uint maxInvocationsAMD(uint);" |
2768 | 883 | "uvec2 maxInvocationsAMD(uvec2);" |
2769 | 883 | "uvec3 maxInvocationsAMD(uvec3);" |
2770 | 883 | "uvec4 maxInvocationsAMD(uvec4);" |
2771 | | |
2772 | 883 | "double maxInvocationsAMD(double);" |
2773 | 883 | "dvec2 maxInvocationsAMD(dvec2);" |
2774 | 883 | "dvec3 maxInvocationsAMD(dvec3);" |
2775 | 883 | "dvec4 maxInvocationsAMD(dvec4);" |
2776 | | |
2777 | 883 | "int64_t maxInvocationsAMD(int64_t);" |
2778 | 883 | "i64vec2 maxInvocationsAMD(i64vec2);" |
2779 | 883 | "i64vec3 maxInvocationsAMD(i64vec3);" |
2780 | 883 | "i64vec4 maxInvocationsAMD(i64vec4);" |
2781 | | |
2782 | 883 | "uint64_t maxInvocationsAMD(uint64_t);" |
2783 | 883 | "u64vec2 maxInvocationsAMD(u64vec2);" |
2784 | 883 | "u64vec3 maxInvocationsAMD(u64vec3);" |
2785 | 883 | "u64vec4 maxInvocationsAMD(u64vec4);" |
2786 | | |
2787 | 883 | "float16_t maxInvocationsAMD(float16_t);" |
2788 | 883 | "f16vec2 maxInvocationsAMD(f16vec2);" |
2789 | 883 | "f16vec3 maxInvocationsAMD(f16vec3);" |
2790 | 883 | "f16vec4 maxInvocationsAMD(f16vec4);" |
2791 | | |
2792 | 883 | "int16_t maxInvocationsAMD(int16_t);" |
2793 | 883 | "i16vec2 maxInvocationsAMD(i16vec2);" |
2794 | 883 | "i16vec3 maxInvocationsAMD(i16vec3);" |
2795 | 883 | "i16vec4 maxInvocationsAMD(i16vec4);" |
2796 | | |
2797 | 883 | "uint16_t maxInvocationsAMD(uint16_t);" |
2798 | 883 | "u16vec2 maxInvocationsAMD(u16vec2);" |
2799 | 883 | "u16vec3 maxInvocationsAMD(u16vec3);" |
2800 | 883 | "u16vec4 maxInvocationsAMD(u16vec4);" |
2801 | | |
2802 | 883 | "float maxInvocationsInclusiveScanAMD(float);" |
2803 | 883 | "vec2 maxInvocationsInclusiveScanAMD(vec2);" |
2804 | 883 | "vec3 maxInvocationsInclusiveScanAMD(vec3);" |
2805 | 883 | "vec4 maxInvocationsInclusiveScanAMD(vec4);" |
2806 | | |
2807 | 883 | "int maxInvocationsInclusiveScanAMD(int);" |
2808 | 883 | "ivec2 maxInvocationsInclusiveScanAMD(ivec2);" |
2809 | 883 | "ivec3 maxInvocationsInclusiveScanAMD(ivec3);" |
2810 | 883 | "ivec4 maxInvocationsInclusiveScanAMD(ivec4);" |
2811 | | |
2812 | 883 | "uint maxInvocationsInclusiveScanAMD(uint);" |
2813 | 883 | "uvec2 maxInvocationsInclusiveScanAMD(uvec2);" |
2814 | 883 | "uvec3 maxInvocationsInclusiveScanAMD(uvec3);" |
2815 | 883 | "uvec4 maxInvocationsInclusiveScanAMD(uvec4);" |
2816 | | |
2817 | 883 | "double maxInvocationsInclusiveScanAMD(double);" |
2818 | 883 | "dvec2 maxInvocationsInclusiveScanAMD(dvec2);" |
2819 | 883 | "dvec3 maxInvocationsInclusiveScanAMD(dvec3);" |
2820 | 883 | "dvec4 maxInvocationsInclusiveScanAMD(dvec4);" |
2821 | | |
2822 | 883 | "int64_t maxInvocationsInclusiveScanAMD(int64_t);" |
2823 | 883 | "i64vec2 maxInvocationsInclusiveScanAMD(i64vec2);" |
2824 | 883 | "i64vec3 maxInvocationsInclusiveScanAMD(i64vec3);" |
2825 | 883 | "i64vec4 maxInvocationsInclusiveScanAMD(i64vec4);" |
2826 | | |
2827 | 883 | "uint64_t maxInvocationsInclusiveScanAMD(uint64_t);" |
2828 | 883 | "u64vec2 maxInvocationsInclusiveScanAMD(u64vec2);" |
2829 | 883 | "u64vec3 maxInvocationsInclusiveScanAMD(u64vec3);" |
2830 | 883 | "u64vec4 maxInvocationsInclusiveScanAMD(u64vec4);" |
2831 | | |
2832 | 883 | "float16_t maxInvocationsInclusiveScanAMD(float16_t);" |
2833 | 883 | "f16vec2 maxInvocationsInclusiveScanAMD(f16vec2);" |
2834 | 883 | "f16vec3 maxInvocationsInclusiveScanAMD(f16vec3);" |
2835 | 883 | "f16vec4 maxInvocationsInclusiveScanAMD(f16vec4);" |
2836 | | |
2837 | 883 | "int16_t maxInvocationsInclusiveScanAMD(int16_t);" |
2838 | 883 | "i16vec2 maxInvocationsInclusiveScanAMD(i16vec2);" |
2839 | 883 | "i16vec3 maxInvocationsInclusiveScanAMD(i16vec3);" |
2840 | 883 | "i16vec4 maxInvocationsInclusiveScanAMD(i16vec4);" |
2841 | | |
2842 | 883 | "uint16_t maxInvocationsInclusiveScanAMD(uint16_t);" |
2843 | 883 | "u16vec2 maxInvocationsInclusiveScanAMD(u16vec2);" |
2844 | 883 | "u16vec3 maxInvocationsInclusiveScanAMD(u16vec3);" |
2845 | 883 | "u16vec4 maxInvocationsInclusiveScanAMD(u16vec4);" |
2846 | | |
2847 | 883 | "float maxInvocationsExclusiveScanAMD(float);" |
2848 | 883 | "vec2 maxInvocationsExclusiveScanAMD(vec2);" |
2849 | 883 | "vec3 maxInvocationsExclusiveScanAMD(vec3);" |
2850 | 883 | "vec4 maxInvocationsExclusiveScanAMD(vec4);" |
2851 | | |
2852 | 883 | "int maxInvocationsExclusiveScanAMD(int);" |
2853 | 883 | "ivec2 maxInvocationsExclusiveScanAMD(ivec2);" |
2854 | 883 | "ivec3 maxInvocationsExclusiveScanAMD(ivec3);" |
2855 | 883 | "ivec4 maxInvocationsExclusiveScanAMD(ivec4);" |
2856 | | |
2857 | 883 | "uint maxInvocationsExclusiveScanAMD(uint);" |
2858 | 883 | "uvec2 maxInvocationsExclusiveScanAMD(uvec2);" |
2859 | 883 | "uvec3 maxInvocationsExclusiveScanAMD(uvec3);" |
2860 | 883 | "uvec4 maxInvocationsExclusiveScanAMD(uvec4);" |
2861 | | |
2862 | 883 | "double maxInvocationsExclusiveScanAMD(double);" |
2863 | 883 | "dvec2 maxInvocationsExclusiveScanAMD(dvec2);" |
2864 | 883 | "dvec3 maxInvocationsExclusiveScanAMD(dvec3);" |
2865 | 883 | "dvec4 maxInvocationsExclusiveScanAMD(dvec4);" |
2866 | | |
2867 | 883 | "int64_t maxInvocationsExclusiveScanAMD(int64_t);" |
2868 | 883 | "i64vec2 maxInvocationsExclusiveScanAMD(i64vec2);" |
2869 | 883 | "i64vec3 maxInvocationsExclusiveScanAMD(i64vec3);" |
2870 | 883 | "i64vec4 maxInvocationsExclusiveScanAMD(i64vec4);" |
2871 | | |
2872 | 883 | "uint64_t maxInvocationsExclusiveScanAMD(uint64_t);" |
2873 | 883 | "u64vec2 maxInvocationsExclusiveScanAMD(u64vec2);" |
2874 | 883 | "u64vec3 maxInvocationsExclusiveScanAMD(u64vec3);" |
2875 | 883 | "u64vec4 maxInvocationsExclusiveScanAMD(u64vec4);" |
2876 | | |
2877 | 883 | "float16_t maxInvocationsExclusiveScanAMD(float16_t);" |
2878 | 883 | "f16vec2 maxInvocationsExclusiveScanAMD(f16vec2);" |
2879 | 883 | "f16vec3 maxInvocationsExclusiveScanAMD(f16vec3);" |
2880 | 883 | "f16vec4 maxInvocationsExclusiveScanAMD(f16vec4);" |
2881 | | |
2882 | 883 | "int16_t maxInvocationsExclusiveScanAMD(int16_t);" |
2883 | 883 | "i16vec2 maxInvocationsExclusiveScanAMD(i16vec2);" |
2884 | 883 | "i16vec3 maxInvocationsExclusiveScanAMD(i16vec3);" |
2885 | 883 | "i16vec4 maxInvocationsExclusiveScanAMD(i16vec4);" |
2886 | | |
2887 | 883 | "uint16_t maxInvocationsExclusiveScanAMD(uint16_t);" |
2888 | 883 | "u16vec2 maxInvocationsExclusiveScanAMD(u16vec2);" |
2889 | 883 | "u16vec3 maxInvocationsExclusiveScanAMD(u16vec3);" |
2890 | 883 | "u16vec4 maxInvocationsExclusiveScanAMD(u16vec4);" |
2891 | | |
2892 | 883 | "float addInvocationsAMD(float);" |
2893 | 883 | "vec2 addInvocationsAMD(vec2);" |
2894 | 883 | "vec3 addInvocationsAMD(vec3);" |
2895 | 883 | "vec4 addInvocationsAMD(vec4);" |
2896 | | |
2897 | 883 | "int addInvocationsAMD(int);" |
2898 | 883 | "ivec2 addInvocationsAMD(ivec2);" |
2899 | 883 | "ivec3 addInvocationsAMD(ivec3);" |
2900 | 883 | "ivec4 addInvocationsAMD(ivec4);" |
2901 | | |
2902 | 883 | "uint addInvocationsAMD(uint);" |
2903 | 883 | "uvec2 addInvocationsAMD(uvec2);" |
2904 | 883 | "uvec3 addInvocationsAMD(uvec3);" |
2905 | 883 | "uvec4 addInvocationsAMD(uvec4);" |
2906 | | |
2907 | 883 | "double addInvocationsAMD(double);" |
2908 | 883 | "dvec2 addInvocationsAMD(dvec2);" |
2909 | 883 | "dvec3 addInvocationsAMD(dvec3);" |
2910 | 883 | "dvec4 addInvocationsAMD(dvec4);" |
2911 | | |
2912 | 883 | "int64_t addInvocationsAMD(int64_t);" |
2913 | 883 | "i64vec2 addInvocationsAMD(i64vec2);" |
2914 | 883 | "i64vec3 addInvocationsAMD(i64vec3);" |
2915 | 883 | "i64vec4 addInvocationsAMD(i64vec4);" |
2916 | | |
2917 | 883 | "uint64_t addInvocationsAMD(uint64_t);" |
2918 | 883 | "u64vec2 addInvocationsAMD(u64vec2);" |
2919 | 883 | "u64vec3 addInvocationsAMD(u64vec3);" |
2920 | 883 | "u64vec4 addInvocationsAMD(u64vec4);" |
2921 | | |
2922 | 883 | "float16_t addInvocationsAMD(float16_t);" |
2923 | 883 | "f16vec2 addInvocationsAMD(f16vec2);" |
2924 | 883 | "f16vec3 addInvocationsAMD(f16vec3);" |
2925 | 883 | "f16vec4 addInvocationsAMD(f16vec4);" |
2926 | | |
2927 | 883 | "int16_t addInvocationsAMD(int16_t);" |
2928 | 883 | "i16vec2 addInvocationsAMD(i16vec2);" |
2929 | 883 | "i16vec3 addInvocationsAMD(i16vec3);" |
2930 | 883 | "i16vec4 addInvocationsAMD(i16vec4);" |
2931 | | |
2932 | 883 | "uint16_t addInvocationsAMD(uint16_t);" |
2933 | 883 | "u16vec2 addInvocationsAMD(u16vec2);" |
2934 | 883 | "u16vec3 addInvocationsAMD(u16vec3);" |
2935 | 883 | "u16vec4 addInvocationsAMD(u16vec4);" |
2936 | | |
2937 | 883 | "float addInvocationsInclusiveScanAMD(float);" |
2938 | 883 | "vec2 addInvocationsInclusiveScanAMD(vec2);" |
2939 | 883 | "vec3 addInvocationsInclusiveScanAMD(vec3);" |
2940 | 883 | "vec4 addInvocationsInclusiveScanAMD(vec4);" |
2941 | | |
2942 | 883 | "int addInvocationsInclusiveScanAMD(int);" |
2943 | 883 | "ivec2 addInvocationsInclusiveScanAMD(ivec2);" |
2944 | 883 | "ivec3 addInvocationsInclusiveScanAMD(ivec3);" |
2945 | 883 | "ivec4 addInvocationsInclusiveScanAMD(ivec4);" |
2946 | | |
2947 | 883 | "uint addInvocationsInclusiveScanAMD(uint);" |
2948 | 883 | "uvec2 addInvocationsInclusiveScanAMD(uvec2);" |
2949 | 883 | "uvec3 addInvocationsInclusiveScanAMD(uvec3);" |
2950 | 883 | "uvec4 addInvocationsInclusiveScanAMD(uvec4);" |
2951 | | |
2952 | 883 | "double addInvocationsInclusiveScanAMD(double);" |
2953 | 883 | "dvec2 addInvocationsInclusiveScanAMD(dvec2);" |
2954 | 883 | "dvec3 addInvocationsInclusiveScanAMD(dvec3);" |
2955 | 883 | "dvec4 addInvocationsInclusiveScanAMD(dvec4);" |
2956 | | |
2957 | 883 | "int64_t addInvocationsInclusiveScanAMD(int64_t);" |
2958 | 883 | "i64vec2 addInvocationsInclusiveScanAMD(i64vec2);" |
2959 | 883 | "i64vec3 addInvocationsInclusiveScanAMD(i64vec3);" |
2960 | 883 | "i64vec4 addInvocationsInclusiveScanAMD(i64vec4);" |
2961 | | |
2962 | 883 | "uint64_t addInvocationsInclusiveScanAMD(uint64_t);" |
2963 | 883 | "u64vec2 addInvocationsInclusiveScanAMD(u64vec2);" |
2964 | 883 | "u64vec3 addInvocationsInclusiveScanAMD(u64vec3);" |
2965 | 883 | "u64vec4 addInvocationsInclusiveScanAMD(u64vec4);" |
2966 | | |
2967 | 883 | "float16_t addInvocationsInclusiveScanAMD(float16_t);" |
2968 | 883 | "f16vec2 addInvocationsInclusiveScanAMD(f16vec2);" |
2969 | 883 | "f16vec3 addInvocationsInclusiveScanAMD(f16vec3);" |
2970 | 883 | "f16vec4 addInvocationsInclusiveScanAMD(f16vec4);" |
2971 | | |
2972 | 883 | "int16_t addInvocationsInclusiveScanAMD(int16_t);" |
2973 | 883 | "i16vec2 addInvocationsInclusiveScanAMD(i16vec2);" |
2974 | 883 | "i16vec3 addInvocationsInclusiveScanAMD(i16vec3);" |
2975 | 883 | "i16vec4 addInvocationsInclusiveScanAMD(i16vec4);" |
2976 | | |
2977 | 883 | "uint16_t addInvocationsInclusiveScanAMD(uint16_t);" |
2978 | 883 | "u16vec2 addInvocationsInclusiveScanAMD(u16vec2);" |
2979 | 883 | "u16vec3 addInvocationsInclusiveScanAMD(u16vec3);" |
2980 | 883 | "u16vec4 addInvocationsInclusiveScanAMD(u16vec4);" |
2981 | | |
2982 | 883 | "float addInvocationsExclusiveScanAMD(float);" |
2983 | 883 | "vec2 addInvocationsExclusiveScanAMD(vec2);" |
2984 | 883 | "vec3 addInvocationsExclusiveScanAMD(vec3);" |
2985 | 883 | "vec4 addInvocationsExclusiveScanAMD(vec4);" |
2986 | | |
2987 | 883 | "int addInvocationsExclusiveScanAMD(int);" |
2988 | 883 | "ivec2 addInvocationsExclusiveScanAMD(ivec2);" |
2989 | 883 | "ivec3 addInvocationsExclusiveScanAMD(ivec3);" |
2990 | 883 | "ivec4 addInvocationsExclusiveScanAMD(ivec4);" |
2991 | | |
2992 | 883 | "uint addInvocationsExclusiveScanAMD(uint);" |
2993 | 883 | "uvec2 addInvocationsExclusiveScanAMD(uvec2);" |
2994 | 883 | "uvec3 addInvocationsExclusiveScanAMD(uvec3);" |
2995 | 883 | "uvec4 addInvocationsExclusiveScanAMD(uvec4);" |
2996 | | |
2997 | 883 | "double addInvocationsExclusiveScanAMD(double);" |
2998 | 883 | "dvec2 addInvocationsExclusiveScanAMD(dvec2);" |
2999 | 883 | "dvec3 addInvocationsExclusiveScanAMD(dvec3);" |
3000 | 883 | "dvec4 addInvocationsExclusiveScanAMD(dvec4);" |
3001 | | |
3002 | 883 | "int64_t addInvocationsExclusiveScanAMD(int64_t);" |
3003 | 883 | "i64vec2 addInvocationsExclusiveScanAMD(i64vec2);" |
3004 | 883 | "i64vec3 addInvocationsExclusiveScanAMD(i64vec3);" |
3005 | 883 | "i64vec4 addInvocationsExclusiveScanAMD(i64vec4);" |
3006 | | |
3007 | 883 | "uint64_t addInvocationsExclusiveScanAMD(uint64_t);" |
3008 | 883 | "u64vec2 addInvocationsExclusiveScanAMD(u64vec2);" |
3009 | 883 | "u64vec3 addInvocationsExclusiveScanAMD(u64vec3);" |
3010 | 883 | "u64vec4 addInvocationsExclusiveScanAMD(u64vec4);" |
3011 | | |
3012 | 883 | "float16_t addInvocationsExclusiveScanAMD(float16_t);" |
3013 | 883 | "f16vec2 addInvocationsExclusiveScanAMD(f16vec2);" |
3014 | 883 | "f16vec3 addInvocationsExclusiveScanAMD(f16vec3);" |
3015 | 883 | "f16vec4 addInvocationsExclusiveScanAMD(f16vec4);" |
3016 | | |
3017 | 883 | "int16_t addInvocationsExclusiveScanAMD(int16_t);" |
3018 | 883 | "i16vec2 addInvocationsExclusiveScanAMD(i16vec2);" |
3019 | 883 | "i16vec3 addInvocationsExclusiveScanAMD(i16vec3);" |
3020 | 883 | "i16vec4 addInvocationsExclusiveScanAMD(i16vec4);" |
3021 | | |
3022 | 883 | "uint16_t addInvocationsExclusiveScanAMD(uint16_t);" |
3023 | 883 | "u16vec2 addInvocationsExclusiveScanAMD(u16vec2);" |
3024 | 883 | "u16vec3 addInvocationsExclusiveScanAMD(u16vec3);" |
3025 | 883 | "u16vec4 addInvocationsExclusiveScanAMD(u16vec4);" |
3026 | | |
3027 | 883 | "float minInvocationsNonUniformAMD(float);" |
3028 | 883 | "vec2 minInvocationsNonUniformAMD(vec2);" |
3029 | 883 | "vec3 minInvocationsNonUniformAMD(vec3);" |
3030 | 883 | "vec4 minInvocationsNonUniformAMD(vec4);" |
3031 | | |
3032 | 883 | "int minInvocationsNonUniformAMD(int);" |
3033 | 883 | "ivec2 minInvocationsNonUniformAMD(ivec2);" |
3034 | 883 | "ivec3 minInvocationsNonUniformAMD(ivec3);" |
3035 | 883 | "ivec4 minInvocationsNonUniformAMD(ivec4);" |
3036 | | |
3037 | 883 | "uint minInvocationsNonUniformAMD(uint);" |
3038 | 883 | "uvec2 minInvocationsNonUniformAMD(uvec2);" |
3039 | 883 | "uvec3 minInvocationsNonUniformAMD(uvec3);" |
3040 | 883 | "uvec4 minInvocationsNonUniformAMD(uvec4);" |
3041 | | |
3042 | 883 | "double minInvocationsNonUniformAMD(double);" |
3043 | 883 | "dvec2 minInvocationsNonUniformAMD(dvec2);" |
3044 | 883 | "dvec3 minInvocationsNonUniformAMD(dvec3);" |
3045 | 883 | "dvec4 minInvocationsNonUniformAMD(dvec4);" |
3046 | | |
3047 | 883 | "int64_t minInvocationsNonUniformAMD(int64_t);" |
3048 | 883 | "i64vec2 minInvocationsNonUniformAMD(i64vec2);" |
3049 | 883 | "i64vec3 minInvocationsNonUniformAMD(i64vec3);" |
3050 | 883 | "i64vec4 minInvocationsNonUniformAMD(i64vec4);" |
3051 | | |
3052 | 883 | "uint64_t minInvocationsNonUniformAMD(uint64_t);" |
3053 | 883 | "u64vec2 minInvocationsNonUniformAMD(u64vec2);" |
3054 | 883 | "u64vec3 minInvocationsNonUniformAMD(u64vec3);" |
3055 | 883 | "u64vec4 minInvocationsNonUniformAMD(u64vec4);" |
3056 | | |
3057 | 883 | "float16_t minInvocationsNonUniformAMD(float16_t);" |
3058 | 883 | "f16vec2 minInvocationsNonUniformAMD(f16vec2);" |
3059 | 883 | "f16vec3 minInvocationsNonUniformAMD(f16vec3);" |
3060 | 883 | "f16vec4 minInvocationsNonUniformAMD(f16vec4);" |
3061 | | |
3062 | 883 | "int16_t minInvocationsNonUniformAMD(int16_t);" |
3063 | 883 | "i16vec2 minInvocationsNonUniformAMD(i16vec2);" |
3064 | 883 | "i16vec3 minInvocationsNonUniformAMD(i16vec3);" |
3065 | 883 | "i16vec4 minInvocationsNonUniformAMD(i16vec4);" |
3066 | | |
3067 | 883 | "uint16_t minInvocationsNonUniformAMD(uint16_t);" |
3068 | 883 | "u16vec2 minInvocationsNonUniformAMD(u16vec2);" |
3069 | 883 | "u16vec3 minInvocationsNonUniformAMD(u16vec3);" |
3070 | 883 | "u16vec4 minInvocationsNonUniformAMD(u16vec4);" |
3071 | | |
3072 | 883 | "float minInvocationsInclusiveScanNonUniformAMD(float);" |
3073 | 883 | "vec2 minInvocationsInclusiveScanNonUniformAMD(vec2);" |
3074 | 883 | "vec3 minInvocationsInclusiveScanNonUniformAMD(vec3);" |
3075 | 883 | "vec4 minInvocationsInclusiveScanNonUniformAMD(vec4);" |
3076 | | |
3077 | 883 | "int minInvocationsInclusiveScanNonUniformAMD(int);" |
3078 | 883 | "ivec2 minInvocationsInclusiveScanNonUniformAMD(ivec2);" |
3079 | 883 | "ivec3 minInvocationsInclusiveScanNonUniformAMD(ivec3);" |
3080 | 883 | "ivec4 minInvocationsInclusiveScanNonUniformAMD(ivec4);" |
3081 | | |
3082 | 883 | "uint minInvocationsInclusiveScanNonUniformAMD(uint);" |
3083 | 883 | "uvec2 minInvocationsInclusiveScanNonUniformAMD(uvec2);" |
3084 | 883 | "uvec3 minInvocationsInclusiveScanNonUniformAMD(uvec3);" |
3085 | 883 | "uvec4 minInvocationsInclusiveScanNonUniformAMD(uvec4);" |
3086 | | |
3087 | 883 | "double minInvocationsInclusiveScanNonUniformAMD(double);" |
3088 | 883 | "dvec2 minInvocationsInclusiveScanNonUniformAMD(dvec2);" |
3089 | 883 | "dvec3 minInvocationsInclusiveScanNonUniformAMD(dvec3);" |
3090 | 883 | "dvec4 minInvocationsInclusiveScanNonUniformAMD(dvec4);" |
3091 | | |
3092 | 883 | "int64_t minInvocationsInclusiveScanNonUniformAMD(int64_t);" |
3093 | 883 | "i64vec2 minInvocationsInclusiveScanNonUniformAMD(i64vec2);" |
3094 | 883 | "i64vec3 minInvocationsInclusiveScanNonUniformAMD(i64vec3);" |
3095 | 883 | "i64vec4 minInvocationsInclusiveScanNonUniformAMD(i64vec4);" |
3096 | | |
3097 | 883 | "uint64_t minInvocationsInclusiveScanNonUniformAMD(uint64_t);" |
3098 | 883 | "u64vec2 minInvocationsInclusiveScanNonUniformAMD(u64vec2);" |
3099 | 883 | "u64vec3 minInvocationsInclusiveScanNonUniformAMD(u64vec3);" |
3100 | 883 | "u64vec4 minInvocationsInclusiveScanNonUniformAMD(u64vec4);" |
3101 | | |
3102 | 883 | "float16_t minInvocationsInclusiveScanNonUniformAMD(float16_t);" |
3103 | 883 | "f16vec2 minInvocationsInclusiveScanNonUniformAMD(f16vec2);" |
3104 | 883 | "f16vec3 minInvocationsInclusiveScanNonUniformAMD(f16vec3);" |
3105 | 883 | "f16vec4 minInvocationsInclusiveScanNonUniformAMD(f16vec4);" |
3106 | | |
3107 | 883 | "int16_t minInvocationsInclusiveScanNonUniformAMD(int16_t);" |
3108 | 883 | "i16vec2 minInvocationsInclusiveScanNonUniformAMD(i16vec2);" |
3109 | 883 | "i16vec3 minInvocationsInclusiveScanNonUniformAMD(i16vec3);" |
3110 | 883 | "i16vec4 minInvocationsInclusiveScanNonUniformAMD(i16vec4);" |
3111 | | |
3112 | 883 | "uint16_t minInvocationsInclusiveScanNonUniformAMD(uint16_t);" |
3113 | 883 | "u16vec2 minInvocationsInclusiveScanNonUniformAMD(u16vec2);" |
3114 | 883 | "u16vec3 minInvocationsInclusiveScanNonUniformAMD(u16vec3);" |
3115 | 883 | "u16vec4 minInvocationsInclusiveScanNonUniformAMD(u16vec4);" |
3116 | | |
3117 | 883 | "float minInvocationsExclusiveScanNonUniformAMD(float);" |
3118 | 883 | "vec2 minInvocationsExclusiveScanNonUniformAMD(vec2);" |
3119 | 883 | "vec3 minInvocationsExclusiveScanNonUniformAMD(vec3);" |
3120 | 883 | "vec4 minInvocationsExclusiveScanNonUniformAMD(vec4);" |
3121 | | |
3122 | 883 | "int minInvocationsExclusiveScanNonUniformAMD(int);" |
3123 | 883 | "ivec2 minInvocationsExclusiveScanNonUniformAMD(ivec2);" |
3124 | 883 | "ivec3 minInvocationsExclusiveScanNonUniformAMD(ivec3);" |
3125 | 883 | "ivec4 minInvocationsExclusiveScanNonUniformAMD(ivec4);" |
3126 | | |
3127 | 883 | "uint minInvocationsExclusiveScanNonUniformAMD(uint);" |
3128 | 883 | "uvec2 minInvocationsExclusiveScanNonUniformAMD(uvec2);" |
3129 | 883 | "uvec3 minInvocationsExclusiveScanNonUniformAMD(uvec3);" |
3130 | 883 | "uvec4 minInvocationsExclusiveScanNonUniformAMD(uvec4);" |
3131 | | |
3132 | 883 | "double minInvocationsExclusiveScanNonUniformAMD(double);" |
3133 | 883 | "dvec2 minInvocationsExclusiveScanNonUniformAMD(dvec2);" |
3134 | 883 | "dvec3 minInvocationsExclusiveScanNonUniformAMD(dvec3);" |
3135 | 883 | "dvec4 minInvocationsExclusiveScanNonUniformAMD(dvec4);" |
3136 | | |
3137 | 883 | "int64_t minInvocationsExclusiveScanNonUniformAMD(int64_t);" |
3138 | 883 | "i64vec2 minInvocationsExclusiveScanNonUniformAMD(i64vec2);" |
3139 | 883 | "i64vec3 minInvocationsExclusiveScanNonUniformAMD(i64vec3);" |
3140 | 883 | "i64vec4 minInvocationsExclusiveScanNonUniformAMD(i64vec4);" |
3141 | | |
3142 | 883 | "uint64_t minInvocationsExclusiveScanNonUniformAMD(uint64_t);" |
3143 | 883 | "u64vec2 minInvocationsExclusiveScanNonUniformAMD(u64vec2);" |
3144 | 883 | "u64vec3 minInvocationsExclusiveScanNonUniformAMD(u64vec3);" |
3145 | 883 | "u64vec4 minInvocationsExclusiveScanNonUniformAMD(u64vec4);" |
3146 | | |
3147 | 883 | "float16_t minInvocationsExclusiveScanNonUniformAMD(float16_t);" |
3148 | 883 | "f16vec2 minInvocationsExclusiveScanNonUniformAMD(f16vec2);" |
3149 | 883 | "f16vec3 minInvocationsExclusiveScanNonUniformAMD(f16vec3);" |
3150 | 883 | "f16vec4 minInvocationsExclusiveScanNonUniformAMD(f16vec4);" |
3151 | | |
3152 | 883 | "int16_t minInvocationsExclusiveScanNonUniformAMD(int16_t);" |
3153 | 883 | "i16vec2 minInvocationsExclusiveScanNonUniformAMD(i16vec2);" |
3154 | 883 | "i16vec3 minInvocationsExclusiveScanNonUniformAMD(i16vec3);" |
3155 | 883 | "i16vec4 minInvocationsExclusiveScanNonUniformAMD(i16vec4);" |
3156 | | |
3157 | 883 | "uint16_t minInvocationsExclusiveScanNonUniformAMD(uint16_t);" |
3158 | 883 | "u16vec2 minInvocationsExclusiveScanNonUniformAMD(u16vec2);" |
3159 | 883 | "u16vec3 minInvocationsExclusiveScanNonUniformAMD(u16vec3);" |
3160 | 883 | "u16vec4 minInvocationsExclusiveScanNonUniformAMD(u16vec4);" |
3161 | | |
3162 | 883 | "float maxInvocationsNonUniformAMD(float);" |
3163 | 883 | "vec2 maxInvocationsNonUniformAMD(vec2);" |
3164 | 883 | "vec3 maxInvocationsNonUniformAMD(vec3);" |
3165 | 883 | "vec4 maxInvocationsNonUniformAMD(vec4);" |
3166 | | |
3167 | 883 | "int maxInvocationsNonUniformAMD(int);" |
3168 | 883 | "ivec2 maxInvocationsNonUniformAMD(ivec2);" |
3169 | 883 | "ivec3 maxInvocationsNonUniformAMD(ivec3);" |
3170 | 883 | "ivec4 maxInvocationsNonUniformAMD(ivec4);" |
3171 | | |
3172 | 883 | "uint maxInvocationsNonUniformAMD(uint);" |
3173 | 883 | "uvec2 maxInvocationsNonUniformAMD(uvec2);" |
3174 | 883 | "uvec3 maxInvocationsNonUniformAMD(uvec3);" |
3175 | 883 | "uvec4 maxInvocationsNonUniformAMD(uvec4);" |
3176 | | |
3177 | 883 | "double maxInvocationsNonUniformAMD(double);" |
3178 | 883 | "dvec2 maxInvocationsNonUniformAMD(dvec2);" |
3179 | 883 | "dvec3 maxInvocationsNonUniformAMD(dvec3);" |
3180 | 883 | "dvec4 maxInvocationsNonUniformAMD(dvec4);" |
3181 | | |
3182 | 883 | "int64_t maxInvocationsNonUniformAMD(int64_t);" |
3183 | 883 | "i64vec2 maxInvocationsNonUniformAMD(i64vec2);" |
3184 | 883 | "i64vec3 maxInvocationsNonUniformAMD(i64vec3);" |
3185 | 883 | "i64vec4 maxInvocationsNonUniformAMD(i64vec4);" |
3186 | | |
3187 | 883 | "uint64_t maxInvocationsNonUniformAMD(uint64_t);" |
3188 | 883 | "u64vec2 maxInvocationsNonUniformAMD(u64vec2);" |
3189 | 883 | "u64vec3 maxInvocationsNonUniformAMD(u64vec3);" |
3190 | 883 | "u64vec4 maxInvocationsNonUniformAMD(u64vec4);" |
3191 | | |
3192 | 883 | "float16_t maxInvocationsNonUniformAMD(float16_t);" |
3193 | 883 | "f16vec2 maxInvocationsNonUniformAMD(f16vec2);" |
3194 | 883 | "f16vec3 maxInvocationsNonUniformAMD(f16vec3);" |
3195 | 883 | "f16vec4 maxInvocationsNonUniformAMD(f16vec4);" |
3196 | | |
3197 | 883 | "int16_t maxInvocationsNonUniformAMD(int16_t);" |
3198 | 883 | "i16vec2 maxInvocationsNonUniformAMD(i16vec2);" |
3199 | 883 | "i16vec3 maxInvocationsNonUniformAMD(i16vec3);" |
3200 | 883 | "i16vec4 maxInvocationsNonUniformAMD(i16vec4);" |
3201 | | |
3202 | 883 | "uint16_t maxInvocationsNonUniformAMD(uint16_t);" |
3203 | 883 | "u16vec2 maxInvocationsNonUniformAMD(u16vec2);" |
3204 | 883 | "u16vec3 maxInvocationsNonUniformAMD(u16vec3);" |
3205 | 883 | "u16vec4 maxInvocationsNonUniformAMD(u16vec4);" |
3206 | | |
3207 | 883 | "float maxInvocationsInclusiveScanNonUniformAMD(float);" |
3208 | 883 | "vec2 maxInvocationsInclusiveScanNonUniformAMD(vec2);" |
3209 | 883 | "vec3 maxInvocationsInclusiveScanNonUniformAMD(vec3);" |
3210 | 883 | "vec4 maxInvocationsInclusiveScanNonUniformAMD(vec4);" |
3211 | | |
3212 | 883 | "int maxInvocationsInclusiveScanNonUniformAMD(int);" |
3213 | 883 | "ivec2 maxInvocationsInclusiveScanNonUniformAMD(ivec2);" |
3214 | 883 | "ivec3 maxInvocationsInclusiveScanNonUniformAMD(ivec3);" |
3215 | 883 | "ivec4 maxInvocationsInclusiveScanNonUniformAMD(ivec4);" |
3216 | | |
3217 | 883 | "uint maxInvocationsInclusiveScanNonUniformAMD(uint);" |
3218 | 883 | "uvec2 maxInvocationsInclusiveScanNonUniformAMD(uvec2);" |
3219 | 883 | "uvec3 maxInvocationsInclusiveScanNonUniformAMD(uvec3);" |
3220 | 883 | "uvec4 maxInvocationsInclusiveScanNonUniformAMD(uvec4);" |
3221 | | |
3222 | 883 | "double maxInvocationsInclusiveScanNonUniformAMD(double);" |
3223 | 883 | "dvec2 maxInvocationsInclusiveScanNonUniformAMD(dvec2);" |
3224 | 883 | "dvec3 maxInvocationsInclusiveScanNonUniformAMD(dvec3);" |
3225 | 883 | "dvec4 maxInvocationsInclusiveScanNonUniformAMD(dvec4);" |
3226 | | |
3227 | 883 | "int64_t maxInvocationsInclusiveScanNonUniformAMD(int64_t);" |
3228 | 883 | "i64vec2 maxInvocationsInclusiveScanNonUniformAMD(i64vec2);" |
3229 | 883 | "i64vec3 maxInvocationsInclusiveScanNonUniformAMD(i64vec3);" |
3230 | 883 | "i64vec4 maxInvocationsInclusiveScanNonUniformAMD(i64vec4);" |
3231 | | |
3232 | 883 | "uint64_t maxInvocationsInclusiveScanNonUniformAMD(uint64_t);" |
3233 | 883 | "u64vec2 maxInvocationsInclusiveScanNonUniformAMD(u64vec2);" |
3234 | 883 | "u64vec3 maxInvocationsInclusiveScanNonUniformAMD(u64vec3);" |
3235 | 883 | "u64vec4 maxInvocationsInclusiveScanNonUniformAMD(u64vec4);" |
3236 | | |
3237 | 883 | "float16_t maxInvocationsInclusiveScanNonUniformAMD(float16_t);" |
3238 | 883 | "f16vec2 maxInvocationsInclusiveScanNonUniformAMD(f16vec2);" |
3239 | 883 | "f16vec3 maxInvocationsInclusiveScanNonUniformAMD(f16vec3);" |
3240 | 883 | "f16vec4 maxInvocationsInclusiveScanNonUniformAMD(f16vec4);" |
3241 | | |
3242 | 883 | "int16_t maxInvocationsInclusiveScanNonUniformAMD(int16_t);" |
3243 | 883 | "i16vec2 maxInvocationsInclusiveScanNonUniformAMD(i16vec2);" |
3244 | 883 | "i16vec3 maxInvocationsInclusiveScanNonUniformAMD(i16vec3);" |
3245 | 883 | "i16vec4 maxInvocationsInclusiveScanNonUniformAMD(i16vec4);" |
3246 | | |
3247 | 883 | "uint16_t maxInvocationsInclusiveScanNonUniformAMD(uint16_t);" |
3248 | 883 | "u16vec2 maxInvocationsInclusiveScanNonUniformAMD(u16vec2);" |
3249 | 883 | "u16vec3 maxInvocationsInclusiveScanNonUniformAMD(u16vec3);" |
3250 | 883 | "u16vec4 maxInvocationsInclusiveScanNonUniformAMD(u16vec4);" |
3251 | | |
3252 | 883 | "float maxInvocationsExclusiveScanNonUniformAMD(float);" |
3253 | 883 | "vec2 maxInvocationsExclusiveScanNonUniformAMD(vec2);" |
3254 | 883 | "vec3 maxInvocationsExclusiveScanNonUniformAMD(vec3);" |
3255 | 883 | "vec4 maxInvocationsExclusiveScanNonUniformAMD(vec4);" |
3256 | | |
3257 | 883 | "int maxInvocationsExclusiveScanNonUniformAMD(int);" |
3258 | 883 | "ivec2 maxInvocationsExclusiveScanNonUniformAMD(ivec2);" |
3259 | 883 | "ivec3 maxInvocationsExclusiveScanNonUniformAMD(ivec3);" |
3260 | 883 | "ivec4 maxInvocationsExclusiveScanNonUniformAMD(ivec4);" |
3261 | | |
3262 | 883 | "uint maxInvocationsExclusiveScanNonUniformAMD(uint);" |
3263 | 883 | "uvec2 maxInvocationsExclusiveScanNonUniformAMD(uvec2);" |
3264 | 883 | "uvec3 maxInvocationsExclusiveScanNonUniformAMD(uvec3);" |
3265 | 883 | "uvec4 maxInvocationsExclusiveScanNonUniformAMD(uvec4);" |
3266 | | |
3267 | 883 | "double maxInvocationsExclusiveScanNonUniformAMD(double);" |
3268 | 883 | "dvec2 maxInvocationsExclusiveScanNonUniformAMD(dvec2);" |
3269 | 883 | "dvec3 maxInvocationsExclusiveScanNonUniformAMD(dvec3);" |
3270 | 883 | "dvec4 maxInvocationsExclusiveScanNonUniformAMD(dvec4);" |
3271 | | |
3272 | 883 | "int64_t maxInvocationsExclusiveScanNonUniformAMD(int64_t);" |
3273 | 883 | "i64vec2 maxInvocationsExclusiveScanNonUniformAMD(i64vec2);" |
3274 | 883 | "i64vec3 maxInvocationsExclusiveScanNonUniformAMD(i64vec3);" |
3275 | 883 | "i64vec4 maxInvocationsExclusiveScanNonUniformAMD(i64vec4);" |
3276 | | |
3277 | 883 | "uint64_t maxInvocationsExclusiveScanNonUniformAMD(uint64_t);" |
3278 | 883 | "u64vec2 maxInvocationsExclusiveScanNonUniformAMD(u64vec2);" |
3279 | 883 | "u64vec3 maxInvocationsExclusiveScanNonUniformAMD(u64vec3);" |
3280 | 883 | "u64vec4 maxInvocationsExclusiveScanNonUniformAMD(u64vec4);" |
3281 | | |
3282 | 883 | "float16_t maxInvocationsExclusiveScanNonUniformAMD(float16_t);" |
3283 | 883 | "f16vec2 maxInvocationsExclusiveScanNonUniformAMD(f16vec2);" |
3284 | 883 | "f16vec3 maxInvocationsExclusiveScanNonUniformAMD(f16vec3);" |
3285 | 883 | "f16vec4 maxInvocationsExclusiveScanNonUniformAMD(f16vec4);" |
3286 | | |
3287 | 883 | "int16_t maxInvocationsExclusiveScanNonUniformAMD(int16_t);" |
3288 | 883 | "i16vec2 maxInvocationsExclusiveScanNonUniformAMD(i16vec2);" |
3289 | 883 | "i16vec3 maxInvocationsExclusiveScanNonUniformAMD(i16vec3);" |
3290 | 883 | "i16vec4 maxInvocationsExclusiveScanNonUniformAMD(i16vec4);" |
3291 | | |
3292 | 883 | "uint16_t maxInvocationsExclusiveScanNonUniformAMD(uint16_t);" |
3293 | 883 | "u16vec2 maxInvocationsExclusiveScanNonUniformAMD(u16vec2);" |
3294 | 883 | "u16vec3 maxInvocationsExclusiveScanNonUniformAMD(u16vec3);" |
3295 | 883 | "u16vec4 maxInvocationsExclusiveScanNonUniformAMD(u16vec4);" |
3296 | | |
3297 | 883 | "float addInvocationsNonUniformAMD(float);" |
3298 | 883 | "vec2 addInvocationsNonUniformAMD(vec2);" |
3299 | 883 | "vec3 addInvocationsNonUniformAMD(vec3);" |
3300 | 883 | "vec4 addInvocationsNonUniformAMD(vec4);" |
3301 | | |
3302 | 883 | "int addInvocationsNonUniformAMD(int);" |
3303 | 883 | "ivec2 addInvocationsNonUniformAMD(ivec2);" |
3304 | 883 | "ivec3 addInvocationsNonUniformAMD(ivec3);" |
3305 | 883 | "ivec4 addInvocationsNonUniformAMD(ivec4);" |
3306 | | |
3307 | 883 | "uint addInvocationsNonUniformAMD(uint);" |
3308 | 883 | "uvec2 addInvocationsNonUniformAMD(uvec2);" |
3309 | 883 | "uvec3 addInvocationsNonUniformAMD(uvec3);" |
3310 | 883 | "uvec4 addInvocationsNonUniformAMD(uvec4);" |
3311 | | |
3312 | 883 | "double addInvocationsNonUniformAMD(double);" |
3313 | 883 | "dvec2 addInvocationsNonUniformAMD(dvec2);" |
3314 | 883 | "dvec3 addInvocationsNonUniformAMD(dvec3);" |
3315 | 883 | "dvec4 addInvocationsNonUniformAMD(dvec4);" |
3316 | | |
3317 | 883 | "int64_t addInvocationsNonUniformAMD(int64_t);" |
3318 | 883 | "i64vec2 addInvocationsNonUniformAMD(i64vec2);" |
3319 | 883 | "i64vec3 addInvocationsNonUniformAMD(i64vec3);" |
3320 | 883 | "i64vec4 addInvocationsNonUniformAMD(i64vec4);" |
3321 | | |
3322 | 883 | "uint64_t addInvocationsNonUniformAMD(uint64_t);" |
3323 | 883 | "u64vec2 addInvocationsNonUniformAMD(u64vec2);" |
3324 | 883 | "u64vec3 addInvocationsNonUniformAMD(u64vec3);" |
3325 | 883 | "u64vec4 addInvocationsNonUniformAMD(u64vec4);" |
3326 | | |
3327 | 883 | "float16_t addInvocationsNonUniformAMD(float16_t);" |
3328 | 883 | "f16vec2 addInvocationsNonUniformAMD(f16vec2);" |
3329 | 883 | "f16vec3 addInvocationsNonUniformAMD(f16vec3);" |
3330 | 883 | "f16vec4 addInvocationsNonUniformAMD(f16vec4);" |
3331 | | |
3332 | 883 | "int16_t addInvocationsNonUniformAMD(int16_t);" |
3333 | 883 | "i16vec2 addInvocationsNonUniformAMD(i16vec2);" |
3334 | 883 | "i16vec3 addInvocationsNonUniformAMD(i16vec3);" |
3335 | 883 | "i16vec4 addInvocationsNonUniformAMD(i16vec4);" |
3336 | | |
3337 | 883 | "uint16_t addInvocationsNonUniformAMD(uint16_t);" |
3338 | 883 | "u16vec2 addInvocationsNonUniformAMD(u16vec2);" |
3339 | 883 | "u16vec3 addInvocationsNonUniformAMD(u16vec3);" |
3340 | 883 | "u16vec4 addInvocationsNonUniformAMD(u16vec4);" |
3341 | | |
3342 | 883 | "float addInvocationsInclusiveScanNonUniformAMD(float);" |
3343 | 883 | "vec2 addInvocationsInclusiveScanNonUniformAMD(vec2);" |
3344 | 883 | "vec3 addInvocationsInclusiveScanNonUniformAMD(vec3);" |
3345 | 883 | "vec4 addInvocationsInclusiveScanNonUniformAMD(vec4);" |
3346 | | |
3347 | 883 | "int addInvocationsInclusiveScanNonUniformAMD(int);" |
3348 | 883 | "ivec2 addInvocationsInclusiveScanNonUniformAMD(ivec2);" |
3349 | 883 | "ivec3 addInvocationsInclusiveScanNonUniformAMD(ivec3);" |
3350 | 883 | "ivec4 addInvocationsInclusiveScanNonUniformAMD(ivec4);" |
3351 | | |
3352 | 883 | "uint addInvocationsInclusiveScanNonUniformAMD(uint);" |
3353 | 883 | "uvec2 addInvocationsInclusiveScanNonUniformAMD(uvec2);" |
3354 | 883 | "uvec3 addInvocationsInclusiveScanNonUniformAMD(uvec3);" |
3355 | 883 | "uvec4 addInvocationsInclusiveScanNonUniformAMD(uvec4);" |
3356 | | |
3357 | 883 | "double addInvocationsInclusiveScanNonUniformAMD(double);" |
3358 | 883 | "dvec2 addInvocationsInclusiveScanNonUniformAMD(dvec2);" |
3359 | 883 | "dvec3 addInvocationsInclusiveScanNonUniformAMD(dvec3);" |
3360 | 883 | "dvec4 addInvocationsInclusiveScanNonUniformAMD(dvec4);" |
3361 | | |
3362 | 883 | "int64_t addInvocationsInclusiveScanNonUniformAMD(int64_t);" |
3363 | 883 | "i64vec2 addInvocationsInclusiveScanNonUniformAMD(i64vec2);" |
3364 | 883 | "i64vec3 addInvocationsInclusiveScanNonUniformAMD(i64vec3);" |
3365 | 883 | "i64vec4 addInvocationsInclusiveScanNonUniformAMD(i64vec4);" |
3366 | | |
3367 | 883 | "uint64_t addInvocationsInclusiveScanNonUniformAMD(uint64_t);" |
3368 | 883 | "u64vec2 addInvocationsInclusiveScanNonUniformAMD(u64vec2);" |
3369 | 883 | "u64vec3 addInvocationsInclusiveScanNonUniformAMD(u64vec3);" |
3370 | 883 | "u64vec4 addInvocationsInclusiveScanNonUniformAMD(u64vec4);" |
3371 | | |
3372 | 883 | "float16_t addInvocationsInclusiveScanNonUniformAMD(float16_t);" |
3373 | 883 | "f16vec2 addInvocationsInclusiveScanNonUniformAMD(f16vec2);" |
3374 | 883 | "f16vec3 addInvocationsInclusiveScanNonUniformAMD(f16vec3);" |
3375 | 883 | "f16vec4 addInvocationsInclusiveScanNonUniformAMD(f16vec4);" |
3376 | | |
3377 | 883 | "int16_t addInvocationsInclusiveScanNonUniformAMD(int16_t);" |
3378 | 883 | "i16vec2 addInvocationsInclusiveScanNonUniformAMD(i16vec2);" |
3379 | 883 | "i16vec3 addInvocationsInclusiveScanNonUniformAMD(i16vec3);" |
3380 | 883 | "i16vec4 addInvocationsInclusiveScanNonUniformAMD(i16vec4);" |
3381 | | |
3382 | 883 | "uint16_t addInvocationsInclusiveScanNonUniformAMD(uint16_t);" |
3383 | 883 | "u16vec2 addInvocationsInclusiveScanNonUniformAMD(u16vec2);" |
3384 | 883 | "u16vec3 addInvocationsInclusiveScanNonUniformAMD(u16vec3);" |
3385 | 883 | "u16vec4 addInvocationsInclusiveScanNonUniformAMD(u16vec4);" |
3386 | | |
3387 | 883 | "float addInvocationsExclusiveScanNonUniformAMD(float);" |
3388 | 883 | "vec2 addInvocationsExclusiveScanNonUniformAMD(vec2);" |
3389 | 883 | "vec3 addInvocationsExclusiveScanNonUniformAMD(vec3);" |
3390 | 883 | "vec4 addInvocationsExclusiveScanNonUniformAMD(vec4);" |
3391 | | |
3392 | 883 | "int addInvocationsExclusiveScanNonUniformAMD(int);" |
3393 | 883 | "ivec2 addInvocationsExclusiveScanNonUniformAMD(ivec2);" |
3394 | 883 | "ivec3 addInvocationsExclusiveScanNonUniformAMD(ivec3);" |
3395 | 883 | "ivec4 addInvocationsExclusiveScanNonUniformAMD(ivec4);" |
3396 | | |
3397 | 883 | "uint addInvocationsExclusiveScanNonUniformAMD(uint);" |
3398 | 883 | "uvec2 addInvocationsExclusiveScanNonUniformAMD(uvec2);" |
3399 | 883 | "uvec3 addInvocationsExclusiveScanNonUniformAMD(uvec3);" |
3400 | 883 | "uvec4 addInvocationsExclusiveScanNonUniformAMD(uvec4);" |
3401 | | |
3402 | 883 | "double addInvocationsExclusiveScanNonUniformAMD(double);" |
3403 | 883 | "dvec2 addInvocationsExclusiveScanNonUniformAMD(dvec2);" |
3404 | 883 | "dvec3 addInvocationsExclusiveScanNonUniformAMD(dvec3);" |
3405 | 883 | "dvec4 addInvocationsExclusiveScanNonUniformAMD(dvec4);" |
3406 | | |
3407 | 883 | "int64_t addInvocationsExclusiveScanNonUniformAMD(int64_t);" |
3408 | 883 | "i64vec2 addInvocationsExclusiveScanNonUniformAMD(i64vec2);" |
3409 | 883 | "i64vec3 addInvocationsExclusiveScanNonUniformAMD(i64vec3);" |
3410 | 883 | "i64vec4 addInvocationsExclusiveScanNonUniformAMD(i64vec4);" |
3411 | | |
3412 | 883 | "uint64_t addInvocationsExclusiveScanNonUniformAMD(uint64_t);" |
3413 | 883 | "u64vec2 addInvocationsExclusiveScanNonUniformAMD(u64vec2);" |
3414 | 883 | "u64vec3 addInvocationsExclusiveScanNonUniformAMD(u64vec3);" |
3415 | 883 | "u64vec4 addInvocationsExclusiveScanNonUniformAMD(u64vec4);" |
3416 | | |
3417 | 883 | "float16_t addInvocationsExclusiveScanNonUniformAMD(float16_t);" |
3418 | 883 | "f16vec2 addInvocationsExclusiveScanNonUniformAMD(f16vec2);" |
3419 | 883 | "f16vec3 addInvocationsExclusiveScanNonUniformAMD(f16vec3);" |
3420 | 883 | "f16vec4 addInvocationsExclusiveScanNonUniformAMD(f16vec4);" |
3421 | | |
3422 | 883 | "int16_t addInvocationsExclusiveScanNonUniformAMD(int16_t);" |
3423 | 883 | "i16vec2 addInvocationsExclusiveScanNonUniformAMD(i16vec2);" |
3424 | 883 | "i16vec3 addInvocationsExclusiveScanNonUniformAMD(i16vec3);" |
3425 | 883 | "i16vec4 addInvocationsExclusiveScanNonUniformAMD(i16vec4);" |
3426 | | |
3427 | 883 | "uint16_t addInvocationsExclusiveScanNonUniformAMD(uint16_t);" |
3428 | 883 | "u16vec2 addInvocationsExclusiveScanNonUniformAMD(u16vec2);" |
3429 | 883 | "u16vec3 addInvocationsExclusiveScanNonUniformAMD(u16vec3);" |
3430 | 883 | "u16vec4 addInvocationsExclusiveScanNonUniformAMD(u16vec4);" |
3431 | | |
3432 | 883 | "float swizzleInvocationsAMD(float, uvec4);" |
3433 | 883 | "vec2 swizzleInvocationsAMD(vec2, uvec4);" |
3434 | 883 | "vec3 swizzleInvocationsAMD(vec3, uvec4);" |
3435 | 883 | "vec4 swizzleInvocationsAMD(vec4, uvec4);" |
3436 | | |
3437 | 883 | "int swizzleInvocationsAMD(int, uvec4);" |
3438 | 883 | "ivec2 swizzleInvocationsAMD(ivec2, uvec4);" |
3439 | 883 | "ivec3 swizzleInvocationsAMD(ivec3, uvec4);" |
3440 | 883 | "ivec4 swizzleInvocationsAMD(ivec4, uvec4);" |
3441 | | |
3442 | 883 | "uint swizzleInvocationsAMD(uint, uvec4);" |
3443 | 883 | "uvec2 swizzleInvocationsAMD(uvec2, uvec4);" |
3444 | 883 | "uvec3 swizzleInvocationsAMD(uvec3, uvec4);" |
3445 | 883 | "uvec4 swizzleInvocationsAMD(uvec4, uvec4);" |
3446 | | |
3447 | 883 | "float swizzleInvocationsMaskedAMD(float, uvec3);" |
3448 | 883 | "vec2 swizzleInvocationsMaskedAMD(vec2, uvec3);" |
3449 | 883 | "vec3 swizzleInvocationsMaskedAMD(vec3, uvec3);" |
3450 | 883 | "vec4 swizzleInvocationsMaskedAMD(vec4, uvec3);" |
3451 | | |
3452 | 883 | "int swizzleInvocationsMaskedAMD(int, uvec3);" |
3453 | 883 | "ivec2 swizzleInvocationsMaskedAMD(ivec2, uvec3);" |
3454 | 883 | "ivec3 swizzleInvocationsMaskedAMD(ivec3, uvec3);" |
3455 | 883 | "ivec4 swizzleInvocationsMaskedAMD(ivec4, uvec3);" |
3456 | | |
3457 | 883 | "uint swizzleInvocationsMaskedAMD(uint, uvec3);" |
3458 | 883 | "uvec2 swizzleInvocationsMaskedAMD(uvec2, uvec3);" |
3459 | 883 | "uvec3 swizzleInvocationsMaskedAMD(uvec3, uvec3);" |
3460 | 883 | "uvec4 swizzleInvocationsMaskedAMD(uvec4, uvec3);" |
3461 | | |
3462 | 883 | "float writeInvocationAMD(float, float, uint);" |
3463 | 883 | "vec2 writeInvocationAMD(vec2, vec2, uint);" |
3464 | 883 | "vec3 writeInvocationAMD(vec3, vec3, uint);" |
3465 | 883 | "vec4 writeInvocationAMD(vec4, vec4, uint);" |
3466 | | |
3467 | 883 | "int writeInvocationAMD(int, int, uint);" |
3468 | 883 | "ivec2 writeInvocationAMD(ivec2, ivec2, uint);" |
3469 | 883 | "ivec3 writeInvocationAMD(ivec3, ivec3, uint);" |
3470 | 883 | "ivec4 writeInvocationAMD(ivec4, ivec4, uint);" |
3471 | | |
3472 | 883 | "uint writeInvocationAMD(uint, uint, uint);" |
3473 | 883 | "uvec2 writeInvocationAMD(uvec2, uvec2, uint);" |
3474 | 883 | "uvec3 writeInvocationAMD(uvec3, uvec3, uint);" |
3475 | 883 | "uvec4 writeInvocationAMD(uvec4, uvec4, uint);" |
3476 | | |
3477 | 883 | "uint mbcntAMD(uint64_t);" |
3478 | | |
3479 | 883 | "\n"); |
3480 | 883 | } |
3481 | | |
3482 | | // GL_AMD_gcn_shader |
3483 | 4.34k | if (profile != EEsProfile && version >= 440) { |
3484 | 951 | commonBuiltins.append( |
3485 | 951 | "float cubeFaceIndexAMD(vec3);" |
3486 | 951 | "vec2 cubeFaceCoordAMD(vec3);" |
3487 | 951 | "uint64_t timeAMD();" |
3488 | | |
3489 | 951 | "in int gl_SIMDGroupSizeAMD;" |
3490 | 951 | "\n"); |
3491 | 951 | } |
3492 | | |
3493 | | // GL_AMD_shader_fragment_mask |
3494 | 4.34k | if (profile != EEsProfile && version >= 450) { |
3495 | 883 | commonBuiltins.append( |
3496 | 883 | "uint fragmentMaskFetchAMD(sampler2DMS, ivec2);" |
3497 | 883 | "uint fragmentMaskFetchAMD(isampler2DMS, ivec2);" |
3498 | 883 | "uint fragmentMaskFetchAMD(usampler2DMS, ivec2);" |
3499 | | |
3500 | 883 | "uint fragmentMaskFetchAMD(sampler2DMSArray, ivec3);" |
3501 | 883 | "uint fragmentMaskFetchAMD(isampler2DMSArray, ivec3);" |
3502 | 883 | "uint fragmentMaskFetchAMD(usampler2DMSArray, ivec3);" |
3503 | | |
3504 | 883 | "vec4 fragmentFetchAMD(sampler2DMS, ivec2, uint);" |
3505 | 883 | "ivec4 fragmentFetchAMD(isampler2DMS, ivec2, uint);" |
3506 | 883 | "uvec4 fragmentFetchAMD(usampler2DMS, ivec2, uint);" |
3507 | | |
3508 | 883 | "vec4 fragmentFetchAMD(sampler2DMSArray, ivec3, uint);" |
3509 | 883 | "ivec4 fragmentFetchAMD(isampler2DMSArray, ivec3, uint);" |
3510 | 883 | "uvec4 fragmentFetchAMD(usampler2DMSArray, ivec3, uint);" |
3511 | | |
3512 | 883 | "\n"); |
3513 | 883 | } |
3514 | | |
3515 | 4.34k | if ((profile != EEsProfile && version >= 130) || |
3516 | 4.34k | (profile == EEsProfile && version >= 300)) { |
3517 | 4.34k | commonBuiltins.append( |
3518 | 4.34k | "uint countLeadingZeros(uint);" |
3519 | 4.34k | "uvec2 countLeadingZeros(uvec2);" |
3520 | 4.34k | "uvec3 countLeadingZeros(uvec3);" |
3521 | 4.34k | "uvec4 countLeadingZeros(uvec4);" |
3522 | | |
3523 | 4.34k | "uint countTrailingZeros(uint);" |
3524 | 4.34k | "uvec2 countTrailingZeros(uvec2);" |
3525 | 4.34k | "uvec3 countTrailingZeros(uvec3);" |
3526 | 4.34k | "uvec4 countTrailingZeros(uvec4);" |
3527 | | |
3528 | 4.34k | "uint absoluteDifference(int, int);" |
3529 | 4.34k | "uvec2 absoluteDifference(ivec2, ivec2);" |
3530 | 4.34k | "uvec3 absoluteDifference(ivec3, ivec3);" |
3531 | 4.34k | "uvec4 absoluteDifference(ivec4, ivec4);" |
3532 | | |
3533 | 4.34k | "uint16_t absoluteDifference(int16_t, int16_t);" |
3534 | 4.34k | "u16vec2 absoluteDifference(i16vec2, i16vec2);" |
3535 | 4.34k | "u16vec3 absoluteDifference(i16vec3, i16vec3);" |
3536 | 4.34k | "u16vec4 absoluteDifference(i16vec4, i16vec4);" |
3537 | | |
3538 | 4.34k | "uint64_t absoluteDifference(int64_t, int64_t);" |
3539 | 4.34k | "u64vec2 absoluteDifference(i64vec2, i64vec2);" |
3540 | 4.34k | "u64vec3 absoluteDifference(i64vec3, i64vec3);" |
3541 | 4.34k | "u64vec4 absoluteDifference(i64vec4, i64vec4);" |
3542 | | |
3543 | 4.34k | "uint absoluteDifference(uint, uint);" |
3544 | 4.34k | "uvec2 absoluteDifference(uvec2, uvec2);" |
3545 | 4.34k | "uvec3 absoluteDifference(uvec3, uvec3);" |
3546 | 4.34k | "uvec4 absoluteDifference(uvec4, uvec4);" |
3547 | | |
3548 | 4.34k | "uint16_t absoluteDifference(uint16_t, uint16_t);" |
3549 | 4.34k | "u16vec2 absoluteDifference(u16vec2, u16vec2);" |
3550 | 4.34k | "u16vec3 absoluteDifference(u16vec3, u16vec3);" |
3551 | 4.34k | "u16vec4 absoluteDifference(u16vec4, u16vec4);" |
3552 | | |
3553 | 4.34k | "uint64_t absoluteDifference(uint64_t, uint64_t);" |
3554 | 4.34k | "u64vec2 absoluteDifference(u64vec2, u64vec2);" |
3555 | 4.34k | "u64vec3 absoluteDifference(u64vec3, u64vec3);" |
3556 | 4.34k | "u64vec4 absoluteDifference(u64vec4, u64vec4);" |
3557 | | |
3558 | 4.34k | "int addSaturate(int, int);" |
3559 | 4.34k | "ivec2 addSaturate(ivec2, ivec2);" |
3560 | 4.34k | "ivec3 addSaturate(ivec3, ivec3);" |
3561 | 4.34k | "ivec4 addSaturate(ivec4, ivec4);" |
3562 | | |
3563 | 4.34k | "int16_t addSaturate(int16_t, int16_t);" |
3564 | 4.34k | "i16vec2 addSaturate(i16vec2, i16vec2);" |
3565 | 4.34k | "i16vec3 addSaturate(i16vec3, i16vec3);" |
3566 | 4.34k | "i16vec4 addSaturate(i16vec4, i16vec4);" |
3567 | | |
3568 | 4.34k | "int64_t addSaturate(int64_t, int64_t);" |
3569 | 4.34k | "i64vec2 addSaturate(i64vec2, i64vec2);" |
3570 | 4.34k | "i64vec3 addSaturate(i64vec3, i64vec3);" |
3571 | 4.34k | "i64vec4 addSaturate(i64vec4, i64vec4);" |
3572 | | |
3573 | 4.34k | "uint addSaturate(uint, uint);" |
3574 | 4.34k | "uvec2 addSaturate(uvec2, uvec2);" |
3575 | 4.34k | "uvec3 addSaturate(uvec3, uvec3);" |
3576 | 4.34k | "uvec4 addSaturate(uvec4, uvec4);" |
3577 | | |
3578 | 4.34k | "uint16_t addSaturate(uint16_t, uint16_t);" |
3579 | 4.34k | "u16vec2 addSaturate(u16vec2, u16vec2);" |
3580 | 4.34k | "u16vec3 addSaturate(u16vec3, u16vec3);" |
3581 | 4.34k | "u16vec4 addSaturate(u16vec4, u16vec4);" |
3582 | | |
3583 | 4.34k | "uint64_t addSaturate(uint64_t, uint64_t);" |
3584 | 4.34k | "u64vec2 addSaturate(u64vec2, u64vec2);" |
3585 | 4.34k | "u64vec3 addSaturate(u64vec3, u64vec3);" |
3586 | 4.34k | "u64vec4 addSaturate(u64vec4, u64vec4);" |
3587 | | |
3588 | 4.34k | "int subtractSaturate(int, int);" |
3589 | 4.34k | "ivec2 subtractSaturate(ivec2, ivec2);" |
3590 | 4.34k | "ivec3 subtractSaturate(ivec3, ivec3);" |
3591 | 4.34k | "ivec4 subtractSaturate(ivec4, ivec4);" |
3592 | | |
3593 | 4.34k | "int16_t subtractSaturate(int16_t, int16_t);" |
3594 | 4.34k | "i16vec2 subtractSaturate(i16vec2, i16vec2);" |
3595 | 4.34k | "i16vec3 subtractSaturate(i16vec3, i16vec3);" |
3596 | 4.34k | "i16vec4 subtractSaturate(i16vec4, i16vec4);" |
3597 | | |
3598 | 4.34k | "int64_t subtractSaturate(int64_t, int64_t);" |
3599 | 4.34k | "i64vec2 subtractSaturate(i64vec2, i64vec2);" |
3600 | 4.34k | "i64vec3 subtractSaturate(i64vec3, i64vec3);" |
3601 | 4.34k | "i64vec4 subtractSaturate(i64vec4, i64vec4);" |
3602 | | |
3603 | 4.34k | "uint subtractSaturate(uint, uint);" |
3604 | 4.34k | "uvec2 subtractSaturate(uvec2, uvec2);" |
3605 | 4.34k | "uvec3 subtractSaturate(uvec3, uvec3);" |
3606 | 4.34k | "uvec4 subtractSaturate(uvec4, uvec4);" |
3607 | | |
3608 | 4.34k | "uint16_t subtractSaturate(uint16_t, uint16_t);" |
3609 | 4.34k | "u16vec2 subtractSaturate(u16vec2, u16vec2);" |
3610 | 4.34k | "u16vec3 subtractSaturate(u16vec3, u16vec3);" |
3611 | 4.34k | "u16vec4 subtractSaturate(u16vec4, u16vec4);" |
3612 | | |
3613 | 4.34k | "uint64_t subtractSaturate(uint64_t, uint64_t);" |
3614 | 4.34k | "u64vec2 subtractSaturate(u64vec2, u64vec2);" |
3615 | 4.34k | "u64vec3 subtractSaturate(u64vec3, u64vec3);" |
3616 | 4.34k | "u64vec4 subtractSaturate(u64vec4, u64vec4);" |
3617 | | |
3618 | 4.34k | "int average(int, int);" |
3619 | 4.34k | "ivec2 average(ivec2, ivec2);" |
3620 | 4.34k | "ivec3 average(ivec3, ivec3);" |
3621 | 4.34k | "ivec4 average(ivec4, ivec4);" |
3622 | | |
3623 | 4.34k | "int16_t average(int16_t, int16_t);" |
3624 | 4.34k | "i16vec2 average(i16vec2, i16vec2);" |
3625 | 4.34k | "i16vec3 average(i16vec3, i16vec3);" |
3626 | 4.34k | "i16vec4 average(i16vec4, i16vec4);" |
3627 | | |
3628 | 4.34k | "int64_t average(int64_t, int64_t);" |
3629 | 4.34k | "i64vec2 average(i64vec2, i64vec2);" |
3630 | 4.34k | "i64vec3 average(i64vec3, i64vec3);" |
3631 | 4.34k | "i64vec4 average(i64vec4, i64vec4);" |
3632 | | |
3633 | 4.34k | "uint average(uint, uint);" |
3634 | 4.34k | "uvec2 average(uvec2, uvec2);" |
3635 | 4.34k | "uvec3 average(uvec3, uvec3);" |
3636 | 4.34k | "uvec4 average(uvec4, uvec4);" |
3637 | | |
3638 | 4.34k | "uint16_t average(uint16_t, uint16_t);" |
3639 | 4.34k | "u16vec2 average(u16vec2, u16vec2);" |
3640 | 4.34k | "u16vec3 average(u16vec3, u16vec3);" |
3641 | 4.34k | "u16vec4 average(u16vec4, u16vec4);" |
3642 | | |
3643 | 4.34k | "uint64_t average(uint64_t, uint64_t);" |
3644 | 4.34k | "u64vec2 average(u64vec2, u64vec2);" |
3645 | 4.34k | "u64vec3 average(u64vec3, u64vec3);" |
3646 | 4.34k | "u64vec4 average(u64vec4, u64vec4);" |
3647 | | |
3648 | 4.34k | "int averageRounded(int, int);" |
3649 | 4.34k | "ivec2 averageRounded(ivec2, ivec2);" |
3650 | 4.34k | "ivec3 averageRounded(ivec3, ivec3);" |
3651 | 4.34k | "ivec4 averageRounded(ivec4, ivec4);" |
3652 | | |
3653 | 4.34k | "int16_t averageRounded(int16_t, int16_t);" |
3654 | 4.34k | "i16vec2 averageRounded(i16vec2, i16vec2);" |
3655 | 4.34k | "i16vec3 averageRounded(i16vec3, i16vec3);" |
3656 | 4.34k | "i16vec4 averageRounded(i16vec4, i16vec4);" |
3657 | | |
3658 | 4.34k | "int64_t averageRounded(int64_t, int64_t);" |
3659 | 4.34k | "i64vec2 averageRounded(i64vec2, i64vec2);" |
3660 | 4.34k | "i64vec3 averageRounded(i64vec3, i64vec3);" |
3661 | 4.34k | "i64vec4 averageRounded(i64vec4, i64vec4);" |
3662 | | |
3663 | 4.34k | "uint averageRounded(uint, uint);" |
3664 | 4.34k | "uvec2 averageRounded(uvec2, uvec2);" |
3665 | 4.34k | "uvec3 averageRounded(uvec3, uvec3);" |
3666 | 4.34k | "uvec4 averageRounded(uvec4, uvec4);" |
3667 | | |
3668 | 4.34k | "uint16_t averageRounded(uint16_t, uint16_t);" |
3669 | 4.34k | "u16vec2 averageRounded(u16vec2, u16vec2);" |
3670 | 4.34k | "u16vec3 averageRounded(u16vec3, u16vec3);" |
3671 | 4.34k | "u16vec4 averageRounded(u16vec4, u16vec4);" |
3672 | | |
3673 | 4.34k | "uint64_t averageRounded(uint64_t, uint64_t);" |
3674 | 4.34k | "u64vec2 averageRounded(u64vec2, u64vec2);" |
3675 | 4.34k | "u64vec3 averageRounded(u64vec3, u64vec3);" |
3676 | 4.34k | "u64vec4 averageRounded(u64vec4, u64vec4);" |
3677 | | |
3678 | 4.34k | "int multiply32x16(int, int);" |
3679 | 4.34k | "ivec2 multiply32x16(ivec2, ivec2);" |
3680 | 4.34k | "ivec3 multiply32x16(ivec3, ivec3);" |
3681 | 4.34k | "ivec4 multiply32x16(ivec4, ivec4);" |
3682 | | |
3683 | 4.34k | "uint multiply32x16(uint, uint);" |
3684 | 4.34k | "uvec2 multiply32x16(uvec2, uvec2);" |
3685 | 4.34k | "uvec3 multiply32x16(uvec3, uvec3);" |
3686 | 4.34k | "uvec4 multiply32x16(uvec4, uvec4);" |
3687 | 4.34k | "\n"); |
3688 | 4.34k | } |
3689 | | |
3690 | 4.34k | if ((profile != EEsProfile && version >= 450) || |
3691 | 3.45k | (profile == EEsProfile && version >= 320)) { |
3692 | 927 | commonBuiltins.append( |
3693 | 927 | "struct gl_TextureFootprint2DNV {" |
3694 | 927 | "uvec2 anchor;" |
3695 | 927 | "uvec2 offset;" |
3696 | 927 | "uvec2 mask;" |
3697 | 927 | "uint lod;" |
3698 | 927 | "uint granularity;" |
3699 | 927 | "};" |
3700 | | |
3701 | 927 | "struct gl_TextureFootprint3DNV {" |
3702 | 927 | "uvec3 anchor;" |
3703 | 927 | "uvec3 offset;" |
3704 | 927 | "uvec2 mask;" |
3705 | 927 | "uint lod;" |
3706 | 927 | "uint granularity;" |
3707 | 927 | "};" |
3708 | 927 | "bool textureFootprintNV(sampler2D, vec2, int, bool, out gl_TextureFootprint2DNV);" |
3709 | 927 | "bool textureFootprintNV(sampler3D, vec3, int, bool, out gl_TextureFootprint3DNV);" |
3710 | 927 | "bool textureFootprintNV(sampler2D, vec2, int, bool, out gl_TextureFootprint2DNV, float);" |
3711 | 927 | "bool textureFootprintNV(sampler3D, vec3, int, bool, out gl_TextureFootprint3DNV, float);" |
3712 | 927 | "bool textureFootprintClampNV(sampler2D, vec2, float, int, bool, out gl_TextureFootprint2DNV);" |
3713 | 927 | "bool textureFootprintClampNV(sampler3D, vec3, float, int, bool, out gl_TextureFootprint3DNV);" |
3714 | 927 | "bool textureFootprintClampNV(sampler2D, vec2, float, int, bool, out gl_TextureFootprint2DNV, float);" |
3715 | 927 | "bool textureFootprintClampNV(sampler3D, vec3, float, int, bool, out gl_TextureFootprint3DNV, float);" |
3716 | 927 | "bool textureFootprintLodNV(sampler2D, vec2, float, int, bool, out gl_TextureFootprint2DNV);" |
3717 | 927 | "bool textureFootprintLodNV(sampler3D, vec3, float, int, bool, out gl_TextureFootprint3DNV);" |
3718 | 927 | "bool textureFootprintGradNV(sampler2D, vec2, vec2, vec2, int, bool, out gl_TextureFootprint2DNV);" |
3719 | 927 | "bool textureFootprintGradClampNV(sampler2D, vec2, vec2, vec2, float, int, bool, out gl_TextureFootprint2DNV);" |
3720 | 927 | "\n"); |
3721 | 927 | } |
3722 | | |
3723 | 4.34k | if ((profile == EEsProfile && version >= 300 && version < 310) || |
3724 | 4.34k | (profile != EEsProfile && version >= 150 && version < 450)) { // GL_EXT_shader_integer_mix |
3725 | 886 | commonBuiltins.append("int mix(int, int, bool);" |
3726 | 886 | "ivec2 mix(ivec2, ivec2, bvec2);" |
3727 | 886 | "ivec3 mix(ivec3, ivec3, bvec3);" |
3728 | 886 | "ivec4 mix(ivec4, ivec4, bvec4);" |
3729 | 886 | "uint mix(uint, uint, bool );" |
3730 | 886 | "uvec2 mix(uvec2, uvec2, bvec2);" |
3731 | 886 | "uvec3 mix(uvec3, uvec3, bvec3);" |
3732 | 886 | "uvec4 mix(uvec4, uvec4, bvec4);" |
3733 | 886 | "bool mix(bool, bool, bool );" |
3734 | 886 | "bvec2 mix(bvec2, bvec2, bvec2);" |
3735 | 886 | "bvec3 mix(bvec3, bvec3, bvec3);" |
3736 | 886 | "bvec4 mix(bvec4, bvec4, bvec4);" |
3737 | | |
3738 | 886 | "\n"); |
3739 | 886 | } |
3740 | | |
3741 | | // GL_AMD_gpu_shader_half_float/Explicit types |
3742 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { |
3743 | 1.14k | commonBuiltins.append( |
3744 | 1.14k | "float16_t radians(float16_t);" |
3745 | 1.14k | "f16vec2 radians(f16vec2);" |
3746 | 1.14k | "f16vec3 radians(f16vec3);" |
3747 | 1.14k | "f16vec4 radians(f16vec4);" |
3748 | | |
3749 | 1.14k | "float16_t degrees(float16_t);" |
3750 | 1.14k | "f16vec2 degrees(f16vec2);" |
3751 | 1.14k | "f16vec3 degrees(f16vec3);" |
3752 | 1.14k | "f16vec4 degrees(f16vec4);" |
3753 | | |
3754 | 1.14k | "float16_t sin(float16_t);" |
3755 | 1.14k | "f16vec2 sin(f16vec2);" |
3756 | 1.14k | "f16vec3 sin(f16vec3);" |
3757 | 1.14k | "f16vec4 sin(f16vec4);" |
3758 | | |
3759 | 1.14k | "float16_t cos(float16_t);" |
3760 | 1.14k | "f16vec2 cos(f16vec2);" |
3761 | 1.14k | "f16vec3 cos(f16vec3);" |
3762 | 1.14k | "f16vec4 cos(f16vec4);" |
3763 | | |
3764 | 1.14k | "float16_t tan(float16_t);" |
3765 | 1.14k | "f16vec2 tan(f16vec2);" |
3766 | 1.14k | "f16vec3 tan(f16vec3);" |
3767 | 1.14k | "f16vec4 tan(f16vec4);" |
3768 | | |
3769 | 1.14k | "float16_t asin(float16_t);" |
3770 | 1.14k | "f16vec2 asin(f16vec2);" |
3771 | 1.14k | "f16vec3 asin(f16vec3);" |
3772 | 1.14k | "f16vec4 asin(f16vec4);" |
3773 | | |
3774 | 1.14k | "float16_t acos(float16_t);" |
3775 | 1.14k | "f16vec2 acos(f16vec2);" |
3776 | 1.14k | "f16vec3 acos(f16vec3);" |
3777 | 1.14k | "f16vec4 acos(f16vec4);" |
3778 | | |
3779 | 1.14k | "float16_t atan(float16_t, float16_t);" |
3780 | 1.14k | "f16vec2 atan(f16vec2, f16vec2);" |
3781 | 1.14k | "f16vec3 atan(f16vec3, f16vec3);" |
3782 | 1.14k | "f16vec4 atan(f16vec4, f16vec4);" |
3783 | | |
3784 | 1.14k | "float16_t atan(float16_t);" |
3785 | 1.14k | "f16vec2 atan(f16vec2);" |
3786 | 1.14k | "f16vec3 atan(f16vec3);" |
3787 | 1.14k | "f16vec4 atan(f16vec4);" |
3788 | | |
3789 | 1.14k | "float16_t sinh(float16_t);" |
3790 | 1.14k | "f16vec2 sinh(f16vec2);" |
3791 | 1.14k | "f16vec3 sinh(f16vec3);" |
3792 | 1.14k | "f16vec4 sinh(f16vec4);" |
3793 | | |
3794 | 1.14k | "float16_t cosh(float16_t);" |
3795 | 1.14k | "f16vec2 cosh(f16vec2);" |
3796 | 1.14k | "f16vec3 cosh(f16vec3);" |
3797 | 1.14k | "f16vec4 cosh(f16vec4);" |
3798 | | |
3799 | 1.14k | "float16_t tanh(float16_t);" |
3800 | 1.14k | "f16vec2 tanh(f16vec2);" |
3801 | 1.14k | "f16vec3 tanh(f16vec3);" |
3802 | 1.14k | "f16vec4 tanh(f16vec4);" |
3803 | | |
3804 | 1.14k | "float16_t asinh(float16_t);" |
3805 | 1.14k | "f16vec2 asinh(f16vec2);" |
3806 | 1.14k | "f16vec3 asinh(f16vec3);" |
3807 | 1.14k | "f16vec4 asinh(f16vec4);" |
3808 | | |
3809 | 1.14k | "float16_t acosh(float16_t);" |
3810 | 1.14k | "f16vec2 acosh(f16vec2);" |
3811 | 1.14k | "f16vec3 acosh(f16vec3);" |
3812 | 1.14k | "f16vec4 acosh(f16vec4);" |
3813 | | |
3814 | 1.14k | "float16_t atanh(float16_t);" |
3815 | 1.14k | "f16vec2 atanh(f16vec2);" |
3816 | 1.14k | "f16vec3 atanh(f16vec3);" |
3817 | 1.14k | "f16vec4 atanh(f16vec4);" |
3818 | | |
3819 | 1.14k | "float16_t pow(float16_t, float16_t);" |
3820 | 1.14k | "f16vec2 pow(f16vec2, f16vec2);" |
3821 | 1.14k | "f16vec3 pow(f16vec3, f16vec3);" |
3822 | 1.14k | "f16vec4 pow(f16vec4, f16vec4);" |
3823 | | |
3824 | 1.14k | "float16_t exp(float16_t);" |
3825 | 1.14k | "f16vec2 exp(f16vec2);" |
3826 | 1.14k | "f16vec3 exp(f16vec3);" |
3827 | 1.14k | "f16vec4 exp(f16vec4);" |
3828 | | |
3829 | 1.14k | "float16_t log(float16_t);" |
3830 | 1.14k | "f16vec2 log(f16vec2);" |
3831 | 1.14k | "f16vec3 log(f16vec3);" |
3832 | 1.14k | "f16vec4 log(f16vec4);" |
3833 | | |
3834 | 1.14k | "float16_t exp2(float16_t);" |
3835 | 1.14k | "f16vec2 exp2(f16vec2);" |
3836 | 1.14k | "f16vec3 exp2(f16vec3);" |
3837 | 1.14k | "f16vec4 exp2(f16vec4);" |
3838 | | |
3839 | 1.14k | "float16_t log2(float16_t);" |
3840 | 1.14k | "f16vec2 log2(f16vec2);" |
3841 | 1.14k | "f16vec3 log2(f16vec3);" |
3842 | 1.14k | "f16vec4 log2(f16vec4);" |
3843 | | |
3844 | 1.14k | "float16_t sqrt(float16_t);" |
3845 | 1.14k | "f16vec2 sqrt(f16vec2);" |
3846 | 1.14k | "f16vec3 sqrt(f16vec3);" |
3847 | 1.14k | "f16vec4 sqrt(f16vec4);" |
3848 | | |
3849 | 1.14k | "float16_t inversesqrt(float16_t);" |
3850 | 1.14k | "f16vec2 inversesqrt(f16vec2);" |
3851 | 1.14k | "f16vec3 inversesqrt(f16vec3);" |
3852 | 1.14k | "f16vec4 inversesqrt(f16vec4);" |
3853 | | |
3854 | 1.14k | "float16_t abs(float16_t);" |
3855 | 1.14k | "f16vec2 abs(f16vec2);" |
3856 | 1.14k | "f16vec3 abs(f16vec3);" |
3857 | 1.14k | "f16vec4 abs(f16vec4);" |
3858 | | |
3859 | 1.14k | "float16_t sign(float16_t);" |
3860 | 1.14k | "f16vec2 sign(f16vec2);" |
3861 | 1.14k | "f16vec3 sign(f16vec3);" |
3862 | 1.14k | "f16vec4 sign(f16vec4);" |
3863 | | |
3864 | 1.14k | "float16_t floor(float16_t);" |
3865 | 1.14k | "f16vec2 floor(f16vec2);" |
3866 | 1.14k | "f16vec3 floor(f16vec3);" |
3867 | 1.14k | "f16vec4 floor(f16vec4);" |
3868 | | |
3869 | 1.14k | "float16_t trunc(float16_t);" |
3870 | 1.14k | "f16vec2 trunc(f16vec2);" |
3871 | 1.14k | "f16vec3 trunc(f16vec3);" |
3872 | 1.14k | "f16vec4 trunc(f16vec4);" |
3873 | | |
3874 | 1.14k | "float16_t round(float16_t);" |
3875 | 1.14k | "f16vec2 round(f16vec2);" |
3876 | 1.14k | "f16vec3 round(f16vec3);" |
3877 | 1.14k | "f16vec4 round(f16vec4);" |
3878 | | |
3879 | 1.14k | "float16_t roundEven(float16_t);" |
3880 | 1.14k | "f16vec2 roundEven(f16vec2);" |
3881 | 1.14k | "f16vec3 roundEven(f16vec3);" |
3882 | 1.14k | "f16vec4 roundEven(f16vec4);" |
3883 | | |
3884 | 1.14k | "float16_t ceil(float16_t);" |
3885 | 1.14k | "f16vec2 ceil(f16vec2);" |
3886 | 1.14k | "f16vec3 ceil(f16vec3);" |
3887 | 1.14k | "f16vec4 ceil(f16vec4);" |
3888 | | |
3889 | 1.14k | "float16_t fract(float16_t);" |
3890 | 1.14k | "f16vec2 fract(f16vec2);" |
3891 | 1.14k | "f16vec3 fract(f16vec3);" |
3892 | 1.14k | "f16vec4 fract(f16vec4);" |
3893 | | |
3894 | 1.14k | "float16_t mod(float16_t, float16_t);" |
3895 | 1.14k | "f16vec2 mod(f16vec2, float16_t);" |
3896 | 1.14k | "f16vec3 mod(f16vec3, float16_t);" |
3897 | 1.14k | "f16vec4 mod(f16vec4, float16_t);" |
3898 | 1.14k | "f16vec2 mod(f16vec2, f16vec2);" |
3899 | 1.14k | "f16vec3 mod(f16vec3, f16vec3);" |
3900 | 1.14k | "f16vec4 mod(f16vec4, f16vec4);" |
3901 | | |
3902 | 1.14k | "float16_t modf(float16_t, out float16_t);" |
3903 | 1.14k | "f16vec2 modf(f16vec2, out f16vec2);" |
3904 | 1.14k | "f16vec3 modf(f16vec3, out f16vec3);" |
3905 | 1.14k | "f16vec4 modf(f16vec4, out f16vec4);" |
3906 | | |
3907 | 1.14k | "float16_t min(float16_t, float16_t);" |
3908 | 1.14k | "f16vec2 min(f16vec2, float16_t);" |
3909 | 1.14k | "f16vec3 min(f16vec3, float16_t);" |
3910 | 1.14k | "f16vec4 min(f16vec4, float16_t);" |
3911 | 1.14k | "f16vec2 min(f16vec2, f16vec2);" |
3912 | 1.14k | "f16vec3 min(f16vec3, f16vec3);" |
3913 | 1.14k | "f16vec4 min(f16vec4, f16vec4);" |
3914 | | |
3915 | 1.14k | "float16_t max(float16_t, float16_t);" |
3916 | 1.14k | "f16vec2 max(f16vec2, float16_t);" |
3917 | 1.14k | "f16vec3 max(f16vec3, float16_t);" |
3918 | 1.14k | "f16vec4 max(f16vec4, float16_t);" |
3919 | 1.14k | "f16vec2 max(f16vec2, f16vec2);" |
3920 | 1.14k | "f16vec3 max(f16vec3, f16vec3);" |
3921 | 1.14k | "f16vec4 max(f16vec4, f16vec4);" |
3922 | | |
3923 | 1.14k | "float16_t clamp(float16_t, float16_t, float16_t);" |
3924 | 1.14k | "f16vec2 clamp(f16vec2, float16_t, float16_t);" |
3925 | 1.14k | "f16vec3 clamp(f16vec3, float16_t, float16_t);" |
3926 | 1.14k | "f16vec4 clamp(f16vec4, float16_t, float16_t);" |
3927 | 1.14k | "f16vec2 clamp(f16vec2, f16vec2, f16vec2);" |
3928 | 1.14k | "f16vec3 clamp(f16vec3, f16vec3, f16vec3);" |
3929 | 1.14k | "f16vec4 clamp(f16vec4, f16vec4, f16vec4);" |
3930 | | |
3931 | 1.14k | "float16_t mix(float16_t, float16_t, float16_t);" |
3932 | 1.14k | "f16vec2 mix(f16vec2, f16vec2, float16_t);" |
3933 | 1.14k | "f16vec3 mix(f16vec3, f16vec3, float16_t);" |
3934 | 1.14k | "f16vec4 mix(f16vec4, f16vec4, float16_t);" |
3935 | 1.14k | "f16vec2 mix(f16vec2, f16vec2, f16vec2);" |
3936 | 1.14k | "f16vec3 mix(f16vec3, f16vec3, f16vec3);" |
3937 | 1.14k | "f16vec4 mix(f16vec4, f16vec4, f16vec4);" |
3938 | 1.14k | "float16_t mix(float16_t, float16_t, bool);" |
3939 | 1.14k | "f16vec2 mix(f16vec2, f16vec2, bvec2);" |
3940 | 1.14k | "f16vec3 mix(f16vec3, f16vec3, bvec3);" |
3941 | 1.14k | "f16vec4 mix(f16vec4, f16vec4, bvec4);" |
3942 | | |
3943 | 1.14k | "float16_t step(float16_t, float16_t);" |
3944 | 1.14k | "f16vec2 step(f16vec2, f16vec2);" |
3945 | 1.14k | "f16vec3 step(f16vec3, f16vec3);" |
3946 | 1.14k | "f16vec4 step(f16vec4, f16vec4);" |
3947 | 1.14k | "f16vec2 step(float16_t, f16vec2);" |
3948 | 1.14k | "f16vec3 step(float16_t, f16vec3);" |
3949 | 1.14k | "f16vec4 step(float16_t, f16vec4);" |
3950 | | |
3951 | 1.14k | "float16_t smoothstep(float16_t, float16_t, float16_t);" |
3952 | 1.14k | "f16vec2 smoothstep(f16vec2, f16vec2, f16vec2);" |
3953 | 1.14k | "f16vec3 smoothstep(f16vec3, f16vec3, f16vec3);" |
3954 | 1.14k | "f16vec4 smoothstep(f16vec4, f16vec4, f16vec4);" |
3955 | 1.14k | "f16vec2 smoothstep(float16_t, float16_t, f16vec2);" |
3956 | 1.14k | "f16vec3 smoothstep(float16_t, float16_t, f16vec3);" |
3957 | 1.14k | "f16vec4 smoothstep(float16_t, float16_t, f16vec4);" |
3958 | | |
3959 | 1.14k | "bool isnan(float16_t);" |
3960 | 1.14k | "bvec2 isnan(f16vec2);" |
3961 | 1.14k | "bvec3 isnan(f16vec3);" |
3962 | 1.14k | "bvec4 isnan(f16vec4);" |
3963 | | |
3964 | 1.14k | "bool isinf(float16_t);" |
3965 | 1.14k | "bvec2 isinf(f16vec2);" |
3966 | 1.14k | "bvec3 isinf(f16vec3);" |
3967 | 1.14k | "bvec4 isinf(f16vec4);" |
3968 | | |
3969 | 1.14k | "float16_t fma(float16_t, float16_t, float16_t);" |
3970 | 1.14k | "f16vec2 fma(f16vec2, f16vec2, f16vec2);" |
3971 | 1.14k | "f16vec3 fma(f16vec3, f16vec3, f16vec3);" |
3972 | 1.14k | "f16vec4 fma(f16vec4, f16vec4, f16vec4);" |
3973 | | |
3974 | 1.14k | "float16_t frexp(float16_t, out int);" |
3975 | 1.14k | "f16vec2 frexp(f16vec2, out ivec2);" |
3976 | 1.14k | "f16vec3 frexp(f16vec3, out ivec3);" |
3977 | 1.14k | "f16vec4 frexp(f16vec4, out ivec4);" |
3978 | | |
3979 | 1.14k | "float16_t ldexp(float16_t, in int);" |
3980 | 1.14k | "f16vec2 ldexp(f16vec2, in ivec2);" |
3981 | 1.14k | "f16vec3 ldexp(f16vec3, in ivec3);" |
3982 | 1.14k | "f16vec4 ldexp(f16vec4, in ivec4);" |
3983 | | |
3984 | 1.14k | "uint packFloat2x16(f16vec2);" |
3985 | 1.14k | "f16vec2 unpackFloat2x16(uint);" |
3986 | | |
3987 | 1.14k | "float16_t length(float16_t);" |
3988 | 1.14k | "float16_t length(f16vec2);" |
3989 | 1.14k | "float16_t length(f16vec3);" |
3990 | 1.14k | "float16_t length(f16vec4);" |
3991 | | |
3992 | 1.14k | "float16_t distance(float16_t, float16_t);" |
3993 | 1.14k | "float16_t distance(f16vec2, f16vec2);" |
3994 | 1.14k | "float16_t distance(f16vec3, f16vec3);" |
3995 | 1.14k | "float16_t distance(f16vec4, f16vec4);" |
3996 | | |
3997 | 1.14k | "float16_t dot(float16_t, float16_t);" |
3998 | 1.14k | "float16_t dot(f16vec2, f16vec2);" |
3999 | 1.14k | "float16_t dot(f16vec3, f16vec3);" |
4000 | 1.14k | "float16_t dot(f16vec4, f16vec4);" |
4001 | | |
4002 | 1.14k | "f16vec3 cross(f16vec3, f16vec3);" |
4003 | | |
4004 | 1.14k | "float16_t normalize(float16_t);" |
4005 | 1.14k | "f16vec2 normalize(f16vec2);" |
4006 | 1.14k | "f16vec3 normalize(f16vec3);" |
4007 | 1.14k | "f16vec4 normalize(f16vec4);" |
4008 | | |
4009 | 1.14k | "float16_t faceforward(float16_t, float16_t, float16_t);" |
4010 | 1.14k | "f16vec2 faceforward(f16vec2, f16vec2, f16vec2);" |
4011 | 1.14k | "f16vec3 faceforward(f16vec3, f16vec3, f16vec3);" |
4012 | 1.14k | "f16vec4 faceforward(f16vec4, f16vec4, f16vec4);" |
4013 | | |
4014 | 1.14k | "float16_t reflect(float16_t, float16_t);" |
4015 | 1.14k | "f16vec2 reflect(f16vec2, f16vec2);" |
4016 | 1.14k | "f16vec3 reflect(f16vec3, f16vec3);" |
4017 | 1.14k | "f16vec4 reflect(f16vec4, f16vec4);" |
4018 | | |
4019 | 1.14k | "float16_t refract(float16_t, float16_t, float16_t);" |
4020 | 1.14k | "f16vec2 refract(f16vec2, f16vec2, float16_t);" |
4021 | 1.14k | "f16vec3 refract(f16vec3, f16vec3, float16_t);" |
4022 | 1.14k | "f16vec4 refract(f16vec4, f16vec4, float16_t);" |
4023 | | |
4024 | 1.14k | "f16mat2 matrixCompMult(f16mat2, f16mat2);" |
4025 | 1.14k | "f16mat3 matrixCompMult(f16mat3, f16mat3);" |
4026 | 1.14k | "f16mat4 matrixCompMult(f16mat4, f16mat4);" |
4027 | 1.14k | "f16mat2x3 matrixCompMult(f16mat2x3, f16mat2x3);" |
4028 | 1.14k | "f16mat2x4 matrixCompMult(f16mat2x4, f16mat2x4);" |
4029 | 1.14k | "f16mat3x2 matrixCompMult(f16mat3x2, f16mat3x2);" |
4030 | 1.14k | "f16mat3x4 matrixCompMult(f16mat3x4, f16mat3x4);" |
4031 | 1.14k | "f16mat4x2 matrixCompMult(f16mat4x2, f16mat4x2);" |
4032 | 1.14k | "f16mat4x3 matrixCompMult(f16mat4x3, f16mat4x3);" |
4033 | | |
4034 | 1.14k | "f16mat2 outerProduct(f16vec2, f16vec2);" |
4035 | 1.14k | "f16mat3 outerProduct(f16vec3, f16vec3);" |
4036 | 1.14k | "f16mat4 outerProduct(f16vec4, f16vec4);" |
4037 | 1.14k | "f16mat2x3 outerProduct(f16vec3, f16vec2);" |
4038 | 1.14k | "f16mat3x2 outerProduct(f16vec2, f16vec3);" |
4039 | 1.14k | "f16mat2x4 outerProduct(f16vec4, f16vec2);" |
4040 | 1.14k | "f16mat4x2 outerProduct(f16vec2, f16vec4);" |
4041 | 1.14k | "f16mat3x4 outerProduct(f16vec4, f16vec3);" |
4042 | 1.14k | "f16mat4x3 outerProduct(f16vec3, f16vec4);" |
4043 | | |
4044 | 1.14k | "f16mat2 transpose(f16mat2);" |
4045 | 1.14k | "f16mat3 transpose(f16mat3);" |
4046 | 1.14k | "f16mat4 transpose(f16mat4);" |
4047 | 1.14k | "f16mat2x3 transpose(f16mat3x2);" |
4048 | 1.14k | "f16mat3x2 transpose(f16mat2x3);" |
4049 | 1.14k | "f16mat2x4 transpose(f16mat4x2);" |
4050 | 1.14k | "f16mat4x2 transpose(f16mat2x4);" |
4051 | 1.14k | "f16mat3x4 transpose(f16mat4x3);" |
4052 | 1.14k | "f16mat4x3 transpose(f16mat3x4);" |
4053 | | |
4054 | 1.14k | "float16_t determinant(f16mat2);" |
4055 | 1.14k | "float16_t determinant(f16mat3);" |
4056 | 1.14k | "float16_t determinant(f16mat4);" |
4057 | | |
4058 | 1.14k | "f16mat2 inverse(f16mat2);" |
4059 | 1.14k | "f16mat3 inverse(f16mat3);" |
4060 | 1.14k | "f16mat4 inverse(f16mat4);" |
4061 | | |
4062 | 1.14k | "bvec2 lessThan(f16vec2, f16vec2);" |
4063 | 1.14k | "bvec3 lessThan(f16vec3, f16vec3);" |
4064 | 1.14k | "bvec4 lessThan(f16vec4, f16vec4);" |
4065 | | |
4066 | 1.14k | "bvec2 lessThanEqual(f16vec2, f16vec2);" |
4067 | 1.14k | "bvec3 lessThanEqual(f16vec3, f16vec3);" |
4068 | 1.14k | "bvec4 lessThanEqual(f16vec4, f16vec4);" |
4069 | | |
4070 | 1.14k | "bvec2 greaterThan(f16vec2, f16vec2);" |
4071 | 1.14k | "bvec3 greaterThan(f16vec3, f16vec3);" |
4072 | 1.14k | "bvec4 greaterThan(f16vec4, f16vec4);" |
4073 | | |
4074 | 1.14k | "bvec2 greaterThanEqual(f16vec2, f16vec2);" |
4075 | 1.14k | "bvec3 greaterThanEqual(f16vec3, f16vec3);" |
4076 | 1.14k | "bvec4 greaterThanEqual(f16vec4, f16vec4);" |
4077 | | |
4078 | 1.14k | "bvec2 equal(f16vec2, f16vec2);" |
4079 | 1.14k | "bvec3 equal(f16vec3, f16vec3);" |
4080 | 1.14k | "bvec4 equal(f16vec4, f16vec4);" |
4081 | | |
4082 | 1.14k | "bvec2 notEqual(f16vec2, f16vec2);" |
4083 | 1.14k | "bvec3 notEqual(f16vec3, f16vec3);" |
4084 | 1.14k | "bvec4 notEqual(f16vec4, f16vec4);" |
4085 | | |
4086 | 1.14k | "bfloat16_t dot(bfloat16_t, bfloat16_t);" |
4087 | 1.14k | "bfloat16_t dot(bf16vec2, bf16vec2);" |
4088 | 1.14k | "bfloat16_t dot(bf16vec3, bf16vec3);" |
4089 | 1.14k | "bfloat16_t dot(bf16vec4, bf16vec4);" |
4090 | | |
4091 | 1.14k | "int16_t bfloat16BitsToIntEXT(bfloat16_t value);" |
4092 | 1.14k | "i16vec2 bfloat16BitsToIntEXT(bf16vec2 value);" |
4093 | 1.14k | "i16vec3 bfloat16BitsToIntEXT(bf16vec3 value);" |
4094 | 1.14k | "i16vec4 bfloat16BitsToIntEXT(bf16vec4 value);" |
4095 | | |
4096 | 1.14k | "uint16_t bfloat16BitsToUintEXT(bfloat16_t value);" |
4097 | 1.14k | "u16vec2 bfloat16BitsToUintEXT(bf16vec2 value);" |
4098 | 1.14k | "u16vec3 bfloat16BitsToUintEXT(bf16vec3 value);" |
4099 | 1.14k | "u16vec4 bfloat16BitsToUintEXT(bf16vec4 value);" |
4100 | | |
4101 | 1.14k | "bfloat16_t intBitsToBFloat16EXT(int16_t value);" |
4102 | 1.14k | "bf16vec2 intBitsToBFloat16EXT(i16vec2 value);" |
4103 | 1.14k | "bf16vec3 intBitsToBFloat16EXT(i16vec3 value);" |
4104 | 1.14k | "bf16vec4 intBitsToBFloat16EXT(i16vec4 value);" |
4105 | | |
4106 | 1.14k | "bfloat16_t uintBitsToBFloat16EXT(uint16_t value);" |
4107 | 1.14k | "bf16vec2 uintBitsToBFloat16EXT(u16vec2 value);" |
4108 | 1.14k | "bf16vec3 uintBitsToBFloat16EXT(u16vec3 value);" |
4109 | 1.14k | "bf16vec4 uintBitsToBFloat16EXT(u16vec4 value);" |
4110 | | |
4111 | 1.14k | "int8_t floate5m2BitsToIntEXT(floate5m2_t value);" |
4112 | 1.14k | "i8vec2 floate5m2BitsToIntEXT(fe5m2vec2 value);" |
4113 | 1.14k | "i8vec3 floate5m2BitsToIntEXT(fe5m2vec3 value);" |
4114 | 1.14k | "i8vec4 floate5m2BitsToIntEXT(fe5m2vec4 value);" |
4115 | | |
4116 | 1.14k | "uint8_t floate5m2BitsToUintEXT(floate5m2_t value);" |
4117 | 1.14k | "u8vec2 floate5m2BitsToUintEXT(fe5m2vec2 value);" |
4118 | 1.14k | "u8vec3 floate5m2BitsToUintEXT(fe5m2vec3 value);" |
4119 | 1.14k | "u8vec4 floate5m2BitsToUintEXT(fe5m2vec4 value);" |
4120 | | |
4121 | 1.14k | "floate5m2_t intBitsToFloate5m2EXT(int8_t value);" |
4122 | 1.14k | "fe5m2vec2 intBitsToFloate5m2EXT(i8vec2 value);" |
4123 | 1.14k | "fe5m2vec3 intBitsToFloate5m2EXT(i8vec3 value);" |
4124 | 1.14k | "fe5m2vec4 intBitsToFloate5m2EXT(i8vec4 value);" |
4125 | | |
4126 | 1.14k | "floate5m2_t uintBitsToFloate5m2EXT(uint8_t value);" |
4127 | 1.14k | "fe5m2vec2 uintBitsToFloate5m2EXT(u8vec2 value);" |
4128 | 1.14k | "fe5m2vec3 uintBitsToFloate5m2EXT(u8vec3 value);" |
4129 | 1.14k | "fe5m2vec4 uintBitsToFloate5m2EXT(u8vec4 value);" |
4130 | | |
4131 | 1.14k | "int8_t floate4m3BitsToIntEXT(floate4m3_t value);" |
4132 | 1.14k | "i8vec2 floate4m3BitsToIntEXT(fe4m3vec2 value);" |
4133 | 1.14k | "i8vec3 floate4m3BitsToIntEXT(fe4m3vec3 value);" |
4134 | 1.14k | "i8vec4 floate4m3BitsToIntEXT(fe4m3vec4 value);" |
4135 | | |
4136 | 1.14k | "uint8_t floate4m3BitsToUintEXT(floate4m3_t value);" |
4137 | 1.14k | "u8vec2 floate4m3BitsToUintEXT(fe4m3vec2 value);" |
4138 | 1.14k | "u8vec3 floate4m3BitsToUintEXT(fe4m3vec3 value);" |
4139 | 1.14k | "u8vec4 floate4m3BitsToUintEXT(fe4m3vec4 value);" |
4140 | | |
4141 | 1.14k | "floate4m3_t intBitsToFloate4m3EXT(int8_t value);" |
4142 | 1.14k | "fe4m3vec2 intBitsToFloate4m3EXT(i8vec2 value);" |
4143 | 1.14k | "fe4m3vec3 intBitsToFloate4m3EXT(i8vec3 value);" |
4144 | 1.14k | "fe4m3vec4 intBitsToFloate4m3EXT(i8vec4 value);" |
4145 | | |
4146 | 1.14k | "floate4m3_t uintBitsToFloate4m3EXT(uint8_t value);" |
4147 | 1.14k | "fe4m3vec2 uintBitsToFloate4m3EXT(u8vec2 value);" |
4148 | 1.14k | "fe4m3vec3 uintBitsToFloate4m3EXT(u8vec3 value);" |
4149 | 1.14k | "fe4m3vec4 uintBitsToFloate4m3EXT(u8vec4 value);" |
4150 | | |
4151 | 1.14k | "void saturatedConvertEXT();" |
4152 | 1.14k | "\n"); |
4153 | 1.14k | } |
4154 | | |
4155 | | // Explicit types |
4156 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { |
4157 | 1.14k | commonBuiltins.append( |
4158 | 1.14k | "int8_t abs(int8_t);" |
4159 | 1.14k | "i8vec2 abs(i8vec2);" |
4160 | 1.14k | "i8vec3 abs(i8vec3);" |
4161 | 1.14k | "i8vec4 abs(i8vec4);" |
4162 | | |
4163 | 1.14k | "int8_t sign(int8_t);" |
4164 | 1.14k | "i8vec2 sign(i8vec2);" |
4165 | 1.14k | "i8vec3 sign(i8vec3);" |
4166 | 1.14k | "i8vec4 sign(i8vec4);" |
4167 | | |
4168 | 1.14k | "int8_t min(int8_t x, int8_t y);" |
4169 | 1.14k | "i8vec2 min(i8vec2 x, int8_t y);" |
4170 | 1.14k | "i8vec3 min(i8vec3 x, int8_t y);" |
4171 | 1.14k | "i8vec4 min(i8vec4 x, int8_t y);" |
4172 | 1.14k | "i8vec2 min(i8vec2 x, i8vec2 y);" |
4173 | 1.14k | "i8vec3 min(i8vec3 x, i8vec3 y);" |
4174 | 1.14k | "i8vec4 min(i8vec4 x, i8vec4 y);" |
4175 | | |
4176 | 1.14k | "uint8_t min(uint8_t x, uint8_t y);" |
4177 | 1.14k | "u8vec2 min(u8vec2 x, uint8_t y);" |
4178 | 1.14k | "u8vec3 min(u8vec3 x, uint8_t y);" |
4179 | 1.14k | "u8vec4 min(u8vec4 x, uint8_t y);" |
4180 | 1.14k | "u8vec2 min(u8vec2 x, u8vec2 y);" |
4181 | 1.14k | "u8vec3 min(u8vec3 x, u8vec3 y);" |
4182 | 1.14k | "u8vec4 min(u8vec4 x, u8vec4 y);" |
4183 | | |
4184 | 1.14k | "int8_t max(int8_t x, int8_t y);" |
4185 | 1.14k | "i8vec2 max(i8vec2 x, int8_t y);" |
4186 | 1.14k | "i8vec3 max(i8vec3 x, int8_t y);" |
4187 | 1.14k | "i8vec4 max(i8vec4 x, int8_t y);" |
4188 | 1.14k | "i8vec2 max(i8vec2 x, i8vec2 y);" |
4189 | 1.14k | "i8vec3 max(i8vec3 x, i8vec3 y);" |
4190 | 1.14k | "i8vec4 max(i8vec4 x, i8vec4 y);" |
4191 | | |
4192 | 1.14k | "uint8_t max(uint8_t x, uint8_t y);" |
4193 | 1.14k | "u8vec2 max(u8vec2 x, uint8_t y);" |
4194 | 1.14k | "u8vec3 max(u8vec3 x, uint8_t y);" |
4195 | 1.14k | "u8vec4 max(u8vec4 x, uint8_t y);" |
4196 | 1.14k | "u8vec2 max(u8vec2 x, u8vec2 y);" |
4197 | 1.14k | "u8vec3 max(u8vec3 x, u8vec3 y);" |
4198 | 1.14k | "u8vec4 max(u8vec4 x, u8vec4 y);" |
4199 | | |
4200 | 1.14k | "int8_t clamp(int8_t x, int8_t minVal, int8_t maxVal);" |
4201 | 1.14k | "i8vec2 clamp(i8vec2 x, int8_t minVal, int8_t maxVal);" |
4202 | 1.14k | "i8vec3 clamp(i8vec3 x, int8_t minVal, int8_t maxVal);" |
4203 | 1.14k | "i8vec4 clamp(i8vec4 x, int8_t minVal, int8_t maxVal);" |
4204 | 1.14k | "i8vec2 clamp(i8vec2 x, i8vec2 minVal, i8vec2 maxVal);" |
4205 | 1.14k | "i8vec3 clamp(i8vec3 x, i8vec3 minVal, i8vec3 maxVal);" |
4206 | 1.14k | "i8vec4 clamp(i8vec4 x, i8vec4 minVal, i8vec4 maxVal);" |
4207 | | |
4208 | 1.14k | "uint8_t clamp(uint8_t x, uint8_t minVal, uint8_t maxVal);" |
4209 | 1.14k | "u8vec2 clamp(u8vec2 x, uint8_t minVal, uint8_t maxVal);" |
4210 | 1.14k | "u8vec3 clamp(u8vec3 x, uint8_t minVal, uint8_t maxVal);" |
4211 | 1.14k | "u8vec4 clamp(u8vec4 x, uint8_t minVal, uint8_t maxVal);" |
4212 | 1.14k | "u8vec2 clamp(u8vec2 x, u8vec2 minVal, u8vec2 maxVal);" |
4213 | 1.14k | "u8vec3 clamp(u8vec3 x, u8vec3 minVal, u8vec3 maxVal);" |
4214 | 1.14k | "u8vec4 clamp(u8vec4 x, u8vec4 minVal, u8vec4 maxVal);" |
4215 | | |
4216 | 1.14k | "int8_t mix(int8_t, int8_t, bool);" |
4217 | 1.14k | "i8vec2 mix(i8vec2, i8vec2, bvec2);" |
4218 | 1.14k | "i8vec3 mix(i8vec3, i8vec3, bvec3);" |
4219 | 1.14k | "i8vec4 mix(i8vec4, i8vec4, bvec4);" |
4220 | 1.14k | "uint8_t mix(uint8_t, uint8_t, bool);" |
4221 | 1.14k | "u8vec2 mix(u8vec2, u8vec2, bvec2);" |
4222 | 1.14k | "u8vec3 mix(u8vec3, u8vec3, bvec3);" |
4223 | 1.14k | "u8vec4 mix(u8vec4, u8vec4, bvec4);" |
4224 | | |
4225 | 1.14k | "bvec2 lessThan(i8vec2, i8vec2);" |
4226 | 1.14k | "bvec3 lessThan(i8vec3, i8vec3);" |
4227 | 1.14k | "bvec4 lessThan(i8vec4, i8vec4);" |
4228 | 1.14k | "bvec2 lessThan(u8vec2, u8vec2);" |
4229 | 1.14k | "bvec3 lessThan(u8vec3, u8vec3);" |
4230 | 1.14k | "bvec4 lessThan(u8vec4, u8vec4);" |
4231 | | |
4232 | 1.14k | "bvec2 lessThanEqual(i8vec2, i8vec2);" |
4233 | 1.14k | "bvec3 lessThanEqual(i8vec3, i8vec3);" |
4234 | 1.14k | "bvec4 lessThanEqual(i8vec4, i8vec4);" |
4235 | 1.14k | "bvec2 lessThanEqual(u8vec2, u8vec2);" |
4236 | 1.14k | "bvec3 lessThanEqual(u8vec3, u8vec3);" |
4237 | 1.14k | "bvec4 lessThanEqual(u8vec4, u8vec4);" |
4238 | | |
4239 | 1.14k | "bvec2 greaterThan(i8vec2, i8vec2);" |
4240 | 1.14k | "bvec3 greaterThan(i8vec3, i8vec3);" |
4241 | 1.14k | "bvec4 greaterThan(i8vec4, i8vec4);" |
4242 | 1.14k | "bvec2 greaterThan(u8vec2, u8vec2);" |
4243 | 1.14k | "bvec3 greaterThan(u8vec3, u8vec3);" |
4244 | 1.14k | "bvec4 greaterThan(u8vec4, u8vec4);" |
4245 | | |
4246 | 1.14k | "bvec2 greaterThanEqual(i8vec2, i8vec2);" |
4247 | 1.14k | "bvec3 greaterThanEqual(i8vec3, i8vec3);" |
4248 | 1.14k | "bvec4 greaterThanEqual(i8vec4, i8vec4);" |
4249 | 1.14k | "bvec2 greaterThanEqual(u8vec2, u8vec2);" |
4250 | 1.14k | "bvec3 greaterThanEqual(u8vec3, u8vec3);" |
4251 | 1.14k | "bvec4 greaterThanEqual(u8vec4, u8vec4);" |
4252 | | |
4253 | 1.14k | "bvec2 equal(i8vec2, i8vec2);" |
4254 | 1.14k | "bvec3 equal(i8vec3, i8vec3);" |
4255 | 1.14k | "bvec4 equal(i8vec4, i8vec4);" |
4256 | 1.14k | "bvec2 equal(u8vec2, u8vec2);" |
4257 | 1.14k | "bvec3 equal(u8vec3, u8vec3);" |
4258 | 1.14k | "bvec4 equal(u8vec4, u8vec4);" |
4259 | | |
4260 | 1.14k | "bvec2 notEqual(i8vec2, i8vec2);" |
4261 | 1.14k | "bvec3 notEqual(i8vec3, i8vec3);" |
4262 | 1.14k | "bvec4 notEqual(i8vec4, i8vec4);" |
4263 | 1.14k | "bvec2 notEqual(u8vec2, u8vec2);" |
4264 | 1.14k | "bvec3 notEqual(u8vec3, u8vec3);" |
4265 | 1.14k | "bvec4 notEqual(u8vec4, u8vec4);" |
4266 | | |
4267 | 1.14k | " int8_t bitfieldExtract( int8_t, int8_t, int8_t);" |
4268 | 1.14k | "i8vec2 bitfieldExtract(i8vec2, int8_t, int8_t);" |
4269 | 1.14k | "i8vec3 bitfieldExtract(i8vec3, int8_t, int8_t);" |
4270 | 1.14k | "i8vec4 bitfieldExtract(i8vec4, int8_t, int8_t);" |
4271 | | |
4272 | 1.14k | " uint8_t bitfieldExtract( uint8_t, int8_t, int8_t);" |
4273 | 1.14k | "u8vec2 bitfieldExtract(u8vec2, int8_t, int8_t);" |
4274 | 1.14k | "u8vec3 bitfieldExtract(u8vec3, int8_t, int8_t);" |
4275 | 1.14k | "u8vec4 bitfieldExtract(u8vec4, int8_t, int8_t);" |
4276 | | |
4277 | 1.14k | " int8_t bitfieldInsert( int8_t base, int8_t, int8_t, int8_t);" |
4278 | 1.14k | "i8vec2 bitfieldInsert(i8vec2 base, i8vec2, int8_t, int8_t);" |
4279 | 1.14k | "i8vec3 bitfieldInsert(i8vec3 base, i8vec3, int8_t, int8_t);" |
4280 | 1.14k | "i8vec4 bitfieldInsert(i8vec4 base, i8vec4, int8_t, int8_t);" |
4281 | | |
4282 | 1.14k | " uint8_t bitfieldInsert( uint8_t base, uint8_t, int8_t, int8_t);" |
4283 | 1.14k | "u8vec2 bitfieldInsert(u8vec2 base, u8vec2, int8_t, int8_t);" |
4284 | 1.14k | "u8vec3 bitfieldInsert(u8vec3 base, u8vec3, int8_t, int8_t);" |
4285 | 1.14k | "u8vec4 bitfieldInsert(u8vec4 base, u8vec4, int8_t, int8_t);" |
4286 | | |
4287 | 1.14k | " int8_t bitCount( int8_t);" |
4288 | 1.14k | "i8vec2 bitCount(i8vec2);" |
4289 | 1.14k | "i8vec3 bitCount(i8vec3);" |
4290 | 1.14k | "i8vec4 bitCount(i8vec4);" |
4291 | | |
4292 | 1.14k | " int8_t bitCount( uint8_t);" |
4293 | 1.14k | "i8vec2 bitCount(u8vec2);" |
4294 | 1.14k | "i8vec3 bitCount(u8vec3);" |
4295 | 1.14k | "i8vec4 bitCount(u8vec4);" |
4296 | | |
4297 | 1.14k | "int8_t bitfieldReverse(highp int8_t);" |
4298 | 1.14k | "i8vec2 bitfieldReverse(highp i8vec2);" |
4299 | 1.14k | "i8vec3 bitfieldReverse(highp i8vec3);" |
4300 | 1.14k | "i8vec4 bitfieldReverse(highp i8vec4);" |
4301 | | |
4302 | 1.14k | "uint8_t bitfieldReverse(highp uint8_t);" |
4303 | 1.14k | "u8vec2 bitfieldReverse(highp u8vec2);" |
4304 | 1.14k | "u8vec3 bitfieldReverse(highp u8vec3);" |
4305 | 1.14k | "u8vec4 bitfieldReverse(highp u8vec4);" |
4306 | | |
4307 | 1.14k | " int8_t findLSB( int8_t);" |
4308 | 1.14k | "i8vec2 findLSB(i8vec2);" |
4309 | 1.14k | "i8vec3 findLSB(i8vec3);" |
4310 | 1.14k | "i8vec4 findLSB(i8vec4);" |
4311 | | |
4312 | 1.14k | " int8_t findLSB( uint8_t);" |
4313 | 1.14k | "i8vec2 findLSB(u8vec2);" |
4314 | 1.14k | "i8vec3 findLSB(u8vec3);" |
4315 | 1.14k | "i8vec4 findLSB(u8vec4);" |
4316 | | |
4317 | 1.14k | " int8_t findMSB( int8_t);" |
4318 | 1.14k | "i8vec2 findMSB(i8vec2);" |
4319 | 1.14k | "i8vec3 findMSB(i8vec3);" |
4320 | 1.14k | "i8vec4 findMSB(i8vec4);" |
4321 | | |
4322 | 1.14k | " int8_t findMSB( uint8_t);" |
4323 | 1.14k | "i8vec2 findMSB(u8vec2);" |
4324 | 1.14k | "i8vec3 findMSB(u8vec3);" |
4325 | 1.14k | "i8vec4 findMSB(u8vec4);" |
4326 | | |
4327 | 1.14k | "int16_t abs(int16_t);" |
4328 | 1.14k | "i16vec2 abs(i16vec2);" |
4329 | 1.14k | "i16vec3 abs(i16vec3);" |
4330 | 1.14k | "i16vec4 abs(i16vec4);" |
4331 | | |
4332 | 1.14k | "int16_t sign(int16_t);" |
4333 | 1.14k | "i16vec2 sign(i16vec2);" |
4334 | 1.14k | "i16vec3 sign(i16vec3);" |
4335 | 1.14k | "i16vec4 sign(i16vec4);" |
4336 | | |
4337 | 1.14k | "int16_t min(int16_t x, int16_t y);" |
4338 | 1.14k | "i16vec2 min(i16vec2 x, int16_t y);" |
4339 | 1.14k | "i16vec3 min(i16vec3 x, int16_t y);" |
4340 | 1.14k | "i16vec4 min(i16vec4 x, int16_t y);" |
4341 | 1.14k | "i16vec2 min(i16vec2 x, i16vec2 y);" |
4342 | 1.14k | "i16vec3 min(i16vec3 x, i16vec3 y);" |
4343 | 1.14k | "i16vec4 min(i16vec4 x, i16vec4 y);" |
4344 | | |
4345 | 1.14k | "uint16_t min(uint16_t x, uint16_t y);" |
4346 | 1.14k | "u16vec2 min(u16vec2 x, uint16_t y);" |
4347 | 1.14k | "u16vec3 min(u16vec3 x, uint16_t y);" |
4348 | 1.14k | "u16vec4 min(u16vec4 x, uint16_t y);" |
4349 | 1.14k | "u16vec2 min(u16vec2 x, u16vec2 y);" |
4350 | 1.14k | "u16vec3 min(u16vec3 x, u16vec3 y);" |
4351 | 1.14k | "u16vec4 min(u16vec4 x, u16vec4 y);" |
4352 | | |
4353 | 1.14k | "int16_t max(int16_t x, int16_t y);" |
4354 | 1.14k | "i16vec2 max(i16vec2 x, int16_t y);" |
4355 | 1.14k | "i16vec3 max(i16vec3 x, int16_t y);" |
4356 | 1.14k | "i16vec4 max(i16vec4 x, int16_t y);" |
4357 | 1.14k | "i16vec2 max(i16vec2 x, i16vec2 y);" |
4358 | 1.14k | "i16vec3 max(i16vec3 x, i16vec3 y);" |
4359 | 1.14k | "i16vec4 max(i16vec4 x, i16vec4 y);" |
4360 | | |
4361 | 1.14k | "uint16_t max(uint16_t x, uint16_t y);" |
4362 | 1.14k | "u16vec2 max(u16vec2 x, uint16_t y);" |
4363 | 1.14k | "u16vec3 max(u16vec3 x, uint16_t y);" |
4364 | 1.14k | "u16vec4 max(u16vec4 x, uint16_t y);" |
4365 | 1.14k | "u16vec2 max(u16vec2 x, u16vec2 y);" |
4366 | 1.14k | "u16vec3 max(u16vec3 x, u16vec3 y);" |
4367 | 1.14k | "u16vec4 max(u16vec4 x, u16vec4 y);" |
4368 | | |
4369 | 1.14k | "int16_t clamp(int16_t x, int16_t minVal, int16_t maxVal);" |
4370 | 1.14k | "i16vec2 clamp(i16vec2 x, int16_t minVal, int16_t maxVal);" |
4371 | 1.14k | "i16vec3 clamp(i16vec3 x, int16_t minVal, int16_t maxVal);" |
4372 | 1.14k | "i16vec4 clamp(i16vec4 x, int16_t minVal, int16_t maxVal);" |
4373 | 1.14k | "i16vec2 clamp(i16vec2 x, i16vec2 minVal, i16vec2 maxVal);" |
4374 | 1.14k | "i16vec3 clamp(i16vec3 x, i16vec3 minVal, i16vec3 maxVal);" |
4375 | 1.14k | "i16vec4 clamp(i16vec4 x, i16vec4 minVal, i16vec4 maxVal);" |
4376 | | |
4377 | 1.14k | "uint16_t clamp(uint16_t x, uint16_t minVal, uint16_t maxVal);" |
4378 | 1.14k | "u16vec2 clamp(u16vec2 x, uint16_t minVal, uint16_t maxVal);" |
4379 | 1.14k | "u16vec3 clamp(u16vec3 x, uint16_t minVal, uint16_t maxVal);" |
4380 | 1.14k | "u16vec4 clamp(u16vec4 x, uint16_t minVal, uint16_t maxVal);" |
4381 | 1.14k | "u16vec2 clamp(u16vec2 x, u16vec2 minVal, u16vec2 maxVal);" |
4382 | 1.14k | "u16vec3 clamp(u16vec3 x, u16vec3 minVal, u16vec3 maxVal);" |
4383 | 1.14k | "u16vec4 clamp(u16vec4 x, u16vec4 minVal, u16vec4 maxVal);" |
4384 | | |
4385 | 1.14k | "int16_t mix(int16_t, int16_t, bool);" |
4386 | 1.14k | "i16vec2 mix(i16vec2, i16vec2, bvec2);" |
4387 | 1.14k | "i16vec3 mix(i16vec3, i16vec3, bvec3);" |
4388 | 1.14k | "i16vec4 mix(i16vec4, i16vec4, bvec4);" |
4389 | 1.14k | "uint16_t mix(uint16_t, uint16_t, bool);" |
4390 | 1.14k | "u16vec2 mix(u16vec2, u16vec2, bvec2);" |
4391 | 1.14k | "u16vec3 mix(u16vec3, u16vec3, bvec3);" |
4392 | 1.14k | "u16vec4 mix(u16vec4, u16vec4, bvec4);" |
4393 | | |
4394 | 1.14k | "float16_t frexp(float16_t, out int16_t);" |
4395 | 1.14k | "f16vec2 frexp(f16vec2, out i16vec2);" |
4396 | 1.14k | "f16vec3 frexp(f16vec3, out i16vec3);" |
4397 | 1.14k | "f16vec4 frexp(f16vec4, out i16vec4);" |
4398 | | |
4399 | 1.14k | "float16_t ldexp(float16_t, int16_t);" |
4400 | 1.14k | "f16vec2 ldexp(f16vec2, i16vec2);" |
4401 | 1.14k | "f16vec3 ldexp(f16vec3, i16vec3);" |
4402 | 1.14k | "f16vec4 ldexp(f16vec4, i16vec4);" |
4403 | | |
4404 | 1.14k | "int16_t halfBitsToInt16(float16_t);" |
4405 | 1.14k | "i16vec2 halfBitsToInt16(f16vec2);" |
4406 | 1.14k | "i16vec3 halhBitsToInt16(f16vec3);" |
4407 | 1.14k | "i16vec4 halfBitsToInt16(f16vec4);" |
4408 | | |
4409 | 1.14k | "uint16_t halfBitsToUint16(float16_t);" |
4410 | 1.14k | "u16vec2 halfBitsToUint16(f16vec2);" |
4411 | 1.14k | "u16vec3 halfBitsToUint16(f16vec3);" |
4412 | 1.14k | "u16vec4 halfBitsToUint16(f16vec4);" |
4413 | | |
4414 | 1.14k | "int16_t float16BitsToInt16(float16_t);" |
4415 | 1.14k | "i16vec2 float16BitsToInt16(f16vec2);" |
4416 | 1.14k | "i16vec3 float16BitsToInt16(f16vec3);" |
4417 | 1.14k | "i16vec4 float16BitsToInt16(f16vec4);" |
4418 | | |
4419 | 1.14k | "uint16_t float16BitsToUint16(float16_t);" |
4420 | 1.14k | "u16vec2 float16BitsToUint16(f16vec2);" |
4421 | 1.14k | "u16vec3 float16BitsToUint16(f16vec3);" |
4422 | 1.14k | "u16vec4 float16BitsToUint16(f16vec4);" |
4423 | | |
4424 | 1.14k | "float16_t int16BitsToFloat16(int16_t);" |
4425 | 1.14k | "f16vec2 int16BitsToFloat16(i16vec2);" |
4426 | 1.14k | "f16vec3 int16BitsToFloat16(i16vec3);" |
4427 | 1.14k | "f16vec4 int16BitsToFloat16(i16vec4);" |
4428 | | |
4429 | 1.14k | "float16_t uint16BitsToFloat16(uint16_t);" |
4430 | 1.14k | "f16vec2 uint16BitsToFloat16(u16vec2);" |
4431 | 1.14k | "f16vec3 uint16BitsToFloat16(u16vec3);" |
4432 | 1.14k | "f16vec4 uint16BitsToFloat16(u16vec4);" |
4433 | | |
4434 | 1.14k | "float16_t int16BitsToHalf(int16_t);" |
4435 | 1.14k | "f16vec2 int16BitsToHalf(i16vec2);" |
4436 | 1.14k | "f16vec3 int16BitsToHalf(i16vec3);" |
4437 | 1.14k | "f16vec4 int16BitsToHalf(i16vec4);" |
4438 | | |
4439 | 1.14k | "float16_t uint16BitsToHalf(uint16_t);" |
4440 | 1.14k | "f16vec2 uint16BitsToHalf(u16vec2);" |
4441 | 1.14k | "f16vec3 uint16BitsToHalf(u16vec3);" |
4442 | 1.14k | "f16vec4 uint16BitsToHalf(u16vec4);" |
4443 | | |
4444 | 1.14k | "int packInt2x16(i16vec2);" |
4445 | 1.14k | "uint packUint2x16(u16vec2);" |
4446 | 1.14k | "int64_t packInt4x16(i16vec4);" |
4447 | 1.14k | "uint64_t packUint4x16(u16vec4);" |
4448 | 1.14k | "i16vec2 unpackInt2x16(int);" |
4449 | 1.14k | "u16vec2 unpackUint2x16(uint);" |
4450 | 1.14k | "i16vec4 unpackInt4x16(int64_t);" |
4451 | 1.14k | "u16vec4 unpackUint4x16(uint64_t);" |
4452 | | |
4453 | 1.14k | "bvec2 lessThan(i16vec2, i16vec2);" |
4454 | 1.14k | "bvec3 lessThan(i16vec3, i16vec3);" |
4455 | 1.14k | "bvec4 lessThan(i16vec4, i16vec4);" |
4456 | 1.14k | "bvec2 lessThan(u16vec2, u16vec2);" |
4457 | 1.14k | "bvec3 lessThan(u16vec3, u16vec3);" |
4458 | 1.14k | "bvec4 lessThan(u16vec4, u16vec4);" |
4459 | | |
4460 | 1.14k | "bvec2 lessThanEqual(i16vec2, i16vec2);" |
4461 | 1.14k | "bvec3 lessThanEqual(i16vec3, i16vec3);" |
4462 | 1.14k | "bvec4 lessThanEqual(i16vec4, i16vec4);" |
4463 | 1.14k | "bvec2 lessThanEqual(u16vec2, u16vec2);" |
4464 | 1.14k | "bvec3 lessThanEqual(u16vec3, u16vec3);" |
4465 | 1.14k | "bvec4 lessThanEqual(u16vec4, u16vec4);" |
4466 | | |
4467 | 1.14k | "bvec2 greaterThan(i16vec2, i16vec2);" |
4468 | 1.14k | "bvec3 greaterThan(i16vec3, i16vec3);" |
4469 | 1.14k | "bvec4 greaterThan(i16vec4, i16vec4);" |
4470 | 1.14k | "bvec2 greaterThan(u16vec2, u16vec2);" |
4471 | 1.14k | "bvec3 greaterThan(u16vec3, u16vec3);" |
4472 | 1.14k | "bvec4 greaterThan(u16vec4, u16vec4);" |
4473 | | |
4474 | 1.14k | "bvec2 greaterThanEqual(i16vec2, i16vec2);" |
4475 | 1.14k | "bvec3 greaterThanEqual(i16vec3, i16vec3);" |
4476 | 1.14k | "bvec4 greaterThanEqual(i16vec4, i16vec4);" |
4477 | 1.14k | "bvec2 greaterThanEqual(u16vec2, u16vec2);" |
4478 | 1.14k | "bvec3 greaterThanEqual(u16vec3, u16vec3);" |
4479 | 1.14k | "bvec4 greaterThanEqual(u16vec4, u16vec4);" |
4480 | | |
4481 | 1.14k | "bvec2 equal(i16vec2, i16vec2);" |
4482 | 1.14k | "bvec3 equal(i16vec3, i16vec3);" |
4483 | 1.14k | "bvec4 equal(i16vec4, i16vec4);" |
4484 | 1.14k | "bvec2 equal(u16vec2, u16vec2);" |
4485 | 1.14k | "bvec3 equal(u16vec3, u16vec3);" |
4486 | 1.14k | "bvec4 equal(u16vec4, u16vec4);" |
4487 | | |
4488 | 1.14k | "bvec2 notEqual(i16vec2, i16vec2);" |
4489 | 1.14k | "bvec3 notEqual(i16vec3, i16vec3);" |
4490 | 1.14k | "bvec4 notEqual(i16vec4, i16vec4);" |
4491 | 1.14k | "bvec2 notEqual(u16vec2, u16vec2);" |
4492 | 1.14k | "bvec3 notEqual(u16vec3, u16vec3);" |
4493 | 1.14k | "bvec4 notEqual(u16vec4, u16vec4);" |
4494 | | |
4495 | 1.14k | " int16_t bitfieldExtract( int16_t, int16_t, int16_t);" |
4496 | 1.14k | "i16vec2 bitfieldExtract(i16vec2, int16_t, int16_t);" |
4497 | 1.14k | "i16vec3 bitfieldExtract(i16vec3, int16_t, int16_t);" |
4498 | 1.14k | "i16vec4 bitfieldExtract(i16vec4, int16_t, int16_t);" |
4499 | | |
4500 | 1.14k | " uint16_t bitfieldExtract( uint16_t, int16_t, int16_t);" |
4501 | 1.14k | "u16vec2 bitfieldExtract(u16vec2, int16_t, int16_t);" |
4502 | 1.14k | "u16vec3 bitfieldExtract(u16vec3, int16_t, int16_t);" |
4503 | 1.14k | "u16vec4 bitfieldExtract(u16vec4, int16_t, int16_t);" |
4504 | | |
4505 | 1.14k | " int16_t bitfieldInsert( int16_t base, int16_t, int16_t, int16_t);" |
4506 | 1.14k | "i16vec2 bitfieldInsert(i16vec2 base, i16vec2, int16_t, int16_t);" |
4507 | 1.14k | "i16vec3 bitfieldInsert(i16vec3 base, i16vec3, int16_t, int16_t);" |
4508 | 1.14k | "i16vec4 bitfieldInsert(i16vec4 base, i16vec4, int16_t, int16_t);" |
4509 | | |
4510 | 1.14k | " uint16_t bitfieldInsert( uint16_t base, uint16_t, int16_t, int16_t);" |
4511 | 1.14k | "u16vec2 bitfieldInsert(u16vec2 base, u16vec2, int16_t, int16_t);" |
4512 | 1.14k | "u16vec3 bitfieldInsert(u16vec3 base, u16vec3, int16_t, int16_t);" |
4513 | 1.14k | "u16vec4 bitfieldInsert(u16vec4 base, u16vec4, int16_t, int16_t);" |
4514 | | |
4515 | 1.14k | " int16_t bitCount( int16_t);" |
4516 | 1.14k | "i16vec2 bitCount(i16vec2);" |
4517 | 1.14k | "i16vec3 bitCount(i16vec3);" |
4518 | 1.14k | "i16vec4 bitCount(i16vec4);" |
4519 | | |
4520 | 1.14k | " int16_t bitCount( uint16_t);" |
4521 | 1.14k | "i16vec2 bitCount(u16vec2);" |
4522 | 1.14k | "i16vec3 bitCount(u16vec3);" |
4523 | 1.14k | "i16vec4 bitCount(u16vec4);" |
4524 | | |
4525 | 1.14k | "int16_t bitfieldReverse(highp int16_t);" |
4526 | 1.14k | "i16vec2 bitfieldReverse(highp i16vec2);" |
4527 | 1.14k | "i16vec3 bitfieldReverse(highp i16vec3);" |
4528 | 1.14k | "i16vec4 bitfieldReverse(highp i16vec4);" |
4529 | | |
4530 | 1.14k | "uint16_t bitfieldReverse(highp uint16_t);" |
4531 | 1.14k | "u16vec2 bitfieldReverse(highp u16vec2);" |
4532 | 1.14k | "u16vec3 bitfieldReverse(highp u16vec3);" |
4533 | 1.14k | "u16vec4 bitfieldReverse(highp u16vec4);" |
4534 | | |
4535 | 1.14k | " int16_t findLSB( int16_t);" |
4536 | 1.14k | "i16vec2 findLSB(i16vec2);" |
4537 | 1.14k | "i16vec3 findLSB(i16vec3);" |
4538 | 1.14k | "i16vec4 findLSB(i16vec4);" |
4539 | | |
4540 | 1.14k | " int16_t findLSB( uint16_t);" |
4541 | 1.14k | "i16vec2 findLSB(u16vec2);" |
4542 | 1.14k | "i16vec3 findLSB(u16vec3);" |
4543 | 1.14k | "i16vec4 findLSB(u16vec4);" |
4544 | | |
4545 | 1.14k | " int16_t findMSB( int16_t);" |
4546 | 1.14k | "i16vec2 findMSB(i16vec2);" |
4547 | 1.14k | "i16vec3 findMSB(i16vec3);" |
4548 | 1.14k | "i16vec4 findMSB(i16vec4);" |
4549 | | |
4550 | 1.14k | " int16_t findMSB( uint16_t);" |
4551 | 1.14k | "i16vec2 findMSB(u16vec2);" |
4552 | 1.14k | "i16vec3 findMSB(u16vec3);" |
4553 | 1.14k | "i16vec4 findMSB(u16vec4);" |
4554 | | |
4555 | 1.14k | "int16_t pack16(i8vec2);" |
4556 | 1.14k | "uint16_t pack16(u8vec2);" |
4557 | 1.14k | "int32_t pack32(i8vec4);" |
4558 | 1.14k | "uint32_t pack32(u8vec4);" |
4559 | 1.14k | "int32_t pack32(i16vec2);" |
4560 | 1.14k | "uint32_t pack32(u16vec2);" |
4561 | 1.14k | "int64_t pack64(i16vec4);" |
4562 | 1.14k | "uint64_t pack64(u16vec4);" |
4563 | 1.14k | "int64_t pack64(i32vec2);" |
4564 | 1.14k | "uint64_t pack64(u32vec2);" |
4565 | | |
4566 | 1.14k | "i8vec2 unpack8(int16_t);" |
4567 | 1.14k | "u8vec2 unpack8(uint16_t);" |
4568 | 1.14k | "i8vec4 unpack8(int32_t);" |
4569 | 1.14k | "u8vec4 unpack8(uint32_t);" |
4570 | 1.14k | "i16vec2 unpack16(int32_t);" |
4571 | 1.14k | "u16vec2 unpack16(uint32_t);" |
4572 | 1.14k | "i16vec4 unpack16(int64_t);" |
4573 | 1.14k | "u16vec4 unpack16(uint64_t);" |
4574 | 1.14k | "i32vec2 unpack32(int64_t);" |
4575 | 1.14k | "u32vec2 unpack32(uint64_t);" |
4576 | | |
4577 | | // GL_EXT_expect_assume |
4578 | 1.14k | "int8_t expectEXT(int8_t, int8_t);" |
4579 | 1.14k | "i8vec2 expectEXT(i8vec2, i8vec2);" |
4580 | 1.14k | "i8vec3 expectEXT(i8vec3, i8vec3);" |
4581 | 1.14k | "i8vec4 expectEXT(i8vec4, i8vec4);" |
4582 | | |
4583 | 1.14k | "uint8_t expectEXT(uint8_t, uint8_t);" |
4584 | 1.14k | "u8vec2 expectEXT(u8vec2, u8vec2);" |
4585 | 1.14k | "u8vec3 expectEXT(u8vec3, u8vec3);" |
4586 | 1.14k | "u8vec4 expectEXT(u8vec4, u8vec4);" |
4587 | | |
4588 | 1.14k | "int16_t expectEXT(int16_t, int16_t);" |
4589 | 1.14k | "i16vec2 expectEXT(i16vec2, i16vec2);" |
4590 | 1.14k | "i16vec3 expectEXT(i16vec3, i16vec3);" |
4591 | 1.14k | "i16vec4 expectEXT(i16vec4, i16vec4);" |
4592 | | |
4593 | 1.14k | "uint16_t expectEXT(uint16_t, uint16_t);" |
4594 | 1.14k | "u16vec2 expectEXT(u16vec2, u16vec2);" |
4595 | 1.14k | "u16vec3 expectEXT(u16vec3, u16vec3);" |
4596 | 1.14k | "u16vec4 expectEXT(u16vec4, u16vec4);" |
4597 | | |
4598 | 1.14k | "int64_t expectEXT(int64_t, int64_t);" |
4599 | 1.14k | "i64vec2 expectEXT(i64vec2, i64vec2);" |
4600 | 1.14k | "i64vec3 expectEXT(i64vec3, i64vec3);" |
4601 | 1.14k | "i64vec4 expectEXT(i64vec4, i64vec4);" |
4602 | | |
4603 | 1.14k | "uint64_t expectEXT(uint64_t, uint64_t);" |
4604 | 1.14k | "u64vec2 expectEXT(u64vec2, u64vec2);" |
4605 | 1.14k | "u64vec3 expectEXT(u64vec3, u64vec3);" |
4606 | 1.14k | "u64vec4 expectEXT(u64vec4, u64vec4);" |
4607 | 1.14k | "\n"); |
4608 | 1.14k | } |
4609 | | |
4610 | | // Builtins for GL_EXT_texture_shadow_lod |
4611 | 4.34k | if ((profile == EEsProfile && version >= 300) || ((profile != EEsProfile && version >= 130))) { |
4612 | 4.34k | commonBuiltins.append( |
4613 | 4.34k | "float texture(sampler2DArrayShadow, vec4, float);" |
4614 | 4.34k | "float texture(samplerCubeArrayShadow, vec4, float, float);" |
4615 | 4.34k | "float textureLod(sampler2DArrayShadow, vec4, float);" |
4616 | 4.34k | "float textureLod(samplerCubeShadow, vec4, float);" |
4617 | 4.34k | "float textureLod(samplerCubeArrayShadow, vec4, float, float);" |
4618 | 4.34k | "float textureLodOffset(sampler2DArrayShadow, vec4, float, ivec2);" |
4619 | 4.34k | "float textureOffset(sampler2DArrayShadow, vec4 , ivec2, float);" |
4620 | 4.34k | "\n"); |
4621 | 4.34k | } |
4622 | | |
4623 | 4.34k | if (profile != EEsProfile && version >= 450) { |
4624 | 883 | stageBuiltins[EShLangFragment].append(derivativesAndControl64bits); |
4625 | 883 | stageBuiltins[EShLangFragment].append( |
4626 | 883 | "float64_t interpolateAtCentroid(float64_t);" |
4627 | 883 | "f64vec2 interpolateAtCentroid(f64vec2);" |
4628 | 883 | "f64vec3 interpolateAtCentroid(f64vec3);" |
4629 | 883 | "f64vec4 interpolateAtCentroid(f64vec4);" |
4630 | | |
4631 | 883 | "float64_t interpolateAtSample(float64_t, int);" |
4632 | 883 | "f64vec2 interpolateAtSample(f64vec2, int);" |
4633 | 883 | "f64vec3 interpolateAtSample(f64vec3, int);" |
4634 | 883 | "f64vec4 interpolateAtSample(f64vec4, int);" |
4635 | | |
4636 | 883 | "float64_t interpolateAtOffset(float64_t, f64vec2);" |
4637 | 883 | "f64vec2 interpolateAtOffset(f64vec2, f64vec2);" |
4638 | 883 | "f64vec3 interpolateAtOffset(f64vec3, f64vec2);" |
4639 | 883 | "f64vec4 interpolateAtOffset(f64vec4, f64vec2);" |
4640 | | |
4641 | 883 | "\n"); |
4642 | | |
4643 | 883 | } |
4644 | | |
4645 | | // GL_EXT_expect_assume |
4646 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
4647 | 4.34k | ((profile != EEsProfile && version >= 140))) { |
4648 | 4.34k | commonBuiltins.append( |
4649 | 4.34k | "void assumeEXT(bool);" |
4650 | | |
4651 | 4.34k | "bool expectEXT(bool, bool);" |
4652 | 4.34k | "bvec2 expectEXT(bvec2, bvec2);" |
4653 | 4.34k | "bvec3 expectEXT(bvec3, bvec3);" |
4654 | 4.34k | "bvec4 expectEXT(bvec4, bvec4);" |
4655 | | |
4656 | 4.34k | "int expectEXT(int, int);" |
4657 | 4.34k | "ivec2 expectEXT(ivec2, ivec2);" |
4658 | 4.34k | "ivec3 expectEXT(ivec3, ivec3);" |
4659 | 4.34k | "ivec4 expectEXT(ivec4, ivec4);" |
4660 | | |
4661 | 4.34k | "uint expectEXT(uint, uint);" |
4662 | 4.34k | "uvec2 expectEXT(uvec2, uvec2);" |
4663 | 4.34k | "uvec3 expectEXT(uvec3, uvec3);" |
4664 | 4.34k | "uvec4 expectEXT(uvec4, uvec4);" |
4665 | 4.34k | "\n"); |
4666 | 4.34k | } |
4667 | | |
4668 | | // QCOM_image_processing |
4669 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
4670 | 4.34k | (profile != EEsProfile && version >= 140)) { |
4671 | 4.34k | commonBuiltins.append( |
4672 | 4.34k | "vec4 textureWeightedQCOM(sampler2D, vec2, sampler2DArray);" |
4673 | 4.34k | "vec4 textureWeightedQCOM(sampler2D, vec2, sampler1DArray);" |
4674 | 4.34k | "vec4 textureBoxFilterQCOM(sampler2D, vec2, vec2);" |
4675 | 4.34k | "vec4 textureBlockMatchSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" |
4676 | 4.34k | "vec4 textureBlockMatchSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" |
4677 | | |
4678 | 4.34k | "vec4 textureBlockMatchWindowSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" |
4679 | 4.34k | "vec4 textureBlockMatchWindowSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" |
4680 | 4.34k | "vec4 textureBlockMatchGatherSSDQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" |
4681 | 4.34k | "vec4 textureBlockMatchGatherSADQCOM(sampler2D, uvec2, sampler2D, uvec2, uvec2);" |
4682 | 4.34k | "\n"); |
4683 | 4.34k | } |
4684 | | |
4685 | | //============================================================================ |
4686 | | // |
4687 | | // Prototypes for built-in functions seen by vertex shaders only. |
4688 | | // (Except legacy lod functions, where it depends which release they are |
4689 | | // vertex only.) |
4690 | | // |
4691 | | //============================================================================ |
4692 | | |
4693 | | // |
4694 | | // Geometric Functions. |
4695 | | // |
4696 | 4.34k | if (spvVersion.vulkan == 0 && IncludeLegacy(version, profile, spvVersion)) |
4697 | 0 | stageBuiltins[EShLangVertex].append("vec4 ftransform();"); |
4698 | | |
4699 | | // |
4700 | | // Original-style texture Functions with lod. |
4701 | | // |
4702 | 4.34k | TString* s; |
4703 | 4.34k | if (version == 100) |
4704 | 0 | s = &stageBuiltins[EShLangVertex]; |
4705 | 4.34k | else |
4706 | 4.34k | s = &commonBuiltins; |
4707 | 4.34k | if ((profile == EEsProfile && version == 100) || |
4708 | 4.34k | profile == ECompatibilityProfile || |
4709 | 4.32k | (profile == ECoreProfile && version < 420) || |
4710 | 3.80k | profile == ENoProfile) { |
4711 | 2.84k | if (spvVersion.spv == 0) { |
4712 | 0 | s->append( |
4713 | 0 | "vec4 texture2DLod(sampler2D, vec2, float);" // GL_ARB_shader_texture_lod |
4714 | 0 | "vec4 texture2DProjLod(sampler2D, vec3, float);" // GL_ARB_shader_texture_lod |
4715 | 0 | "vec4 texture2DProjLod(sampler2D, vec4, float);" // GL_ARB_shader_texture_lod |
4716 | 0 | "vec4 texture3DLod(sampler3D, vec3, float);" // GL_ARB_shader_texture_lod // OES_texture_3D, but caught by keyword check |
4717 | 0 | "vec4 texture3DProjLod(sampler3D, vec4, float);" // GL_ARB_shader_texture_lod // OES_texture_3D, but caught by keyword check |
4718 | 0 | "vec4 textureCubeLod(samplerCube, vec3, float);" // GL_ARB_shader_texture_lod |
4719 | |
|
4720 | 0 | "\n"); |
4721 | 0 | } |
4722 | 2.84k | } |
4723 | 4.34k | if ( profile == ECompatibilityProfile || |
4724 | 4.32k | (profile == ECoreProfile && version < 420) || |
4725 | 3.80k | profile == ENoProfile) { |
4726 | 2.84k | if (spvVersion.spv == 0) { |
4727 | 0 | s->append( |
4728 | 0 | "vec4 texture1DLod(sampler1D, float, float);" // GL_ARB_shader_texture_lod |
4729 | 0 | "vec4 texture1DProjLod(sampler1D, vec2, float);" // GL_ARB_shader_texture_lod |
4730 | 0 | "vec4 texture1DProjLod(sampler1D, vec4, float);" // GL_ARB_shader_texture_lod |
4731 | 0 | "vec4 shadow1DLod(sampler1DShadow, vec3, float);" // GL_ARB_shader_texture_lod |
4732 | 0 | "vec4 shadow2DLod(sampler2DShadow, vec3, float);" // GL_ARB_shader_texture_lod |
4733 | 0 | "vec4 shadow1DProjLod(sampler1DShadow, vec4, float);" // GL_ARB_shader_texture_lod |
4734 | 0 | "vec4 shadow2DProjLod(sampler2DShadow, vec4, float);" // GL_ARB_shader_texture_lod |
4735 | |
|
4736 | 0 | "vec4 texture1DGradARB(sampler1D, float, float, float);" // GL_ARB_shader_texture_lod |
4737 | 0 | "vec4 texture1DProjGradARB(sampler1D, vec2, float, float);" // GL_ARB_shader_texture_lod |
4738 | 0 | "vec4 texture1DProjGradARB(sampler1D, vec4, float, float);" // GL_ARB_shader_texture_lod |
4739 | 0 | "vec4 texture2DGradARB(sampler2D, vec2, vec2, vec2);" // GL_ARB_shader_texture_lod |
4740 | 0 | "vec4 texture2DProjGradARB(sampler2D, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod |
4741 | 0 | "vec4 texture2DProjGradARB(sampler2D, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod |
4742 | 0 | "vec4 texture3DGradARB(sampler3D, vec3, vec3, vec3);" // GL_ARB_shader_texture_lod |
4743 | 0 | "vec4 texture3DProjGradARB(sampler3D, vec4, vec3, vec3);" // GL_ARB_shader_texture_lod |
4744 | 0 | "vec4 textureCubeGradARB(samplerCube, vec3, vec3, vec3);" // GL_ARB_shader_texture_lod |
4745 | 0 | "vec4 shadow1DGradARB(sampler1DShadow, vec3, float, float);" // GL_ARB_shader_texture_lod |
4746 | 0 | "vec4 shadow1DProjGradARB( sampler1DShadow, vec4, float, float);" // GL_ARB_shader_texture_lod |
4747 | 0 | "vec4 shadow2DGradARB(sampler2DShadow, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod |
4748 | 0 | "vec4 shadow2DProjGradARB( sampler2DShadow, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod |
4749 | 0 | "vec4 texture2DRectGradARB(sampler2DRect, vec2, vec2, vec2);" // GL_ARB_shader_texture_lod |
4750 | 0 | "vec4 texture2DRectProjGradARB( sampler2DRect, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod |
4751 | 0 | "vec4 texture2DRectProjGradARB( sampler2DRect, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod |
4752 | 0 | "vec4 shadow2DRectGradARB( sampler2DRectShadow, vec3, vec2, vec2);" // GL_ARB_shader_texture_lod |
4753 | 0 | "vec4 shadow2DRectProjGradARB(sampler2DRectShadow, vec4, vec2, vec2);" // GL_ARB_shader_texture_lod |
4754 | |
|
4755 | 0 | "\n"); |
4756 | 0 | } |
4757 | 2.84k | } |
4758 | | |
4759 | 4.34k | if ((profile != EEsProfile && version >= 150) || |
4760 | 2.57k | (profile == EEsProfile && version >= 310)) { |
4761 | | //============================================================================ |
4762 | | // |
4763 | | // Prototypes for built-in functions seen by geometry shaders only. |
4764 | | // |
4765 | | //============================================================================ |
4766 | 2.02k | if (profile != EEsProfile && version >= 150) { |
4767 | 1.76k | stageBuiltins[EShLangGeometry].append( |
4768 | 1.76k | "void EmitStreamVertex(int);" |
4769 | 1.76k | "void EndStreamPrimitive(int);" |
4770 | 1.76k | ); |
4771 | 1.76k | } |
4772 | 2.02k | stageBuiltins[EShLangGeometry].append( |
4773 | 2.02k | "void EmitVertex();" |
4774 | 2.02k | "void EndPrimitive();" |
4775 | 2.02k | "\n"); |
4776 | 2.02k | } |
4777 | | |
4778 | | //============================================================================ |
4779 | | // |
4780 | | // Prototypes for all control functions. |
4781 | | // |
4782 | | //============================================================================ |
4783 | 4.34k | bool esBarrier = (profile == EEsProfile && version >= 310); |
4784 | 4.34k | if ((profile != EEsProfile && version >= 150) || esBarrier) |
4785 | 2.02k | stageBuiltins[EShLangTessControl].append( |
4786 | 2.02k | "void barrier();" |
4787 | 2.02k | ); |
4788 | 4.34k | if ((profile != EEsProfile && version >= 420) || esBarrier) |
4789 | 1.50k | stageBuiltins[EShLangCompute].append( |
4790 | 1.50k | "void barrier();" |
4791 | 1.50k | ); |
4792 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
4793 | 927 | stageBuiltins[EShLangMesh].append( |
4794 | 927 | "void barrier();" |
4795 | 927 | ); |
4796 | 927 | stageBuiltins[EShLangTask].append( |
4797 | 927 | "void barrier();" |
4798 | 927 | ); |
4799 | 927 | } |
4800 | 4.34k | if ((profile != EEsProfile && version >= 130) || esBarrier) |
4801 | 4.34k | commonBuiltins.append( |
4802 | 4.34k | "void memoryBarrier();" |
4803 | 4.34k | ); |
4804 | 4.34k | if ((profile != EEsProfile && version >= 420) || esBarrier) { |
4805 | 1.50k | commonBuiltins.append( |
4806 | 1.50k | "void memoryBarrierBuffer();" |
4807 | 1.50k | ); |
4808 | 1.50k | stageBuiltins[EShLangCompute].append( |
4809 | 1.50k | "void memoryBarrierShared();" |
4810 | 1.50k | "void groupMemoryBarrier();" |
4811 | 1.50k | ); |
4812 | 1.50k | } |
4813 | 4.34k | if ((profile != EEsProfile && version >= 420) || esBarrier) { |
4814 | 1.50k | if (spvVersion.vulkan == 0 || spvVersion.vulkanRelaxed) { |
4815 | 0 | commonBuiltins.append("void memoryBarrierAtomicCounter();"); |
4816 | 0 | } |
4817 | 1.50k | commonBuiltins.append("void memoryBarrierImage();"); |
4818 | 1.50k | } |
4819 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
4820 | 927 | stageBuiltins[EShLangMesh].append( |
4821 | 927 | "void memoryBarrierShared();" |
4822 | 927 | "void groupMemoryBarrier();" |
4823 | 927 | ); |
4824 | 927 | stageBuiltins[EShLangTask].append( |
4825 | 927 | "void memoryBarrierShared();" |
4826 | 927 | "void groupMemoryBarrier();" |
4827 | 927 | ); |
4828 | 927 | } |
4829 | | |
4830 | 4.34k | commonBuiltins.append("void controlBarrier(int, int, int, int);\n" |
4831 | 4.34k | "void memoryBarrier(int, int, int);\n"); |
4832 | | |
4833 | 4.34k | commonBuiltins.append("void debugPrintfEXT();\n"); |
4834 | | |
4835 | 4.34k | if (profile != EEsProfile && version >= 450) { |
4836 | | // coopMatStoreNV perhaps ought to have "out" on the buf parameter, but |
4837 | | // adding it introduces undesirable tempArgs on the stack. What we want |
4838 | | // is more like "buf" thought of as a pointer value being an in parameter. |
4839 | 883 | stageBuiltins[EShLangCompute].append( |
4840 | 883 | "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal float16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4841 | 883 | "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal float[] buf, uint element, uint stride, bool colMajor);\n" |
4842 | 883 | "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4843 | 883 | "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4844 | 883 | "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" |
4845 | 883 | "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4846 | 883 | "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" |
4847 | 883 | "void coopMatLoadNV(out fcoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" |
4848 | | |
4849 | 883 | "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal float16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4850 | 883 | "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal float[] buf, uint element, uint stride, bool colMajor);\n" |
4851 | 883 | "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal float64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4852 | 883 | "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4853 | 883 | "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4854 | 883 | "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" |
4855 | 883 | "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4856 | 883 | "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" |
4857 | 883 | "void coopMatStoreNV(fcoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" |
4858 | | |
4859 | 883 | "fcoopmatNV coopMatMulAddNV(fcoopmatNV A, fcoopmatNV B, fcoopmatNV C);\n" |
4860 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal int8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4861 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal int16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4862 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal int[] buf, uint element, uint stride, bool colMajor);\n" |
4863 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal int64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4864 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal ivec2[] buf, uint element, uint stride, bool colMajor);\n" |
4865 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal ivec4[] buf, uint element, uint stride, bool colMajor);\n" |
4866 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4867 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4868 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" |
4869 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4870 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" |
4871 | 883 | "void coopMatLoadNV(out icoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" |
4872 | | |
4873 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal int8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4874 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal int16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4875 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal int[] buf, uint element, uint stride, bool colMajor);\n" |
4876 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal int64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4877 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal ivec2[] buf, uint element, uint stride, bool colMajor);\n" |
4878 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal ivec4[] buf, uint element, uint stride, bool colMajor);\n" |
4879 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4880 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4881 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" |
4882 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4883 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" |
4884 | 883 | "void coopMatLoadNV(out ucoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" |
4885 | | |
4886 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal int8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4887 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal int16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4888 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal int[] buf, uint element, uint stride, bool colMajor);\n" |
4889 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal int64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4890 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal ivec2[] buf, uint element, uint stride, bool colMajor);\n" |
4891 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal ivec4[] buf, uint element, uint stride, bool colMajor);\n" |
4892 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4893 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4894 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" |
4895 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4896 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" |
4897 | 883 | "void coopMatStoreNV(icoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" |
4898 | | |
4899 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal int8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4900 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal int16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4901 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal int[] buf, uint element, uint stride, bool colMajor);\n" |
4902 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal int64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4903 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal ivec2[] buf, uint element, uint stride, bool colMajor);\n" |
4904 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal ivec4[] buf, uint element, uint stride, bool colMajor);\n" |
4905 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uint8_t[] buf, uint element, uint stride, bool colMajor);\n" |
4906 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uint16_t[] buf, uint element, uint stride, bool colMajor);\n" |
4907 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uint[] buf, uint element, uint stride, bool colMajor);\n" |
4908 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uint64_t[] buf, uint element, uint stride, bool colMajor);\n" |
4909 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uvec2[] buf, uint element, uint stride, bool colMajor);\n" |
4910 | 883 | "void coopMatStoreNV(ucoopmatNV m, volatile coherent nontemporal uvec4[] buf, uint element, uint stride, bool colMajor);\n" |
4911 | | |
4912 | 883 | "icoopmatNV coopMatMulAddNV(icoopmatNV A, icoopmatNV B, icoopmatNV C);\n" |
4913 | 883 | "ucoopmatNV coopMatMulAddNV(ucoopmatNV A, ucoopmatNV B, ucoopmatNV C);\n" |
4914 | 883 | ); |
4915 | | |
4916 | 883 | std::stringstream cooperativeMatrixFuncs; |
4917 | | |
4918 | 883 | { |
4919 | 883 | static const char *allTypes[] = |
4920 | 883 | { |
4921 | 883 | "float", "vec2", "vec4", |
4922 | 883 | "float16_t", "f16vec2", "f16vec4", |
4923 | 883 | "bfloat16_t", "bf16vec2", "bf16vec4", |
4924 | 883 | "floate5m2_t", "fe5m2vec2", "fe5m2vec4", |
4925 | 883 | "floate4m3_t", "fe4m3vec2", "fe4m3vec4", |
4926 | 883 | "double", "dvec2", "dvec4", |
4927 | 883 | "int8_t", "i8vec2", "i8vec4", |
4928 | 883 | "int16_t", "i16vec2", "i16vec4", |
4929 | 883 | "int", "ivec2", "ivec4", |
4930 | 883 | "int64_t", "i64vec2", "i64vec4", |
4931 | 883 | "uint8_t", "u8vec2", "u8vec4", |
4932 | 883 | "uint16_t", "u16vec2", "u16vec4", |
4933 | 883 | "uint", "uvec2", "uvec4", |
4934 | 883 | "uint64_t", "u64vec2", "u64vec4", |
4935 | 883 | }; |
4936 | 1.76k | for (auto elemTy : {"uint", "uint64_t"}) { |
4937 | 74.1k | for (auto t : allTypes) { |
4938 | 74.1k | cooperativeMatrixFuncs << "void coopMatLoad(out coopmat m, volatile coherent nontemporal " << t << "[] buf, " << elemTy << " element, uint stride, int matrixLayout);\n"; |
4939 | 74.1k | cooperativeMatrixFuncs << "void coopMatStore(coopmat m, volatile coherent nontemporal " << t << "[] buf, " << elemTy << " element, uint stride, int matrixLayout);\n"; |
4940 | 74.1k | } |
4941 | | // Just use uint8_t for buffer type, we have special matching rules to allow any conversion |
4942 | 1.76k | cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t);\n"; |
4943 | 1.76k | cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v);\n"; |
4944 | 1.76k | cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, __function f);\n"; |
4945 | 1.76k | cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v, __function f);\n"; |
4946 | 1.76k | cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t);\n"; |
4947 | 1.76k | cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v);\n"; |
4948 | 1.76k | } |
4949 | 883 | } |
4950 | | |
4951 | 883 | cooperativeMatrixFuncs << |
4952 | 883 | "coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C);\n" |
4953 | 883 | "coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C, int matrixOperands);\n"; |
4954 | | |
4955 | 883 | commonBuiltins.append(cooperativeMatrixFuncs.str().c_str()); |
4956 | | |
4957 | 883 | commonBuiltins.append( |
4958 | 883 | "const int gl_MatrixUseA = 0;\n" |
4959 | 883 | "const int gl_MatrixUseB = 1;\n" |
4960 | 883 | "const int gl_MatrixUseAccumulator = 2;\n" |
4961 | 883 | "const int gl_MatrixOperandsSaturatingAccumulation = 0x10;\n" |
4962 | 883 | "const int gl_CooperativeMatrixLayoutRowMajor = 0;\n" |
4963 | 883 | "const int gl_CooperativeMatrixLayoutColumnMajor = 1;\n" |
4964 | 883 | "const int gl_CooperativeMatrixLayoutRowBlockedInterleavedARM = 4202;\n" |
4965 | 883 | "const int gl_CooperativeMatrixLayoutColumnBlockedInterleavedARM = 4203;\n" |
4966 | 883 | "\n" |
4967 | 883 | ); |
4968 | | |
4969 | 883 | commonBuiltins.append( |
4970 | 883 | "void coopMatTransposeNV(out coopmat, coopmat);" |
4971 | 883 | "void coopMatReduceNV(out coopmat, coopmat, int, __function);" |
4972 | 883 | "void coopMatPerElementNV();" |
4973 | 883 | ); |
4974 | | |
4975 | 883 | commonBuiltins.append( |
4976 | 883 | "const int gl_CooperativeMatrixReduceRowNV = 0x1;\n" |
4977 | 883 | "const int gl_CooperativeMatrixReduceColumnNV = 0x2;\n" |
4978 | 883 | "const int gl_CooperativeMatrixReduceRowAndColumnNV = 0x3;\n" |
4979 | 883 | "const int gl_CooperativeMatrixReduce2x2NV = 0x4;\n" |
4980 | 883 | "\n" |
4981 | 883 | ); |
4982 | | |
4983 | 883 | commonBuiltins.append( |
4984 | 883 | "const int gl_CooperativeMatrixClampModeUndefinedNV = 0x0;\n" |
4985 | 883 | "const int gl_CooperativeMatrixClampModeConstantNV = 0x1;\n" |
4986 | 883 | "const int gl_CooperativeMatrixClampModeClampToEdgeNV = 0x2;\n" |
4987 | 883 | "const int gl_CooperativeMatrixClampModeRepeatNV = 0x3;\n" |
4988 | 883 | "const int gl_CooperativeMatrixClampModeMirrorRepeatNV = 0x4;\n" |
4989 | 883 | "\n" |
4990 | 883 | ); |
4991 | | |
4992 | 883 | { |
4993 | 883 | std::stringstream coopMatConvFuncs; |
4994 | | |
4995 | 883 | const std::string eltTypes[] = {"uint32_t", "uint", "int32_t", "int", "float32_t", "float", "float16_t"}; |
4996 | | |
4997 | 6.18k | for (auto srcEltTy : eltTypes) { |
4998 | 43.2k | for (auto dstEltTy : eltTypes) { |
4999 | 43.2k | coopMatConvFuncs << "void bitcastQCOM(" << srcEltTy.c_str() << " SrcArr[], " << dstEltTy.c_str() |
5000 | 43.2k | << " DstArr[]);\n"; |
5001 | 43.2k | } |
5002 | 6.18k | } |
5003 | 883 | coopMatConvFuncs << "\n"; |
5004 | | |
5005 | 7.06k | for (auto eltTy : {"float32_t", "float16_t", "int8_t", "uint8_t", "uint32_t", "uint", "int32_t", "int"}) { |
5006 | 7.06k | coopMatConvFuncs << "void vectorToCoopmatQCOM(" << eltTy << " SrcVec[], coopmat CM);\n"; |
5007 | 7.06k | coopMatConvFuncs << "void coopmatToVectorQCOM(coopmat CM, " << eltTy << " Dstvec[]);\n"; |
5008 | 7.06k | } |
5009 | | |
5010 | 6.18k | for (auto eltTy : {"uint32_t", "uint", "int32_t", "int", "float32_t", "float", "float16_t"}) { |
5011 | 6.18k | coopMatConvFuncs << "void extractSubArrayQCOM(" << eltTy << " arr[], uint index, " << eltTy << " subarr[]);\n"; |
5012 | 6.18k | } |
5013 | | |
5014 | 883 | commonBuiltins.append(coopMatConvFuncs.str().c_str()); |
5015 | 883 | } |
5016 | | |
5017 | 883 | commonBuiltins.append( |
5018 | 883 | "tensorLayoutNV createTensorLayoutNV(uint Dim);\n" |
5019 | 883 | "tensorLayoutNV createTensorLayoutNV(uint Dim, uint Mode);\n" |
5020 | | |
5021 | 883 | "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0);\n" |
5022 | 883 | "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0, uint blockSize1);\n" |
5023 | 883 | "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0, uint blockSize1, uint blockSize2);\n" |
5024 | 883 | "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0, uint blockSize1, uint blockSize2, uint blockSize3);\n" |
5025 | 883 | "tensorLayoutNV setTensorLayoutBlockSizeNV(tensorLayoutNV t, uint blockSize0, uint blockSize1, uint blockSize2, uint blockSize3, uint blockSize4);\n" |
5026 | | |
5027 | 883 | "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0);\n" |
5028 | 883 | "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0, uint dim1);\n" |
5029 | 883 | "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0, uint dim1, uint dim2);\n" |
5030 | 883 | "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0, uint dim1, uint dim2, uint dim3);\n" |
5031 | 883 | "tensorLayoutNV setTensorLayoutDimensionNV(tensorLayoutNV t, uint dim0, uint dim1, uint dim2, uint dim3, uint dim4);\n" |
5032 | | |
5033 | 883 | "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0);\n" |
5034 | 883 | "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0, uint stride1);\n" |
5035 | 883 | "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0, uint stride1, uint stride2);\n" |
5036 | 883 | "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0, uint stride1, uint stride2, uint stride3);\n" |
5037 | 883 | "tensorLayoutNV setTensorLayoutStrideNV(tensorLayoutNV t, uint stride0, uint stride1, uint stride2, uint stride3, uint stride4);\n" |
5038 | | |
5039 | 883 | "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0);\n" |
5040 | 883 | "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0, uint offset1, uint span1);\n" |
5041 | 883 | "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0, uint offset1, uint span1, uint offset2, uint span2);\n" |
5042 | 883 | "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0, uint offset1, uint span1, uint offset2, uint span2, uint offset3, uint span3);\n" |
5043 | 883 | "tensorLayoutNV sliceTensorLayoutNV(tensorLayoutNV t, uint offset0, uint span0, uint offset1, uint span1, uint offset2, uint span2, uint offset3, uint span3, uint offset4, uint span4);\n" |
5044 | | |
5045 | 883 | "tensorLayoutNV setTensorLayoutClampValueNV(tensorLayoutNV t, uint value);\n" |
5046 | | |
5047 | 883 | "tensorViewNV createTensorViewNV(uint Dim);\n" |
5048 | 883 | "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions);\n" |
5049 | 883 | "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0);\n" |
5050 | 883 | "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0, uint p1);\n" |
5051 | 883 | "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0, uint p1, uint p2);\n" |
5052 | 883 | "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0, uint p1, uint p2, uint p3);\n" |
5053 | 883 | "tensorViewNV createTensorViewNV(uint Dim, bool HasDimensions, uint p0, uint p1, uint p2, uint p3, uint p4);\n" |
5054 | | |
5055 | 883 | "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0);\n" |
5056 | 883 | "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0, uint dim1);\n" |
5057 | 883 | "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0, uint dim1, uint dim2);\n" |
5058 | 883 | "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0, uint dim1, uint dim2, uint dim3);\n" |
5059 | 883 | "tensorViewNV setTensorViewDimensionsNV(tensorViewNV v, uint dim0, uint dim1, uint dim2, uint dim3, uint dim4);\n" |
5060 | | |
5061 | 883 | "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0);\n" |
5062 | 883 | "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0, uint stride1);\n" |
5063 | 883 | "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0, uint stride1, uint stride2);\n" |
5064 | 883 | "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0, uint stride1, uint stride2, uint stride3);\n" |
5065 | 883 | "tensorViewNV setTensorViewStrideNV(tensorViewNV v, uint stride0, uint stride1, uint stride2, uint stride3, uint stride4);\n" |
5066 | | |
5067 | 883 | "tensorViewNV setTensorViewClipNV(tensorViewNV v, uint clipRowOffset, uint clipRowSpan, uint clipColOffset, uint clipColSpan);\n" |
5068 | 883 | "\n" |
5069 | 883 | ); |
5070 | | |
5071 | | // GL_ARM_tensors builtins. |
5072 | 883 | static const char *tensorDataTypesARM[] = { |
5073 | 883 | "bool", |
5074 | 883 | "int8_t", "int16_t", "int32_t", "int64_t", |
5075 | 883 | "uint8_t", "uint16_t", "uint32_t", "uint64_t", |
5076 | 883 | "float16_t", "float32_t", "float64_t", |
5077 | 883 | }; |
5078 | 883 | std::ostringstream ostream; |
5079 | 10.5k | for (auto t : tensorDataTypesARM) { |
5080 | | // Scalar |
5081 | 10.5k | ostream << "void tensorReadARM(readonly tensorARM t, uint coords[], out " |
5082 | 10.5k | << t << " data, uint tensorOperands = 0U, ...);\n"; |
5083 | 10.5k | ostream << "void tensorWriteARM(writeonly tensorARM t, uint coords[], " |
5084 | 10.5k | << t << " data, uint tensorOperands = 0U, ...);\n"; |
5085 | | // Array |
5086 | 10.5k | ostream << "void tensorReadARM(readonly tensorARM t, uint coords[], " |
5087 | 10.5k | << t << " data[], uint tensorOperands = 0U, ...);\n"; |
5088 | 10.5k | ostream << "void tensorWriteARM(writeonly tensorARM t, uint coords[], " |
5089 | 10.5k | << t << " data[], uint tensorOperands = 0U, ...);\n"; |
5090 | 10.5k | } |
5091 | 883 | ostream << "uint tensorSizeARM(readonly writeonly tensorARM t, uint dim);\n"; |
5092 | 883 | commonBuiltins.append(ostream.str()); |
5093 | 883 | } |
5094 | | |
5095 | 4.34k | if (profile != EEsProfile && version >= 450) { |
5096 | 883 | const char *basicTypes[] = { |
5097 | 883 | "int8_t", |
5098 | 883 | "int16_t", |
5099 | 883 | "int32_t", |
5100 | 883 | "int64_t", |
5101 | 883 | "uint8_t", |
5102 | 883 | "uint16_t", |
5103 | 883 | "uint32_t", |
5104 | 883 | "uint64_t", |
5105 | 883 | "float16_t", |
5106 | 883 | "float32_t", |
5107 | 883 | "float64_t", |
5108 | 883 | }; |
5109 | 883 | std::string coopVecOffsetTypes[] = { |
5110 | 883 | "uint", |
5111 | 883 | "uint64_t", |
5112 | 883 | }; |
5113 | 1.76k | for (auto offsetTy : coopVecOffsetTypes) { |
5114 | 21.1k | for (uint32_t i = 0; i < sizeof(basicTypes)/sizeof(basicTypes[0]); ++i) { |
5115 | 19.4k | std::string func = std::string("void coopVecMatMulNV(out coopvecNV result, ") + |
5116 | 19.4k | std::string("coopvecNV v, ") + |
5117 | 19.4k | std::string("int inputInterpretation, ") + |
5118 | 19.4k | std::string(basicTypes[i]) + std::string("[] matrix, ") + |
5119 | 19.4k | offsetTy + std::string(" matrixOffset, ") + |
5120 | 19.4k | std::string("int matrixInterpretation, ") + |
5121 | 19.4k | std::string("uint M, ") + |
5122 | 19.4k | std::string("uint K, ") + |
5123 | 19.4k | std::string("int matrixLayout, ") + |
5124 | 19.4k | std::string("bool transpose, ") + |
5125 | 19.4k | std::string("uint matrixStride);\n"); |
5126 | 19.4k | commonBuiltins.append(func.c_str()); |
5127 | | |
5128 | 233k | for (uint32_t j = 0; j < sizeof(basicTypes)/sizeof(basicTypes[0]); ++j) { |
5129 | 213k | func = std::string("void coopVecMatMulAddNV(out coopvecNV result, ") + |
5130 | 213k | std::string("coopvecNV v, ") + |
5131 | 213k | std::string("int inputInterpretation, ") + |
5132 | 213k | std::string(basicTypes[i]) + std::string("[] matrix, ") + |
5133 | 213k | offsetTy + std::string(" matrixOffset, ") + |
5134 | 213k | std::string("int matrixInterpretation, ") + |
5135 | 213k | std::string(basicTypes[j]) + std::string("[] bias, ") + |
5136 | 213k | offsetTy + std::string(" biasOffset, ") + |
5137 | 213k | std::string("int biasInterpretation, ") + |
5138 | 213k | std::string("uint M, ") + |
5139 | 213k | std::string("uint K, ") + |
5140 | 213k | std::string("int matrixLayout, ") + |
5141 | 213k | std::string("bool transpose, ") + |
5142 | 213k | std::string("uint matrixStride);\n"); |
5143 | 213k | commonBuiltins.append(func.c_str()); |
5144 | 213k | } |
5145 | | |
5146 | 19.4k | func = std::string("void coopVecOuterProductAccumulateNV(coopvecNV v1, coopvecNV v2, ") + |
5147 | 19.4k | std::string(basicTypes[i]) + |
5148 | 19.4k | std::string("[] buf, ") + offsetTy + std::string(" offset, uint stride, int matrixLayout, int matrixInterpretation);\n"); |
5149 | 19.4k | commonBuiltins.append(func.c_str()); |
5150 | | |
5151 | 19.4k | func = std::string("void coopVecReduceSumAccumulateNV(coopvecNV v, ") + |
5152 | 19.4k | std::string(basicTypes[i]) + |
5153 | 19.4k | std::string("[] buf, ") + offsetTy + std::string(" offset);\n"); |
5154 | 19.4k | commonBuiltins.append(func.c_str()); |
5155 | 19.4k | } |
5156 | 1.76k | } |
5157 | 883 | std::string cooperativeVectorFuncs = |
5158 | 883 | "coopvecNV fma(coopvecNV, coopvecNV, coopvecNV);\n" |
5159 | 883 | "coopvecNV min(coopvecNV, coopvecNV);\n" |
5160 | 883 | "coopvecNV max(coopvecNV, coopvecNV);\n" |
5161 | 883 | "coopvecNV step(coopvecNV, coopvecNV);\n" |
5162 | 883 | "coopvecNV exp(coopvecNV);\n" |
5163 | 883 | "coopvecNV log(coopvecNV);\n" |
5164 | 883 | "coopvecNV tanh(coopvecNV);\n" |
5165 | 883 | "coopvecNV atan(coopvecNV);\n" |
5166 | 883 | "coopvecNV clamp(coopvecNV, coopvecNV, coopvecNV);\n"; |
5167 | | |
5168 | 883 | commonBuiltins.append(cooperativeVectorFuncs.c_str()); |
5169 | | |
5170 | 883 | if (profile != EEsProfile) { |
5171 | 883 | std::string longVectorFuncs = |
5172 | | |
5173 | | // manually add long vector prototypes for functions not in BaseFunctions/etc |
5174 | 883 | "vector frexp(vector, vector);\n" |
5175 | 883 | "vector ldexp(vector, vector);\n" |
5176 | 883 | "vector fma(vector, vector, vector);\n" |
5177 | | |
5178 | 883 | "vector floatBitsToInt(vector);\n" |
5179 | 883 | "vector floatBitsToUint(vector);\n" |
5180 | 883 | "vector intBitsToFloat(vector);\n" |
5181 | 883 | "vector uintBitsToFloat(vector);\n" |
5182 | 883 | "vector doubleBitsToInt64(vector);" |
5183 | 883 | "vector doubleBitsToUint64(vector);" |
5184 | 883 | "vector int64BitsToDouble(vector);" |
5185 | 883 | "vector uint64BitsToDouble(vector);" |
5186 | 883 | "vector bfloat16BitsToIntEXT(vector);" |
5187 | 883 | "vector bfloat16BitsToUintEXT(vector);" |
5188 | 883 | "vector intBitsToBFloat16EXT(vector);" |
5189 | 883 | "vector uintBitsToBFloat16EXT(vector);" |
5190 | 883 | "vector halfBitsToInt16(vector);" |
5191 | 883 | "vector halfBitsToUint16(vector);" |
5192 | 883 | "vector float16BitsToInt16(vector);" |
5193 | 883 | "vector float16BitsToUint16(vector);" |
5194 | 883 | "vector int16BitsToFloat16(vector);" |
5195 | 883 | "vector uint16BitsToFloat16(vector);" |
5196 | 883 | "vector int16BitsToHalf(vector);" |
5197 | 883 | "vector uint16BitsToHalf(vector);" |
5198 | 883 | "vector floate5m2BitsToIntEXT(vector);" |
5199 | 883 | "vector floate5m2BitsToUintEXT(vector);" |
5200 | 883 | "vector intBitsToFloate5m2EXT(vector);" |
5201 | 883 | "vector uintBitsToFloate5m2EXT(vector);" |
5202 | 883 | "vector floate4m3BitsToIntEXT(vector);" |
5203 | 883 | "vector floate4m3BitsToUintEXT(vector);" |
5204 | 883 | "vector intBitsToFloate4m3EXT(vector);" |
5205 | 883 | "vector uintBitsToFloate4m3EXT(vector);" |
5206 | | |
5207 | 883 | "vector uaddCarry(highp vector, highp vector, out lowp vector carry);" |
5208 | 883 | "vector usubBorrow(highp vector, highp vector, out lowp vector borrow);" |
5209 | 883 | "void umulExtended(highp vector, highp vector, out highp vector, out highp vector);" |
5210 | 883 | "void imulExtended(highp vector, highp vector, out highp vector, out highp vector);" |
5211 | 883 | "vector bitfieldExtract(vector, int, int);" |
5212 | 883 | "vector bitfieldInsert(vector, vector, int, int);" |
5213 | 883 | "vector bitfieldReverse(highp vector);" |
5214 | 883 | "vector bitCount(vector);" |
5215 | 883 | "vector findLSB(vector);" |
5216 | 883 | "vector findMSB(vector);" |
5217 | | |
5218 | | // BaseFunctions overloads with a scalar parameter don't get generated in AddLongVectorBuiltin |
5219 | 883 | "vector mod(vector, double);\n" |
5220 | 883 | "vector min(vector, double);\n" |
5221 | 883 | "vector max(vector, double);\n" |
5222 | 883 | "vector clamp(vector, double, double);" |
5223 | 883 | "vector mix(vector, vector, double);" |
5224 | 883 | "vector step(double, vector);" |
5225 | 883 | "vector smoothstep(double, double, vector);" |
5226 | 883 | "vector refract(vector, vector, double);" |
5227 | | |
5228 | 883 | "vector mod(vector, float16_t);\n" |
5229 | 883 | "vector min(vector, float16_t);\n" |
5230 | 883 | "vector max(vector, float16_t);\n" |
5231 | 883 | "vector clamp(vector, float16_t, float16_t);" |
5232 | 883 | "vector mix(vector, vector, float16_t);" |
5233 | 883 | "vector step(float16_t, vector);" |
5234 | 883 | "vector smoothstep(float16_t, float16_t, vector);" |
5235 | 883 | "vector refract(vector, vector, float16_t);" |
5236 | | |
5237 | 883 | "vector min(vector, uint64_t);\n" |
5238 | 883 | "vector max(vector, uint64_t);\n" |
5239 | 883 | "vector clamp(vector, uint64_t, uint64_t);" |
5240 | 883 | "vector mix(vector, vector, uint64_t);" |
5241 | | |
5242 | 883 | "vector min(vector, int64_t);\n" |
5243 | 883 | "vector max(vector, int64_t);\n" |
5244 | 883 | "vector clamp(vector, int64_t, int64_t);" |
5245 | 883 | "vector mix(vector, vector, int64_t);" |
5246 | | |
5247 | 883 | "vector min(vector, uint16_t);\n" |
5248 | 883 | "vector max(vector, uint16_t);\n" |
5249 | 883 | "vector clamp(vector, uint16_t, uint16_t);" |
5250 | 883 | "vector mix(vector, vector, uint16_t);" |
5251 | | |
5252 | 883 | "vector min(vector, int16_t);\n" |
5253 | 883 | "vector max(vector, int16_t);\n" |
5254 | 883 | "vector clamp(vector, int16_t, int16_t);" |
5255 | 883 | "vector mix(vector, vector, int16_t);" |
5256 | | |
5257 | 883 | "vector min(vector, uint8_t);\n" |
5258 | 883 | "vector max(vector, uint8_t);\n" |
5259 | 883 | "vector clamp(vector, uint8_t, uint8_t);" |
5260 | 883 | "vector mix(vector, vector, uint8_t);" |
5261 | | |
5262 | 883 | "vector min(vector, int8_t);\n" |
5263 | 883 | "vector max(vector, int8_t);\n" |
5264 | 883 | "vector clamp(vector, int8_t, int8_t);" |
5265 | 883 | "vector mix(vector, vector, int8_t);" |
5266 | | |
5267 | 883 | "vector expectEXT(vector, vector);" |
5268 | 883 | ; |
5269 | | |
5270 | 883 | std::string longVectorDerivativeFuncs = |
5271 | 883 | "vector dFdxFine(vector);" |
5272 | 883 | "vector dFdyFine(vector);" |
5273 | 883 | "vector fwidthFine(vector);" |
5274 | 883 | "vector dFdxCoarse(vector);" |
5275 | 883 | "vector dFdyCoarse(vector);" |
5276 | 883 | "vector fwidthCoarse(vector);" |
5277 | | |
5278 | 883 | ; |
5279 | 883 | commonBuiltins.append(longVectorFuncs.c_str()); |
5280 | 883 | stageBuiltins[EShLangFragment].append(longVectorDerivativeFuncs.c_str()); |
5281 | 883 | stageBuiltins[EShLangCompute].append(longVectorDerivativeFuncs.c_str()); |
5282 | 883 | } |
5283 | | |
5284 | 883 | const char *scalarAndVectorTypes[] = { |
5285 | 883 | "int8_t", |
5286 | 883 | "int16_t", |
5287 | 883 | "int32_t", |
5288 | 883 | "int64_t", |
5289 | 883 | "uint8_t", |
5290 | 883 | "uint16_t", |
5291 | 883 | "uint32_t", |
5292 | 883 | "uint64_t", |
5293 | 883 | "float16_t", |
5294 | 883 | "float32_t", |
5295 | 883 | "float64_t", |
5296 | 883 | "i8vec2", |
5297 | 883 | "i16vec2", |
5298 | 883 | "i32vec2", |
5299 | 883 | "i64vec2", |
5300 | 883 | "u8vec2", |
5301 | 883 | "u16vec2", |
5302 | 883 | "u32vec2", |
5303 | 883 | "u64vec2", |
5304 | 883 | "f16vec2", |
5305 | 883 | "f32vec2", |
5306 | 883 | "f64vec2", |
5307 | 883 | "i8vec3", |
5308 | 883 | "i16vec3", |
5309 | 883 | "i32vec3", |
5310 | 883 | "i64vec3", |
5311 | 883 | "u8vec3", |
5312 | 883 | "u16vec3", |
5313 | 883 | "u32vec3", |
5314 | 883 | "u64vec3", |
5315 | 883 | "f16vec3", |
5316 | 883 | "f32vec3", |
5317 | 883 | "f64vec3", |
5318 | 883 | "i8vec4", |
5319 | 883 | "i16vec4", |
5320 | 883 | "i32vec4", |
5321 | 883 | "i64vec4", |
5322 | 883 | "u8vec4", |
5323 | 883 | "u16vec4", |
5324 | 883 | "u32vec4", |
5325 | 883 | "u64vec4", |
5326 | 883 | "f16vec4", |
5327 | 883 | "f32vec4", |
5328 | 883 | "f64vec4", |
5329 | 883 | }; |
5330 | | |
5331 | 1.76k | for (auto offsetTy : coopVecOffsetTypes) { |
5332 | 79.4k | for (uint32_t i = 0; i < sizeof(scalarAndVectorTypes)/sizeof(scalarAndVectorTypes[0]); ++i) { |
5333 | 77.7k | std::string load = std::string("void coopVecLoadNV(out coopvecNV v, volatile coherent ") + |
5334 | 77.7k | std::string(scalarAndVectorTypes[i]) + std::string("[] buf, ") + offsetTy + std::string(" offset);"); |
5335 | 77.7k | std::string store = std::string("void coopVecStoreNV(coopvecNV v, volatile coherent ") + |
5336 | 77.7k | std::string(scalarAndVectorTypes[i]) + std::string("[] buf, ") + offsetTy + std::string(" offset);"); |
5337 | 77.7k | commonBuiltins.append(load.c_str()); |
5338 | 77.7k | commonBuiltins.append(store.c_str()); |
5339 | 77.7k | } |
5340 | 1.76k | } |
5341 | | |
5342 | 883 | commonBuiltins.append( |
5343 | 883 | "const int gl_CooperativeVectorMatrixLayoutRowMajorNV = 0;\n" |
5344 | 883 | "const int gl_CooperativeVectorMatrixLayoutColumnMajorNV = 1;\n" |
5345 | 883 | "const int gl_CooperativeVectorMatrixLayoutInferencingOptimalNV = 2;\n" |
5346 | 883 | "const int gl_CooperativeVectorMatrixLayoutTrainingOptimalNV = 3;\n" |
5347 | 883 | "\n" |
5348 | 883 | ); |
5349 | | |
5350 | 883 | commonBuiltins.append( |
5351 | 883 | "const int gl_ComponentTypeFloat16NV = 0;\n" |
5352 | 883 | "const int gl_ComponentTypeFloat32NV = 1;\n" |
5353 | 883 | "const int gl_ComponentTypeFloat64NV = 2;\n" |
5354 | 883 | "const int gl_ComponentTypeSignedInt8NV = 3;\n" |
5355 | 883 | "const int gl_ComponentTypeSignedInt16NV = 4;\n" |
5356 | 883 | "const int gl_ComponentTypeSignedInt32NV = 5;\n" |
5357 | 883 | "const int gl_ComponentTypeSignedInt64NV = 6;\n" |
5358 | 883 | "const int gl_ComponentTypeUnsignedInt8NV = 7;\n" |
5359 | 883 | "const int gl_ComponentTypeUnsignedInt16NV = 8;\n" |
5360 | 883 | "const int gl_ComponentTypeUnsignedInt32NV = 9;\n" |
5361 | 883 | "const int gl_ComponentTypeUnsignedInt64NV = 10;\n" |
5362 | 883 | "const int gl_ComponentTypeSignedInt8PackedNV = 1000491000;\n" |
5363 | 883 | "const int gl_ComponentTypeUnsignedInt8PackedNV = 1000491001;\n" |
5364 | 883 | "const int gl_ComponentTypeFloatE4M3NV = 1000491002;\n" |
5365 | 883 | "const int gl_ComponentTypeFloatE5M2NV = 1000491003;\n" |
5366 | 883 | "\n" |
5367 | 883 | ); |
5368 | 883 | } |
5369 | | |
5370 | | //============================================================================ |
5371 | | // |
5372 | | // Prototypes for built-in functions seen by fragment shaders only. |
5373 | | // |
5374 | | //============================================================================ |
5375 | | |
5376 | | // |
5377 | | // Original-style texture Functions with bias. |
5378 | | // |
5379 | 4.34k | if (spvVersion.spv == 0 && (profile != EEsProfile || version == 100)) { |
5380 | 0 | stageBuiltins[EShLangFragment].append( |
5381 | 0 | "vec4 texture2D(sampler2D, vec2, float);" |
5382 | 0 | "vec4 texture2DProj(sampler2D, vec3, float);" |
5383 | 0 | "vec4 texture2DProj(sampler2D, vec4, float);" |
5384 | 0 | "vec4 texture3D(sampler3D, vec3, float);" // OES_texture_3D |
5385 | 0 | "vec4 texture3DProj(sampler3D, vec4, float);" // OES_texture_3D |
5386 | 0 | "vec4 textureCube(samplerCube, vec3, float);" |
5387 | |
|
5388 | 0 | "\n"); |
5389 | 0 | } |
5390 | 4.34k | if (spvVersion.spv == 0 && (profile != EEsProfile && version > 100)) { |
5391 | 0 | stageBuiltins[EShLangFragment].append( |
5392 | 0 | "vec4 texture1D(sampler1D, float, float);" |
5393 | 0 | "vec4 texture1DProj(sampler1D, vec2, float);" |
5394 | 0 | "vec4 texture1DProj(sampler1D, vec4, float);" |
5395 | 0 | "vec4 shadow1D(sampler1DShadow, vec3, float);" |
5396 | 0 | "vec4 shadow2D(sampler2DShadow, vec3, float);" |
5397 | 0 | "vec4 shadow1DProj(sampler1DShadow, vec4, float);" |
5398 | 0 | "vec4 shadow2DProj(sampler2DShadow, vec4, float);" |
5399 | |
|
5400 | 0 | "\n"); |
5401 | 0 | } |
5402 | 4.34k | if (spvVersion.spv == 0 && profile == EEsProfile) { |
5403 | 0 | stageBuiltins[EShLangFragment].append( |
5404 | 0 | "vec4 texture2DLodEXT(sampler2D, vec2, float);" // GL_EXT_shader_texture_lod |
5405 | 0 | "vec4 texture2DProjLodEXT(sampler2D, vec3, float);" // GL_EXT_shader_texture_lod |
5406 | 0 | "vec4 texture2DProjLodEXT(sampler2D, vec4, float);" // GL_EXT_shader_texture_lod |
5407 | 0 | "vec4 textureCubeLodEXT(samplerCube, vec3, float);" // GL_EXT_shader_texture_lod |
5408 | |
|
5409 | 0 | "\n"); |
5410 | 0 | } |
5411 | | |
5412 | | // GL_EXT_shader_tile_image |
5413 | 4.34k | if (spvVersion.vulkan > 0) { |
5414 | 4.34k | stageBuiltins[EShLangFragment].append( |
5415 | 4.34k | "lowp uint stencilAttachmentReadEXT();" |
5416 | 4.34k | "lowp uint stencilAttachmentReadEXT(int);" |
5417 | 4.34k | "highp float depthAttachmentReadEXT();" |
5418 | 4.34k | "highp float depthAttachmentReadEXT(int);" |
5419 | 4.34k | "\n"); |
5420 | 4.34k | stageBuiltins[EShLangFragment].append( |
5421 | 4.34k | "vec4 colorAttachmentReadEXT(attachmentEXT);" |
5422 | 4.34k | "vec4 colorAttachmentReadEXT(attachmentEXT, int);" |
5423 | 4.34k | "ivec4 colorAttachmentReadEXT(iattachmentEXT);" |
5424 | 4.34k | "ivec4 colorAttachmentReadEXT(iattachmentEXT, int);" |
5425 | 4.34k | "uvec4 colorAttachmentReadEXT(uattachmentEXT);" |
5426 | 4.34k | "uvec4 colorAttachmentReadEXT(uattachmentEXT, int);" |
5427 | 4.34k | "\n"); |
5428 | 4.34k | } |
5429 | | |
5430 | | // GL_ARB_derivative_control |
5431 | 4.34k | if (profile != EEsProfile && version >= 400) { |
5432 | 1.43k | stageBuiltins[EShLangFragment].append(derivativeControls); |
5433 | 1.43k | stageBuiltins[EShLangFragment].append("\n"); |
5434 | 1.43k | } |
5435 | | |
5436 | | // GL_OES_shader_multisample_interpolation |
5437 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
5438 | 4.08k | (profile != EEsProfile && version >= 150)) { // NV_gpu_shader5 |
5439 | 2.02k | stageBuiltins[EShLangFragment].append( |
5440 | 2.02k | "float interpolateAtCentroid(float);" |
5441 | 2.02k | "vec2 interpolateAtCentroid(vec2);" |
5442 | 2.02k | "vec3 interpolateAtCentroid(vec3);" |
5443 | 2.02k | "vec4 interpolateAtCentroid(vec4);" |
5444 | | |
5445 | 2.02k | "float interpolateAtSample(float, int);" |
5446 | 2.02k | "vec2 interpolateAtSample(vec2, int);" |
5447 | 2.02k | "vec3 interpolateAtSample(vec3, int);" |
5448 | 2.02k | "vec4 interpolateAtSample(vec4, int);" |
5449 | | |
5450 | 2.02k | "float interpolateAtOffset(float, vec2);" |
5451 | 2.02k | "vec2 interpolateAtOffset(vec2, vec2);" |
5452 | 2.02k | "vec3 interpolateAtOffset(vec3, vec2);" |
5453 | 2.02k | "vec4 interpolateAtOffset(vec4, vec2);" |
5454 | | |
5455 | 2.02k | "\n"); |
5456 | 2.02k | } |
5457 | | |
5458 | 4.34k | stageBuiltins[EShLangFragment].append( |
5459 | 4.34k | "void beginInvocationInterlockARB(void);" |
5460 | 4.34k | "void endInvocationInterlockARB(void);"); |
5461 | | |
5462 | 4.34k | stageBuiltins[EShLangFragment].append( |
5463 | 4.34k | "bool helperInvocationEXT();" |
5464 | 4.34k | "\n"); |
5465 | | |
5466 | | // GL_AMD_shader_explicit_vertex_parameter |
5467 | 4.34k | if (profile != EEsProfile && version >= 450) { |
5468 | 883 | stageBuiltins[EShLangFragment].append( |
5469 | 883 | "float interpolateAtVertexAMD(float, uint);" |
5470 | 883 | "vec2 interpolateAtVertexAMD(vec2, uint);" |
5471 | 883 | "vec3 interpolateAtVertexAMD(vec3, uint);" |
5472 | 883 | "vec4 interpolateAtVertexAMD(vec4, uint);" |
5473 | | |
5474 | 883 | "int interpolateAtVertexAMD(int, uint);" |
5475 | 883 | "ivec2 interpolateAtVertexAMD(ivec2, uint);" |
5476 | 883 | "ivec3 interpolateAtVertexAMD(ivec3, uint);" |
5477 | 883 | "ivec4 interpolateAtVertexAMD(ivec4, uint);" |
5478 | | |
5479 | 883 | "uint interpolateAtVertexAMD(uint, uint);" |
5480 | 883 | "uvec2 interpolateAtVertexAMD(uvec2, uint);" |
5481 | 883 | "uvec3 interpolateAtVertexAMD(uvec3, uint);" |
5482 | 883 | "uvec4 interpolateAtVertexAMD(uvec4, uint);" |
5483 | | |
5484 | 883 | "float16_t interpolateAtVertexAMD(float16_t, uint);" |
5485 | 883 | "f16vec2 interpolateAtVertexAMD(f16vec2, uint);" |
5486 | 883 | "f16vec3 interpolateAtVertexAMD(f16vec3, uint);" |
5487 | 883 | "f16vec4 interpolateAtVertexAMD(f16vec4, uint);" |
5488 | | |
5489 | 883 | "\n"); |
5490 | 883 | } |
5491 | | |
5492 | | // GL_AMD_gpu_shader_half_float |
5493 | 4.34k | if (profile != EEsProfile && version >= 450) { |
5494 | 883 | stageBuiltins[EShLangFragment].append(derivativesAndControl16bits); |
5495 | 883 | stageBuiltins[EShLangFragment].append("\n"); |
5496 | | |
5497 | 883 | stageBuiltins[EShLangFragment].append( |
5498 | 883 | "float16_t interpolateAtCentroid(float16_t);" |
5499 | 883 | "f16vec2 interpolateAtCentroid(f16vec2);" |
5500 | 883 | "f16vec3 interpolateAtCentroid(f16vec3);" |
5501 | 883 | "f16vec4 interpolateAtCentroid(f16vec4);" |
5502 | | |
5503 | 883 | "float16_t interpolateAtSample(float16_t, int);" |
5504 | 883 | "f16vec2 interpolateAtSample(f16vec2, int);" |
5505 | 883 | "f16vec3 interpolateAtSample(f16vec3, int);" |
5506 | 883 | "f16vec4 interpolateAtSample(f16vec4, int);" |
5507 | | |
5508 | 883 | "float16_t interpolateAtOffset(float16_t, f16vec2);" |
5509 | 883 | "f16vec2 interpolateAtOffset(f16vec2, f16vec2);" |
5510 | 883 | "f16vec3 interpolateAtOffset(f16vec3, f16vec2);" |
5511 | 883 | "f16vec4 interpolateAtOffset(f16vec4, f16vec2);" |
5512 | | |
5513 | 883 | "\n"); |
5514 | 883 | } |
5515 | | |
5516 | | // GL_ARB_shader_clock& GL_EXT_shader_realtime_clock |
5517 | 4.34k | if (profile != EEsProfile && version >= 450) { |
5518 | 883 | commonBuiltins.append( |
5519 | 883 | "uvec2 clock2x32ARB();" |
5520 | 883 | "uint64_t clockARB();" |
5521 | 883 | "uvec2 clockRealtime2x32EXT();" |
5522 | 883 | "uint64_t clockRealtimeEXT();" |
5523 | 883 | "\n"); |
5524 | 883 | } |
5525 | | |
5526 | | // GL_AMD_shader_fragment_mask |
5527 | 4.34k | if (profile != EEsProfile && version >= 450 && spvVersion.vulkan > 0) { |
5528 | 883 | stageBuiltins[EShLangFragment].append( |
5529 | 883 | "uint fragmentMaskFetchAMD(subpassInputMS);" |
5530 | 883 | "uint fragmentMaskFetchAMD(isubpassInputMS);" |
5531 | 883 | "uint fragmentMaskFetchAMD(usubpassInputMS);" |
5532 | | |
5533 | 883 | "vec4 fragmentFetchAMD(subpassInputMS, uint);" |
5534 | 883 | "ivec4 fragmentFetchAMD(isubpassInputMS, uint);" |
5535 | 883 | "uvec4 fragmentFetchAMD(usubpassInputMS, uint);" |
5536 | | |
5537 | 883 | "\n"); |
5538 | 883 | } |
5539 | | |
5540 | | // Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query/ |
5541 | | // GL_NV_shader_invocation_reorder/GL_KHR_ray_tracing_position_Fetch |
5542 | 4.34k | if (profile != EEsProfile && version >= 460) { |
5543 | 108 | commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);" |
5544 | 108 | "void rayQueryTerminateEXT(rayQueryEXT);" |
5545 | 108 | "void rayQueryGenerateIntersectionEXT(rayQueryEXT, float);" |
5546 | 108 | "void rayQueryConfirmIntersectionEXT(rayQueryEXT);" |
5547 | 108 | "bool rayQueryProceedEXT(rayQueryEXT);" |
5548 | 108 | "uint rayQueryGetIntersectionTypeEXT(rayQueryEXT, bool);" |
5549 | 108 | "float rayQueryGetRayTMinEXT(rayQueryEXT);" |
5550 | 108 | "uint rayQueryGetRayFlagsEXT(rayQueryEXT);" |
5551 | 108 | "vec3 rayQueryGetWorldRayOriginEXT(rayQueryEXT);" |
5552 | 108 | "vec3 rayQueryGetWorldRayDirectionEXT(rayQueryEXT);" |
5553 | 108 | "float rayQueryGetIntersectionTEXT(rayQueryEXT, bool);" |
5554 | 108 | "int rayQueryGetIntersectionInstanceCustomIndexEXT(rayQueryEXT, bool);" |
5555 | 108 | "int rayQueryGetIntersectionInstanceIdEXT(rayQueryEXT, bool);" |
5556 | 108 | "uint rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT(rayQueryEXT, bool);" |
5557 | 108 | "int rayQueryGetIntersectionGeometryIndexEXT(rayQueryEXT, bool);" |
5558 | 108 | "int rayQueryGetIntersectionPrimitiveIndexEXT(rayQueryEXT, bool);" |
5559 | 108 | "vec2 rayQueryGetIntersectionBarycentricsEXT(rayQueryEXT, bool);" |
5560 | 108 | "bool rayQueryGetIntersectionFrontFaceEXT(rayQueryEXT, bool);" |
5561 | 108 | "bool rayQueryGetIntersectionCandidateAABBOpaqueEXT(rayQueryEXT);" |
5562 | 108 | "vec3 rayQueryGetIntersectionObjectRayDirectionEXT(rayQueryEXT, bool);" |
5563 | 108 | "vec3 rayQueryGetIntersectionObjectRayOriginEXT(rayQueryEXT, bool);" |
5564 | 108 | "mat4x3 rayQueryGetIntersectionObjectToWorldEXT(rayQueryEXT, bool);" |
5565 | 108 | "mat4x3 rayQueryGetIntersectionWorldToObjectEXT(rayQueryEXT, bool);" |
5566 | 108 | "void rayQueryGetIntersectionTriangleVertexPositionsEXT(rayQueryEXT, bool, out vec3[3]);" |
5567 | 108 | "int rayQueryGetIntersectionClusterIdNV(rayQueryEXT, bool);" |
5568 | 108 | "vec3 rayQueryGetIntersectionSpherePositionNV(rayQueryEXT, bool);" |
5569 | 108 | "float rayQueryGetIntersectionSphereRadiusNV(rayQueryEXT, bool);" |
5570 | 108 | "float rayQueryGetIntersectionLSSHitValueNV(rayQueryEXT, bool);" |
5571 | 108 | "void rayQueryGetIntersectionLSSPositionsNV(rayQueryEXT, bool, out vec3[2]);" |
5572 | 108 | "void rayQueryGetIntersectionLSSRadiiNV(rayQueryEXT, bool, out float[2]);" |
5573 | 108 | "bool rayQueryIsSphereHitNV(rayQueryEXT, bool);" |
5574 | 108 | "bool rayQueryIsLSSHitNV(rayQueryEXT, bool);" |
5575 | 108 | "\n"); |
5576 | | |
5577 | 108 | stageBuiltins[EShLangRayGen].append( |
5578 | 108 | "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5579 | 108 | "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5580 | 108 | "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5581 | 108 | "void executeCallableNV(uint, int);" |
5582 | 108 | "void executeCallableEXT(uint, int);" |
5583 | 108 | "void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5584 | 108 | "void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5585 | 108 | "void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);" |
5586 | 108 | "void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5587 | 108 | "void hitObjectRecordHitWithIndexNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);" |
5588 | 108 | "void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);" |
5589 | 108 | "void hitObjectRecordMissNV(hitObjectNV,uint,vec3,float,vec3,float);" |
5590 | 108 | "void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);" |
5591 | 108 | "void hitObjectRecordEmptyNV(hitObjectNV);" |
5592 | 108 | "void hitObjectExecuteShaderNV(hitObjectNV,int);" |
5593 | 108 | "bool hitObjectIsEmptyNV(hitObjectNV);" |
5594 | 108 | "bool hitObjectIsMissNV(hitObjectNV);" |
5595 | 108 | "bool hitObjectIsHitNV(hitObjectNV);" |
5596 | 108 | "float hitObjectGetRayTMinNV(hitObjectNV);" |
5597 | 108 | "float hitObjectGetRayTMaxNV(hitObjectNV);" |
5598 | 108 | "vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);" |
5599 | 108 | "vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);" |
5600 | 108 | "vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);" |
5601 | 108 | "vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);" |
5602 | 108 | "mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);" |
5603 | 108 | "mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);" |
5604 | 108 | "int hitObjectGetInstanceCustomIndexNV(hitObjectNV);" |
5605 | 108 | "int hitObjectGetInstanceIdNV(hitObjectNV);" |
5606 | 108 | "int hitObjectGetGeometryIndexNV(hitObjectNV);" |
5607 | 108 | "int hitObjectGetPrimitiveIndexNV(hitObjectNV);" |
5608 | 108 | "uint hitObjectGetHitKindNV(hitObjectNV);" |
5609 | 108 | "void hitObjectGetAttributesNV(hitObjectNV,int);" |
5610 | 108 | "float hitObjectGetCurrentTimeNV(hitObjectNV);" |
5611 | 108 | "uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);" |
5612 | 108 | "uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);" |
5613 | 108 | "int hitObjectGetClusterIdNV(hitObjectNV);" |
5614 | 108 | "void reorderThreadNV(uint, uint);" |
5615 | 108 | "void reorderThreadNV(hitObjectNV);" |
5616 | 108 | "void reorderThreadNV(hitObjectNV, uint, uint);" |
5617 | 108 | "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" |
5618 | 108 | "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" |
5619 | 108 | "vec3 hitObjectGetSpherePositionNV(hitObjectNV);" |
5620 | 108 | "float hitObjectGetSphereRadiusNV(hitObjectNV);" |
5621 | 108 | "void hitObjectGetLSSPositionsNV(hitObjectNV, out vec3[2]);" |
5622 | 108 | "void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);" |
5623 | 108 | "bool hitObjectIsSphereHitNV(hitObjectNV);" |
5624 | 108 | "bool hitObjectIsLSSHitNV(hitObjectNV);" |
5625 | 108 | "void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5626 | 108 | "void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5627 | 108 | "void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);" |
5628 | 108 | "void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);" |
5629 | 108 | "void hitObjectRecordEmptyEXT(hitObjectEXT);" |
5630 | 108 | "void hitObjectExecuteShaderEXT(hitObjectEXT,int);" |
5631 | 108 | "bool hitObjectIsEmptyEXT(hitObjectEXT);" |
5632 | 108 | "bool hitObjectIsMissEXT(hitObjectEXT);" |
5633 | 108 | "bool hitObjectIsHitEXT(hitObjectEXT);" |
5634 | 108 | "float hitObjectGetRayTMinEXT(hitObjectEXT);" |
5635 | 108 | "float hitObjectGetRayTMaxEXT(hitObjectEXT);" |
5636 | 108 | "uint hitObjectGetRayFlagsEXT(hitObjectEXT);" |
5637 | 108 | "vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);" |
5638 | 108 | "vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);" |
5639 | 108 | "vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);" |
5640 | 108 | "vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);" |
5641 | 108 | "mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);" |
5642 | 108 | "mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);" |
5643 | 108 | "int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);" |
5644 | 108 | "int hitObjectGetInstanceIdEXT(hitObjectEXT);" |
5645 | 108 | "int hitObjectGetGeometryIndexEXT(hitObjectEXT);" |
5646 | 108 | "int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);" |
5647 | 108 | "uint hitObjectGetHitKindEXT(hitObjectEXT);" |
5648 | 108 | "void hitObjectGetAttributesEXT(hitObjectEXT,int);" |
5649 | 108 | "float hitObjectGetCurrentTimeEXT(hitObjectEXT);" |
5650 | 108 | "uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);" |
5651 | 108 | "uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);" |
5652 | 108 | "void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);" |
5653 | 108 | "void hitObjectReorderExecuteEXT(hitObjectEXT,int);" |
5654 | 108 | "void hitObjectReorderExecuteEXT(hitObjectEXT,uint,uint,int);" |
5655 | 108 | "void hitObjectTraceReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5656 | 108 | "void hitObjectTraceReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,uint,uint,int);" |
5657 | 108 | "void hitObjectTraceMotionReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5658 | 108 | "void hitObjectTraceMotionReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,uint,uint,int);" |
5659 | 108 | "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int);" |
5660 | 108 | "void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);" |
5661 | 108 | "void reorderThreadEXT(uint, uint);" |
5662 | 108 | "void reorderThreadEXT(hitObjectEXT);" |
5663 | 108 | "void reorderThreadEXT(hitObjectEXT, uint, uint);" |
5664 | 108 | "\n"); |
5665 | 108 | stageBuiltins[EShLangIntersect].append( |
5666 | 108 | "bool reportIntersectionNV(float, uint);" |
5667 | 108 | "bool reportIntersectionEXT(float, uint);" |
5668 | 108 | "\n"); |
5669 | 108 | stageBuiltins[EShLangAnyHit].append( |
5670 | 108 | "void ignoreIntersectionNV();" |
5671 | 108 | "void terminateRayNV();" |
5672 | 108 | "\n"); |
5673 | 108 | stageBuiltins[EShLangClosestHit].append( |
5674 | 108 | "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5675 | 108 | "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5676 | 108 | "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5677 | 108 | "void executeCallableNV(uint, int);" |
5678 | 108 | "void executeCallableEXT(uint, int);" |
5679 | 108 | "void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5680 | 108 | "void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5681 | 108 | "void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);" |
5682 | 108 | "void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5683 | 108 | "void hitObjectRecordHitWithIndexNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);" |
5684 | 108 | "void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);" |
5685 | 108 | "void hitObjectRecordMissNV(hitObjectNV, uint, vec3, float, vec3, float);" |
5686 | 108 | "void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);" |
5687 | 108 | "void hitObjectRecordEmptyNV(hitObjectNV);" |
5688 | 108 | "void hitObjectExecuteShaderNV(hitObjectNV, int);" |
5689 | 108 | "bool hitObjectIsEmptyNV(hitObjectNV);" |
5690 | 108 | "bool hitObjectIsMissNV(hitObjectNV);" |
5691 | 108 | "bool hitObjectIsHitNV(hitObjectNV);" |
5692 | 108 | "float hitObjectGetRayTMinNV(hitObjectNV);" |
5693 | 108 | "float hitObjectGetRayTMaxNV(hitObjectNV);" |
5694 | 108 | "vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);" |
5695 | 108 | "vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);" |
5696 | 108 | "vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);" |
5697 | 108 | "vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);" |
5698 | 108 | "mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);" |
5699 | 108 | "mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);" |
5700 | 108 | "int hitObjectGetInstanceCustomIndexNV(hitObjectNV);" |
5701 | 108 | "int hitObjectGetInstanceIdNV(hitObjectNV);" |
5702 | 108 | "int hitObjectGetGeometryIndexNV(hitObjectNV);" |
5703 | 108 | "int hitObjectGetPrimitiveIndexNV(hitObjectNV);" |
5704 | 108 | "uint hitObjectGetHitKindNV(hitObjectNV);" |
5705 | 108 | "void hitObjectGetAttributesNV(hitObjectNV,int);" |
5706 | 108 | "float hitObjectGetCurrentTimeNV(hitObjectNV);" |
5707 | 108 | "uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);" |
5708 | 108 | "uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);" |
5709 | 108 | "int hitObjectGetClusterIdNV(hitObjectNV);" |
5710 | 108 | "vec3 hitObjectGetSpherePositionNV(hitObjectNV);" |
5711 | 108 | "float hitObjectGetSphereRadiusNV(hitObjectNV);" |
5712 | 108 | "void hitObjectGetLSSPositionsNV(hitObjectNV, out vec3[2]);" |
5713 | 108 | "void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);" |
5714 | 108 | "bool hitObjectIsSphereHitNV(hitObjectNV);" |
5715 | 108 | "bool hitObjectIsLSSHitNV(hitObjectNV);" |
5716 | 108 | "void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5717 | 108 | "void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5718 | 108 | "void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);" |
5719 | 108 | "void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);" |
5720 | 108 | "void hitObjectRecordEmptyEXT(hitObjectEXT);" |
5721 | 108 | "void hitObjectExecuteShaderEXT(hitObjectEXT,int);" |
5722 | 108 | "bool hitObjectIsEmptyEXT(hitObjectEXT);" |
5723 | 108 | "bool hitObjectIsMissEXT(hitObjectEXT);" |
5724 | 108 | "bool hitObjectIsHitEXT(hitObjectEXT);" |
5725 | 108 | "float hitObjectGetRayTMinEXT(hitObjectEXT);" |
5726 | 108 | "float hitObjectGetRayTMaxEXT(hitObjectEXT);" |
5727 | 108 | "uint hitObjectGetRayFlagsEXT(hitObjectEXT);" |
5728 | 108 | "vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);" |
5729 | 108 | "vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);" |
5730 | 108 | "vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);" |
5731 | 108 | "vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);" |
5732 | 108 | "mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);" |
5733 | 108 | "mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);" |
5734 | 108 | "int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);" |
5735 | 108 | "int hitObjectGetInstanceIdEXT(hitObjectEXT);" |
5736 | 108 | "int hitObjectGetGeometryIndexEXT(hitObjectEXT);" |
5737 | 108 | "int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);" |
5738 | 108 | "uint hitObjectGetHitKindEXT(hitObjectEXT);" |
5739 | 108 | "void hitObjectGetAttributesEXT(hitObjectEXT,int);" |
5740 | 108 | "float hitObjectGetCurrentTimeEXT(hitObjectEXT);" |
5741 | 108 | "uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);" |
5742 | 108 | "uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);" |
5743 | 108 | "void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);" |
5744 | 108 | "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT,uint, int);" |
5745 | 108 | "void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);" |
5746 | 108 | "\n"); |
5747 | 108 | stageBuiltins[EShLangMiss].append( |
5748 | 108 | "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5749 | 108 | "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5750 | 108 | "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5751 | 108 | "void executeCallableNV(uint, int);" |
5752 | 108 | "void executeCallableEXT(uint, int);" |
5753 | 108 | "void hitObjectTraceRayNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5754 | 108 | "void hitObjectTraceRayMotionNV(hitObjectNV,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5755 | 108 | "void hitObjectRecordHitNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,int);" |
5756 | 108 | "void hitObjectRecordHitMotionNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5757 | 108 | "void hitObjectRecordHitWithIndexNV(hitObjectNV,accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,int);" |
5758 | 108 | "void hitObjectRecordHitWithIndexMotionNV(hitObjectNV, accelerationStructureEXT,int,int,int,uint,uint,vec3,float,vec3,float,float,int);" |
5759 | 108 | "void hitObjectRecordMissNV(hitObjectNV, uint, vec3, float, vec3, float);" |
5760 | 108 | "void hitObjectRecordMissMotionNV(hitObjectNV,uint,vec3,float,vec3,float,float);" |
5761 | 108 | "void hitObjectRecordEmptyNV(hitObjectNV);" |
5762 | 108 | "void hitObjectExecuteShaderNV(hitObjectNV, int);" |
5763 | 108 | "bool hitObjectIsEmptyNV(hitObjectNV);" |
5764 | 108 | "bool hitObjectIsMissNV(hitObjectNV);" |
5765 | 108 | "bool hitObjectIsHitNV(hitObjectNV);" |
5766 | 108 | "float hitObjectGetRayTMinNV(hitObjectNV);" |
5767 | 108 | "float hitObjectGetRayTMaxNV(hitObjectNV);" |
5768 | 108 | "vec3 hitObjectGetWorldRayOriginNV(hitObjectNV);" |
5769 | 108 | "vec3 hitObjectGetWorldRayDirectionNV(hitObjectNV);" |
5770 | 108 | "vec3 hitObjectGetObjectRayOriginNV(hitObjectNV);" |
5771 | 108 | "vec3 hitObjectGetObjectRayDirectionNV(hitObjectNV);" |
5772 | 108 | "mat4x3 hitObjectGetWorldToObjectNV(hitObjectNV);" |
5773 | 108 | "mat4x3 hitObjectGetObjectToWorldNV(hitObjectNV);" |
5774 | 108 | "int hitObjectGetInstanceCustomIndexNV(hitObjectNV);" |
5775 | 108 | "int hitObjectGetInstanceIdNV(hitObjectNV);" |
5776 | 108 | "int hitObjectGetGeometryIndexNV(hitObjectNV);" |
5777 | 108 | "int hitObjectGetPrimitiveIndexNV(hitObjectNV);" |
5778 | 108 | "uint hitObjectGetHitKindNV(hitObjectNV);" |
5779 | 108 | "void hitObjectGetAttributesNV(hitObjectNV,int);" |
5780 | 108 | "float hitObjectGetCurrentTimeNV(hitObjectNV);" |
5781 | 108 | "uint hitObjectGetShaderBindingTableRecordIndexNV(hitObjectNV);" |
5782 | 108 | "uvec2 hitObjectGetShaderRecordBufferHandleNV(hitObjectNV);" |
5783 | 108 | "int hitObjectGetClusterIdNV(hitObjectNV);" |
5784 | 108 | "vec3 hitObjectGetSpherePositionNV(hitObjectNV);" |
5785 | 108 | "float hitObjectGetSphereRadiusNV(hitObjectNV);" |
5786 | 108 | "void hitObjectGetLSSPositionsNV(hitObjectNV, out vec3[2]);" |
5787 | 108 | "void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);" |
5788 | 108 | "bool hitObjectIsSphereHitNV(hitObjectNV);" |
5789 | 108 | "bool hitObjectIsLSSHitNV(hitObjectNV);" |
5790 | 108 | "void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" |
5791 | 108 | "void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" |
5792 | 108 | "void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);" |
5793 | 108 | "void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);" |
5794 | 108 | "void hitObjectRecordEmptyEXT(hitObjectEXT);" |
5795 | 108 | "void hitObjectExecuteShaderEXT(hitObjectEXT,int);" |
5796 | 108 | "bool hitObjectIsEmptyEXT(hitObjectEXT);" |
5797 | 108 | "bool hitObjectIsMissEXT(hitObjectEXT);" |
5798 | 108 | "bool hitObjectIsHitEXT(hitObjectEXT);" |
5799 | 108 | "float hitObjectGetRayTMinEXT(hitObjectEXT);" |
5800 | 108 | "float hitObjectGetRayTMaxEXT(hitObjectEXT);" |
5801 | 108 | "uint hitObjectGetRayFlagsEXT(hitObjectEXT);" |
5802 | 108 | "vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);" |
5803 | 108 | "vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);" |
5804 | 108 | "vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);" |
5805 | 108 | "vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);" |
5806 | 108 | "mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);" |
5807 | 108 | "mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);" |
5808 | 108 | "int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);" |
5809 | 108 | "int hitObjectGetInstanceIdEXT(hitObjectEXT);" |
5810 | 108 | "int hitObjectGetGeometryIndexEXT(hitObjectEXT);" |
5811 | 108 | "int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);" |
5812 | 108 | "uint hitObjectGetHitKindEXT(hitObjectEXT);" |
5813 | 108 | "void hitObjectGetAttributesEXT(hitObjectEXT,int);" |
5814 | 108 | "float hitObjectGetCurrentTimeEXT(hitObjectEXT);" |
5815 | 108 | "uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);" |
5816 | 108 | "uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);" |
5817 | 108 | "void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);" |
5818 | 108 | "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int);" |
5819 | 108 | "void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);" |
5820 | 108 | "\n"); |
5821 | 108 | stageBuiltins[EShLangCallable].append( |
5822 | 108 | "void executeCallableNV(uint, int);" |
5823 | 108 | "void executeCallableEXT(uint, int);" |
5824 | 108 | "\n"); |
5825 | 108 | } |
5826 | | |
5827 | | //E_SPV_NV_compute_shader_derivatives |
5828 | 4.34k | if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450)) { |
5829 | 927 | stageBuiltins[EShLangCompute].append(derivativeControls); |
5830 | 927 | stageBuiltins[EShLangCompute].append("\n"); |
5831 | 927 | } |
5832 | 4.34k | if (profile != EEsProfile && version >= 450) { |
5833 | 883 | stageBuiltins[EShLangCompute].append(derivativesAndControl16bits); |
5834 | 883 | stageBuiltins[EShLangCompute].append(derivativesAndControl64bits); |
5835 | 883 | stageBuiltins[EShLangCompute].append("\n"); |
5836 | 883 | } |
5837 | | |
5838 | | // Builtins for GL_NV_mesh_shader |
5839 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
5840 | 927 | stageBuiltins[EShLangMesh].append( |
5841 | 927 | "void writePackedPrimitiveIndices4x8NV(uint, uint);" |
5842 | 927 | "\n"); |
5843 | 927 | } |
5844 | | // Builtins for GL_EXT_mesh_shader |
5845 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
5846 | | // Builtins for GL_EXT_mesh_shader |
5847 | 927 | stageBuiltins[EShLangTask].append( |
5848 | 927 | "void EmitMeshTasksEXT(uint, uint, uint);" |
5849 | 927 | "\n"); |
5850 | | |
5851 | 927 | stageBuiltins[EShLangMesh].append( |
5852 | 927 | "void SetMeshOutputsEXT(uint, uint);" |
5853 | 927 | "\n"); |
5854 | 927 | } |
5855 | | // Builtins for GL_NV_displacement_micromap |
5856 | 4.34k | if ((profile != EEsProfile && version >= 460) || (profile == EEsProfile && version >= 320)) { |
5857 | 152 | stageBuiltins[EShLangMesh].append( |
5858 | 152 | "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" |
5859 | 152 | "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" |
5860 | 152 | "\n"); |
5861 | | |
5862 | 152 | stageBuiltins[EShLangCompute].append( |
5863 | 152 | "vec3 fetchMicroTriangleVertexPositionNV(accelerationStructureEXT, int, int, int, ivec2);" |
5864 | 152 | "vec2 fetchMicroTriangleVertexBarycentricNV(accelerationStructureEXT, int, int, int, ivec2);" |
5865 | 152 | "\n"); |
5866 | | |
5867 | 152 | } |
5868 | | |
5869 | | |
5870 | | //============================================================================ |
5871 | | // |
5872 | | // Standard Uniforms |
5873 | | // |
5874 | | //============================================================================ |
5875 | | |
5876 | | // |
5877 | | // Depth range in window coordinates, p. 33 |
5878 | | // |
5879 | 4.34k | if (spvVersion.spv == 0) { |
5880 | 0 | commonBuiltins.append( |
5881 | 0 | "struct gl_DepthRangeParameters {" |
5882 | 0 | ); |
5883 | 0 | if (profile == EEsProfile) { |
5884 | 0 | commonBuiltins.append( |
5885 | 0 | "highp float near;" // n |
5886 | 0 | "highp float far;" // f |
5887 | 0 | "highp float diff;" // f - n |
5888 | 0 | ); |
5889 | 0 | } else { |
5890 | 0 | commonBuiltins.append( |
5891 | 0 | "float near;" // n |
5892 | 0 | "float far;" // f |
5893 | 0 | "float diff;" // f - n |
5894 | 0 | ); |
5895 | 0 | } |
5896 | |
|
5897 | 0 | commonBuiltins.append( |
5898 | 0 | "};" |
5899 | 0 | "uniform gl_DepthRangeParameters gl_DepthRange;" |
5900 | 0 | "\n"); |
5901 | 0 | } |
5902 | | |
5903 | 4.34k | if (spvVersion.spv == 0 && IncludeLegacy(version, profile, spvVersion)) { |
5904 | | // |
5905 | | // Matrix state. p. 31, 32, 37, 39, 40. |
5906 | | // |
5907 | 0 | commonBuiltins.append( |
5908 | 0 | "uniform mat4 gl_ModelViewMatrix;" |
5909 | 0 | "uniform mat4 gl_ProjectionMatrix;" |
5910 | 0 | "uniform mat4 gl_ModelViewProjectionMatrix;" |
5911 | | |
5912 | | // |
5913 | | // Derived matrix state that provides inverse and transposed versions |
5914 | | // of the matrices above. |
5915 | | // |
5916 | 0 | "uniform mat3 gl_NormalMatrix;" |
5917 | |
|
5918 | 0 | "uniform mat4 gl_ModelViewMatrixInverse;" |
5919 | 0 | "uniform mat4 gl_ProjectionMatrixInverse;" |
5920 | 0 | "uniform mat4 gl_ModelViewProjectionMatrixInverse;" |
5921 | |
|
5922 | 0 | "uniform mat4 gl_ModelViewMatrixTranspose;" |
5923 | 0 | "uniform mat4 gl_ProjectionMatrixTranspose;" |
5924 | 0 | "uniform mat4 gl_ModelViewProjectionMatrixTranspose;" |
5925 | |
|
5926 | 0 | "uniform mat4 gl_ModelViewMatrixInverseTranspose;" |
5927 | 0 | "uniform mat4 gl_ProjectionMatrixInverseTranspose;" |
5928 | 0 | "uniform mat4 gl_ModelViewProjectionMatrixInverseTranspose;" |
5929 | | |
5930 | | // |
5931 | | // Normal scaling p. 39. |
5932 | | // |
5933 | 0 | "uniform float gl_NormalScale;" |
5934 | | |
5935 | | // |
5936 | | // Point Size, p. 66, 67. |
5937 | | // |
5938 | 0 | "struct gl_PointParameters {" |
5939 | 0 | "float size;" |
5940 | 0 | "float sizeMin;" |
5941 | 0 | "float sizeMax;" |
5942 | 0 | "float fadeThresholdSize;" |
5943 | 0 | "float distanceConstantAttenuation;" |
5944 | 0 | "float distanceLinearAttenuation;" |
5945 | 0 | "float distanceQuadraticAttenuation;" |
5946 | 0 | "};" |
5947 | |
|
5948 | 0 | "uniform gl_PointParameters gl_Point;" |
5949 | | |
5950 | | // |
5951 | | // Material State p. 50, 55. |
5952 | | // |
5953 | 0 | "struct gl_MaterialParameters {" |
5954 | 0 | "vec4 emission;" // Ecm |
5955 | 0 | "vec4 ambient;" // Acm |
5956 | 0 | "vec4 diffuse;" // Dcm |
5957 | 0 | "vec4 specular;" // Scm |
5958 | 0 | "float shininess;" // Srm |
5959 | 0 | "};" |
5960 | 0 | "uniform gl_MaterialParameters gl_FrontMaterial;" |
5961 | 0 | "uniform gl_MaterialParameters gl_BackMaterial;" |
5962 | | |
5963 | | // |
5964 | | // Light State p 50, 53, 55. |
5965 | | // |
5966 | 0 | "struct gl_LightSourceParameters {" |
5967 | 0 | "vec4 ambient;" // Acli |
5968 | 0 | "vec4 diffuse;" // Dcli |
5969 | 0 | "vec4 specular;" // Scli |
5970 | 0 | "vec4 position;" // Ppli |
5971 | 0 | "vec4 halfVector;" // Derived: Hi |
5972 | 0 | "vec3 spotDirection;" // Sdli |
5973 | 0 | "float spotExponent;" // Srli |
5974 | 0 | "float spotCutoff;" // Crli |
5975 | | // (range: [0.0,90.0], 180.0) |
5976 | 0 | "float spotCosCutoff;" // Derived: cos(Crli) |
5977 | | // (range: [1.0,0.0],-1.0) |
5978 | 0 | "float constantAttenuation;" // K0 |
5979 | 0 | "float linearAttenuation;" // K1 |
5980 | 0 | "float quadraticAttenuation;"// K2 |
5981 | 0 | "};" |
5982 | |
|
5983 | 0 | "struct gl_LightModelParameters {" |
5984 | 0 | "vec4 ambient;" // Acs |
5985 | 0 | "};" |
5986 | |
|
5987 | 0 | "uniform gl_LightModelParameters gl_LightModel;" |
5988 | | |
5989 | | // |
5990 | | // Derived state from products of light and material. |
5991 | | // |
5992 | 0 | "struct gl_LightModelProducts {" |
5993 | 0 | "vec4 sceneColor;" // Derived. Ecm + Acm * Acs |
5994 | 0 | "};" |
5995 | |
|
5996 | 0 | "uniform gl_LightModelProducts gl_FrontLightModelProduct;" |
5997 | 0 | "uniform gl_LightModelProducts gl_BackLightModelProduct;" |
5998 | |
|
5999 | 0 | "struct gl_LightProducts {" |
6000 | 0 | "vec4 ambient;" // Acm * Acli |
6001 | 0 | "vec4 diffuse;" // Dcm * Dcli |
6002 | 0 | "vec4 specular;" // Scm * Scli |
6003 | 0 | "};" |
6004 | | |
6005 | | // |
6006 | | // Fog p. 161 |
6007 | | // |
6008 | 0 | "struct gl_FogParameters {" |
6009 | 0 | "vec4 color;" |
6010 | 0 | "float density;" |
6011 | 0 | "float start;" |
6012 | 0 | "float end;" |
6013 | 0 | "float scale;" // 1 / (gl_FogEnd - gl_FogStart) |
6014 | 0 | "};" |
6015 | |
|
6016 | 0 | "uniform gl_FogParameters gl_Fog;" |
6017 | |
|
6018 | 0 | "\n"); |
6019 | 0 | } |
6020 | | |
6021 | | //============================================================================ |
6022 | | // |
6023 | | // Define the interface to the compute shader. |
6024 | | // |
6025 | | //============================================================================ |
6026 | | |
6027 | 4.34k | if ((profile != EEsProfile && version >= 420) || |
6028 | 3.09k | (profile == EEsProfile && version >= 310)) { |
6029 | 1.50k | stageBuiltins[EShLangCompute].append( |
6030 | 1.50k | "in highp uvec3 gl_NumWorkGroups;" |
6031 | 1.50k | "const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);" |
6032 | | |
6033 | 1.50k | "in highp uvec3 gl_WorkGroupID;" |
6034 | 1.50k | "in highp uvec3 gl_LocalInvocationID;" |
6035 | | |
6036 | 1.50k | "in highp uvec3 gl_GlobalInvocationID;" |
6037 | 1.50k | "in highp uint gl_LocalInvocationIndex;" |
6038 | | |
6039 | 1.50k | "\n"); |
6040 | 1.50k | } |
6041 | | |
6042 | 4.34k | if ((profile != EEsProfile && version >= 140) || |
6043 | 4.34k | (profile == EEsProfile && version >= 310)) { |
6044 | 4.34k | stageBuiltins[EShLangCompute].append( |
6045 | 4.34k | "in highp int gl_DeviceIndex;" // GL_EXT_device_group |
6046 | 4.34k | "\n"); |
6047 | 4.34k | } |
6048 | | |
6049 | | // GL_QCOM_tile_shading |
6050 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
6051 | 4.08k | (profile != EEsProfile && version >= 460)) { |
6052 | 367 | stageBuiltins[EShLangCompute].append( |
6053 | 367 | "in highp uvec2 gl_TileOffsetQCOM;" // GL_QCOM_tile_shading |
6054 | 367 | "in highp uvec3 gl_TileDimensionQCOM;" // GL_QCOM_tile_shading |
6055 | 367 | "in highp uvec2 gl_TileApronSizeQCOM;" // GL_QCOM_tile_shading |
6056 | 367 | "\n"); |
6057 | 367 | } |
6058 | | |
6059 | | //============================================================================ |
6060 | | // |
6061 | | // Define the interface to the mesh/task shader. |
6062 | | // |
6063 | | //============================================================================ |
6064 | | |
6065 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
6066 | | // per-vertex attributes |
6067 | 927 | stageBuiltins[EShLangMesh].append( |
6068 | 927 | "out gl_MeshPerVertexNV {" |
6069 | 927 | "vec4 gl_Position;" |
6070 | 927 | "float gl_PointSize;" |
6071 | 927 | "float gl_ClipDistance[];" |
6072 | 927 | "float gl_CullDistance[];" |
6073 | 927 | "perviewNV vec4 gl_PositionPerViewNV[];" |
6074 | 927 | "perviewNV float gl_ClipDistancePerViewNV[][];" |
6075 | 927 | "perviewNV float gl_CullDistancePerViewNV[][];" |
6076 | 927 | "} gl_MeshVerticesNV[];" |
6077 | 927 | ); |
6078 | | |
6079 | | // per-primitive attributes |
6080 | 927 | stageBuiltins[EShLangMesh].append( |
6081 | 927 | "perprimitiveNV out gl_MeshPerPrimitiveNV {" |
6082 | 927 | "int gl_PrimitiveID;" |
6083 | 927 | "int gl_Layer;" |
6084 | 927 | "int gl_ViewportIndex;" |
6085 | 927 | "int gl_ViewportMask[];" |
6086 | 927 | "perviewNV int gl_LayerPerViewNV[];" |
6087 | 927 | "perviewNV int gl_ViewportMaskPerViewNV[][];" |
6088 | 927 | "} gl_MeshPrimitivesNV[];" |
6089 | 927 | ); |
6090 | | |
6091 | 927 | stageBuiltins[EShLangMesh].append( |
6092 | 927 | "out uint gl_PrimitiveCountNV;" |
6093 | 927 | "out uint gl_PrimitiveIndicesNV[];" |
6094 | | |
6095 | 927 | "in uint gl_MeshViewCountNV;" |
6096 | 927 | "in uint gl_MeshViewIndicesNV[4];" |
6097 | | |
6098 | 927 | "const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);" |
6099 | | |
6100 | 927 | "in highp uvec3 gl_WorkGroupID;" |
6101 | 927 | "in highp uvec3 gl_LocalInvocationID;" |
6102 | | |
6103 | 927 | "in highp uvec3 gl_GlobalInvocationID;" |
6104 | 927 | "in highp uint gl_LocalInvocationIndex;" |
6105 | 927 | "\n"); |
6106 | | |
6107 | | // GL_EXT_mesh_shader |
6108 | 927 | stageBuiltins[EShLangMesh].append( |
6109 | 927 | "out uint gl_PrimitivePointIndicesEXT[];" |
6110 | 927 | "out uvec2 gl_PrimitiveLineIndicesEXT[];" |
6111 | 927 | "out uvec3 gl_PrimitiveTriangleIndicesEXT[];" |
6112 | 927 | "in highp uvec3 gl_NumWorkGroups;" |
6113 | 927 | "\n"); |
6114 | | |
6115 | | // per-vertex attributes |
6116 | 927 | stageBuiltins[EShLangMesh].append( |
6117 | 927 | "out gl_MeshPerVertexEXT {" |
6118 | 927 | "vec4 gl_Position;" |
6119 | 927 | "float gl_PointSize;" |
6120 | 927 | "float gl_ClipDistance[];" |
6121 | 927 | "float gl_CullDistance[];" |
6122 | 927 | "} gl_MeshVerticesEXT[];" |
6123 | 927 | ); |
6124 | | |
6125 | | // per-primitive attributes |
6126 | 927 | stageBuiltins[EShLangMesh].append( |
6127 | 927 | "perprimitiveEXT out gl_MeshPerPrimitiveEXT {" |
6128 | 927 | "int gl_PrimitiveID;" |
6129 | 927 | "int gl_Layer;" |
6130 | 927 | "int gl_ViewportIndex;" |
6131 | 927 | "bool gl_CullPrimitiveEXT;" |
6132 | 927 | "int gl_PrimitiveShadingRateEXT;" |
6133 | 927 | "} gl_MeshPrimitivesEXT[];" |
6134 | 927 | ); |
6135 | | |
6136 | 927 | stageBuiltins[EShLangTask].append( |
6137 | 927 | "out uint gl_TaskCountNV;" |
6138 | | |
6139 | 927 | "const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);" |
6140 | | |
6141 | 927 | "in highp uvec3 gl_WorkGroupID;" |
6142 | 927 | "in highp uvec3 gl_LocalInvocationID;" |
6143 | | |
6144 | 927 | "in highp uvec3 gl_GlobalInvocationID;" |
6145 | 927 | "in highp uint gl_LocalInvocationIndex;" |
6146 | | |
6147 | 927 | "in uint gl_MeshViewCountNV;" |
6148 | 927 | "in uint gl_MeshViewIndicesNV[4];" |
6149 | 927 | "in highp uvec3 gl_NumWorkGroups;" |
6150 | 927 | "\n"); |
6151 | 927 | } |
6152 | | |
6153 | 4.34k | if (profile != EEsProfile && version >= 450) { |
6154 | 883 | stageBuiltins[EShLangMesh].append( |
6155 | 883 | "in highp int gl_DeviceIndex;" // GL_EXT_device_group |
6156 | 883 | "in int gl_DrawIDARB;" // GL_ARB_shader_draw_parameters |
6157 | 883 | "in int gl_ViewIndex;" // GL_EXT_multiview |
6158 | 883 | "\n"); |
6159 | | |
6160 | 883 | stageBuiltins[EShLangTask].append( |
6161 | 883 | "in highp int gl_DeviceIndex;" // GL_EXT_device_group |
6162 | 883 | "in int gl_DrawIDARB;" // GL_ARB_shader_draw_parameters |
6163 | 883 | "\n"); |
6164 | | |
6165 | 883 | if (version >= 460) { |
6166 | 108 | stageBuiltins[EShLangMesh].append( |
6167 | 108 | "in int gl_DrawID;" |
6168 | 108 | "\n"); |
6169 | | |
6170 | 108 | stageBuiltins[EShLangTask].append( |
6171 | 108 | "in int gl_DrawID;" |
6172 | 108 | "\n"); |
6173 | 108 | } |
6174 | 883 | } |
6175 | | |
6176 | | //============================================================================ |
6177 | | // |
6178 | | // Define the interface to the vertex shader. |
6179 | | // |
6180 | | //============================================================================ |
6181 | | |
6182 | 4.34k | if (profile != EEsProfile) { |
6183 | 4.08k | if (version < 130) { |
6184 | 0 | stageBuiltins[EShLangVertex].append( |
6185 | 0 | "attribute vec4 gl_Color;" |
6186 | 0 | "attribute vec4 gl_SecondaryColor;" |
6187 | 0 | "attribute vec3 gl_Normal;" |
6188 | 0 | "attribute vec4 gl_Vertex;" |
6189 | 0 | "attribute vec4 gl_MultiTexCoord0;" |
6190 | 0 | "attribute vec4 gl_MultiTexCoord1;" |
6191 | 0 | "attribute vec4 gl_MultiTexCoord2;" |
6192 | 0 | "attribute vec4 gl_MultiTexCoord3;" |
6193 | 0 | "attribute vec4 gl_MultiTexCoord4;" |
6194 | 0 | "attribute vec4 gl_MultiTexCoord5;" |
6195 | 0 | "attribute vec4 gl_MultiTexCoord6;" |
6196 | 0 | "attribute vec4 gl_MultiTexCoord7;" |
6197 | 0 | "attribute float gl_FogCoord;" |
6198 | 0 | "\n"); |
6199 | 4.08k | } else if (IncludeLegacy(version, profile, spvVersion)) { |
6200 | 13 | stageBuiltins[EShLangVertex].append( |
6201 | 13 | "in vec4 gl_Color;" |
6202 | 13 | "in vec4 gl_SecondaryColor;" |
6203 | 13 | "in vec3 gl_Normal;" |
6204 | 13 | "in vec4 gl_Vertex;" |
6205 | 13 | "in vec4 gl_MultiTexCoord0;" |
6206 | 13 | "in vec4 gl_MultiTexCoord1;" |
6207 | 13 | "in vec4 gl_MultiTexCoord2;" |
6208 | 13 | "in vec4 gl_MultiTexCoord3;" |
6209 | 13 | "in vec4 gl_MultiTexCoord4;" |
6210 | 13 | "in vec4 gl_MultiTexCoord5;" |
6211 | 13 | "in vec4 gl_MultiTexCoord6;" |
6212 | 13 | "in vec4 gl_MultiTexCoord7;" |
6213 | 13 | "in float gl_FogCoord;" |
6214 | 13 | "\n"); |
6215 | 13 | } |
6216 | | |
6217 | 4.08k | if (version < 150) { |
6218 | 2.31k | if (version < 130) { |
6219 | 0 | stageBuiltins[EShLangVertex].append( |
6220 | 0 | " vec4 gl_ClipVertex;" // needs qualifier fixed later |
6221 | 0 | "varying vec4 gl_FrontColor;" |
6222 | 0 | "varying vec4 gl_BackColor;" |
6223 | 0 | "varying vec4 gl_FrontSecondaryColor;" |
6224 | 0 | "varying vec4 gl_BackSecondaryColor;" |
6225 | 0 | "varying vec4 gl_TexCoord[];" |
6226 | 0 | "varying float gl_FogFragCoord;" |
6227 | 0 | "\n"); |
6228 | 2.31k | } else if (IncludeLegacy(version, profile, spvVersion)) { |
6229 | 0 | stageBuiltins[EShLangVertex].append( |
6230 | 0 | " vec4 gl_ClipVertex;" // needs qualifier fixed later |
6231 | 0 | "out vec4 gl_FrontColor;" |
6232 | 0 | "out vec4 gl_BackColor;" |
6233 | 0 | "out vec4 gl_FrontSecondaryColor;" |
6234 | 0 | "out vec4 gl_BackSecondaryColor;" |
6235 | 0 | "out vec4 gl_TexCoord[];" |
6236 | 0 | "out float gl_FogFragCoord;" |
6237 | 0 | "\n"); |
6238 | 0 | } |
6239 | 2.31k | stageBuiltins[EShLangVertex].append( |
6240 | 2.31k | "vec4 gl_Position;" // needs qualifier fixed later |
6241 | 2.31k | "float gl_PointSize;" // needs qualifier fixed later |
6242 | 2.31k | ); |
6243 | | |
6244 | 2.31k | if (version == 130 || version == 140) |
6245 | 2.31k | stageBuiltins[EShLangVertex].append( |
6246 | 2.31k | "out float gl_ClipDistance[];" |
6247 | 2.31k | ); |
6248 | 2.31k | } else { |
6249 | | // version >= 150 |
6250 | 1.76k | stageBuiltins[EShLangVertex].append( |
6251 | 1.76k | "out gl_PerVertex {" |
6252 | 1.76k | "vec4 gl_Position;" // needs qualifier fixed later |
6253 | 1.76k | "float gl_PointSize;" // needs qualifier fixed later |
6254 | 1.76k | "float gl_ClipDistance[];" |
6255 | 1.76k | ); |
6256 | 1.76k | if (IncludeLegacy(version, profile, spvVersion)) |
6257 | 13 | stageBuiltins[EShLangVertex].append( |
6258 | 13 | "vec4 gl_ClipVertex;" // needs qualifier fixed later |
6259 | 13 | "vec4 gl_FrontColor;" |
6260 | 13 | "vec4 gl_BackColor;" |
6261 | 13 | "vec4 gl_FrontSecondaryColor;" |
6262 | 13 | "vec4 gl_BackSecondaryColor;" |
6263 | 13 | "vec4 gl_TexCoord[];" |
6264 | 13 | "float gl_FogFragCoord;" |
6265 | 13 | ); |
6266 | 1.76k | if (version >= 450) |
6267 | 883 | stageBuiltins[EShLangVertex].append( |
6268 | 883 | "float gl_CullDistance[];" |
6269 | 883 | ); |
6270 | 1.76k | stageBuiltins[EShLangVertex].append( |
6271 | 1.76k | "};" |
6272 | 1.76k | "\n"); |
6273 | 1.76k | } |
6274 | 4.08k | if (version >= 130 && spvVersion.vulkan == 0) |
6275 | 0 | stageBuiltins[EShLangVertex].append( |
6276 | 0 | "int gl_VertexID;" // needs qualifier fixed later |
6277 | 0 | ); |
6278 | 4.08k | if (spvVersion.vulkan == 0) |
6279 | 0 | stageBuiltins[EShLangVertex].append( |
6280 | 0 | "int gl_InstanceID;" // needs qualifier fixed later |
6281 | 0 | ); |
6282 | 4.08k | if (spvVersion.vulkan > 0 && version >= 140) |
6283 | 4.08k | stageBuiltins[EShLangVertex].append( |
6284 | 4.08k | "in int gl_VertexIndex;" |
6285 | 4.08k | "in int gl_InstanceIndex;" |
6286 | 4.08k | ); |
6287 | | |
6288 | 4.08k | if (spvVersion.vulkan > 0 && version >= 140 && spvVersion.vulkanRelaxed) |
6289 | 0 | stageBuiltins[EShLangVertex].append( |
6290 | 0 | "in int gl_VertexID;" // declare with 'in' qualifier |
6291 | 0 | "in int gl_InstanceID;" |
6292 | 0 | ); |
6293 | | |
6294 | 4.08k | if (version >= 440) { |
6295 | 951 | stageBuiltins[EShLangVertex].append( |
6296 | 951 | "in int gl_BaseVertexARB;" |
6297 | 951 | "in int gl_BaseInstanceARB;" |
6298 | 951 | "in int gl_DrawIDARB;" |
6299 | 951 | ); |
6300 | 951 | } |
6301 | 4.08k | if (version >= 410) { |
6302 | 1.24k | stageBuiltins[EShLangVertex].append( |
6303 | 1.24k | "out int gl_ViewportIndex;" |
6304 | 1.24k | "out int gl_Layer;" |
6305 | 1.24k | ); |
6306 | 1.24k | } |
6307 | 4.08k | if (version >= 460) { |
6308 | 108 | stageBuiltins[EShLangVertex].append( |
6309 | 108 | "in int gl_BaseVertex;" |
6310 | 108 | "in int gl_BaseInstance;" |
6311 | 108 | "in int gl_DrawID;" |
6312 | 108 | ); |
6313 | 108 | } |
6314 | | |
6315 | 4.08k | if (version >= 430) |
6316 | 1.22k | stageBuiltins[EShLangVertex].append( |
6317 | 1.22k | "out int gl_ViewportMask[];" // GL_NV_viewport_array2 |
6318 | 1.22k | ); |
6319 | | |
6320 | 4.08k | if (version >= 450) |
6321 | 883 | stageBuiltins[EShLangVertex].append( |
6322 | 883 | "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering |
6323 | 883 | "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering |
6324 | 883 | "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
6325 | 883 | "out int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
6326 | 883 | ); |
6327 | 4.08k | } else { |
6328 | | // ES profile |
6329 | 259 | if (version == 100) { |
6330 | 0 | stageBuiltins[EShLangVertex].append( |
6331 | 0 | "highp vec4 gl_Position;" // needs qualifier fixed later |
6332 | 0 | "mediump float gl_PointSize;" // needs qualifier fixed later |
6333 | 0 | "highp int gl_InstanceID;" // needs qualifier fixed later |
6334 | 0 | ); |
6335 | 259 | } else { |
6336 | 259 | if (spvVersion.vulkan == 0 || spvVersion.vulkanRelaxed) |
6337 | 0 | stageBuiltins[EShLangVertex].append( |
6338 | 0 | "in highp int gl_VertexID;" // needs qualifier fixed later |
6339 | 0 | "in highp int gl_InstanceID;" // needs qualifier fixed later |
6340 | 0 | ); |
6341 | 259 | if (spvVersion.vulkan > 0) |
6342 | 259 | stageBuiltins[EShLangVertex].append( |
6343 | 259 | "in highp int gl_VertexIndex;" |
6344 | 259 | "in highp int gl_InstanceIndex;" |
6345 | 259 | ); |
6346 | 259 | if (version < 310) |
6347 | 0 | stageBuiltins[EShLangVertex].append( |
6348 | 0 | "highp vec4 gl_Position;" // needs qualifier fixed later |
6349 | 0 | "highp float gl_PointSize;" // needs qualifier fixed later |
6350 | 0 | ); |
6351 | 259 | else |
6352 | 259 | stageBuiltins[EShLangVertex].append( |
6353 | 259 | "out gl_PerVertex {" |
6354 | 259 | "highp vec4 gl_Position;" // needs qualifier fixed later |
6355 | 259 | "highp float gl_PointSize;" // needs qualifier fixed later |
6356 | 259 | "};" |
6357 | 259 | ); |
6358 | 259 | } |
6359 | 259 | } |
6360 | | |
6361 | 4.34k | if ((profile != EEsProfile && version >= 140) || |
6362 | 4.34k | (profile == EEsProfile && version >= 310)) { |
6363 | 4.34k | stageBuiltins[EShLangVertex].append( |
6364 | 4.34k | "in highp int gl_DeviceIndex;" // GL_EXT_device_group |
6365 | 4.34k | "in highp int gl_ViewIndex;" // GL_EXT_multiview |
6366 | 4.34k | "\n"); |
6367 | 4.34k | } |
6368 | | |
6369 | 4.34k | if (version >= 300 /* both ES and non-ES */) { |
6370 | 1.84k | stageBuiltins[EShLangVertex].append( |
6371 | 1.84k | "in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2 |
6372 | 1.84k | "\n"); |
6373 | 1.84k | } |
6374 | | |
6375 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { |
6376 | 1.14k | stageBuiltins[EShLangVertex].append( |
6377 | 1.14k | "out highp int gl_PrimitiveShadingRateEXT;" // GL_EXT_fragment_shading_rate |
6378 | 1.14k | "\n"); |
6379 | 1.14k | } |
6380 | | |
6381 | | //============================================================================ |
6382 | | // |
6383 | | // Define the interface to the geometry shader. |
6384 | | // |
6385 | | //============================================================================ |
6386 | | |
6387 | 4.34k | if (profile == ECoreProfile || profile == ECompatibilityProfile) { |
6388 | 1.76k | stageBuiltins[EShLangGeometry].append( |
6389 | 1.76k | "in gl_PerVertex {" |
6390 | 1.76k | "vec4 gl_Position;" |
6391 | 1.76k | "float gl_PointSize;" |
6392 | 1.76k | "float gl_ClipDistance[];" |
6393 | 1.76k | ); |
6394 | 1.76k | if (profile == ECompatibilityProfile) |
6395 | 13 | stageBuiltins[EShLangGeometry].append( |
6396 | 13 | "vec4 gl_ClipVertex;" |
6397 | 13 | "vec4 gl_FrontColor;" |
6398 | 13 | "vec4 gl_BackColor;" |
6399 | 13 | "vec4 gl_FrontSecondaryColor;" |
6400 | 13 | "vec4 gl_BackSecondaryColor;" |
6401 | 13 | "vec4 gl_TexCoord[];" |
6402 | 13 | "float gl_FogFragCoord;" |
6403 | 13 | ); |
6404 | 1.76k | if (version >= 450) |
6405 | 880 | stageBuiltins[EShLangGeometry].append( |
6406 | 880 | "float gl_CullDistance[];" |
6407 | 880 | "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering |
6408 | 880 | "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
6409 | 880 | ); |
6410 | 1.76k | stageBuiltins[EShLangGeometry].append( |
6411 | 1.76k | "} gl_in[];" |
6412 | | |
6413 | 1.76k | "in int gl_PrimitiveIDIn;" |
6414 | 1.76k | "out gl_PerVertex {" |
6415 | 1.76k | "vec4 gl_Position;" |
6416 | 1.76k | "float gl_PointSize;" |
6417 | 1.76k | "float gl_ClipDistance[];" |
6418 | 1.76k | "\n"); |
6419 | 1.76k | if (profile == ECompatibilityProfile && version >= 400) |
6420 | 6 | stageBuiltins[EShLangGeometry].append( |
6421 | 6 | "vec4 gl_ClipVertex;" |
6422 | 6 | "vec4 gl_FrontColor;" |
6423 | 6 | "vec4 gl_BackColor;" |
6424 | 6 | "vec4 gl_FrontSecondaryColor;" |
6425 | 6 | "vec4 gl_BackSecondaryColor;" |
6426 | 6 | "vec4 gl_TexCoord[];" |
6427 | 6 | "float gl_FogFragCoord;" |
6428 | 6 | ); |
6429 | 1.76k | if (version >= 450) |
6430 | 880 | stageBuiltins[EShLangGeometry].append( |
6431 | 880 | "float gl_CullDistance[];" |
6432 | 880 | ); |
6433 | 1.76k | stageBuiltins[EShLangGeometry].append( |
6434 | 1.76k | "};" |
6435 | | |
6436 | 1.76k | "out int gl_PrimitiveID;" |
6437 | 1.76k | "out int gl_Layer;"); |
6438 | | |
6439 | 1.76k | if (version >= 150) |
6440 | 1.76k | stageBuiltins[EShLangGeometry].append( |
6441 | 1.76k | "out int gl_ViewportIndex;" |
6442 | 1.76k | ); |
6443 | | |
6444 | 1.76k | if (profile == ECompatibilityProfile && version < 400) |
6445 | 7 | stageBuiltins[EShLangGeometry].append( |
6446 | 7 | "out vec4 gl_ClipVertex;" |
6447 | 7 | ); |
6448 | | |
6449 | 1.76k | if (version >= 150) |
6450 | 1.76k | stageBuiltins[EShLangGeometry].append( |
6451 | 1.76k | "in int gl_InvocationID;" |
6452 | 1.76k | ); |
6453 | | |
6454 | 1.76k | if (version >= 430) |
6455 | 1.22k | stageBuiltins[EShLangGeometry].append( |
6456 | 1.22k | "out int gl_ViewportMask[];" // GL_NV_viewport_array2 |
6457 | 1.22k | ); |
6458 | | |
6459 | 1.76k | if (version >= 450) |
6460 | 880 | stageBuiltins[EShLangGeometry].append( |
6461 | 880 | "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering |
6462 | 880 | "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering |
6463 | 880 | "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
6464 | 880 | "out int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
6465 | 880 | ); |
6466 | | |
6467 | 1.76k | stageBuiltins[EShLangGeometry].append("\n"); |
6468 | 2.57k | } else if (profile == EEsProfile && version >= 310) { |
6469 | 259 | stageBuiltins[EShLangGeometry].append( |
6470 | 259 | "in gl_PerVertex {" |
6471 | 259 | "highp vec4 gl_Position;" |
6472 | 259 | "highp float gl_PointSize;" |
6473 | 259 | "} gl_in[];" |
6474 | 259 | "\n" |
6475 | 259 | "in highp int gl_PrimitiveIDIn;" |
6476 | 259 | "in highp int gl_InvocationID;" |
6477 | 259 | "\n" |
6478 | 259 | "out gl_PerVertex {" |
6479 | 259 | "highp vec4 gl_Position;" |
6480 | 259 | "highp float gl_PointSize;" |
6481 | 259 | "};" |
6482 | 259 | "\n" |
6483 | 259 | "out highp int gl_PrimitiveID;" |
6484 | 259 | "out highp int gl_Layer;" |
6485 | 259 | "\n" |
6486 | 259 | ); |
6487 | 259 | } |
6488 | | |
6489 | 4.34k | if ((profile != EEsProfile && version >= 140) || |
6490 | 4.34k | (profile == EEsProfile && version >= 310)) { |
6491 | 4.34k | stageBuiltins[EShLangGeometry].append( |
6492 | 4.34k | "in highp int gl_DeviceIndex;" // GL_EXT_device_group |
6493 | 4.34k | "in highp int gl_ViewIndex;" // GL_EXT_multiview |
6494 | 4.34k | "\n"); |
6495 | 4.34k | } |
6496 | | |
6497 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { |
6498 | 1.14k | stageBuiltins[EShLangGeometry].append( |
6499 | 1.14k | "out highp int gl_PrimitiveShadingRateEXT;" // GL_EXT_fragment_shading_rate |
6500 | 1.14k | "\n"); |
6501 | 1.14k | } |
6502 | | |
6503 | | //============================================================================ |
6504 | | // |
6505 | | // Define the interface to the tessellation control shader. |
6506 | | // |
6507 | | //============================================================================ |
6508 | | |
6509 | 4.34k | if (profile != EEsProfile && version >= 150) { |
6510 | | // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, |
6511 | | // as it depends on the resource sizing of gl_MaxPatchVertices. |
6512 | | |
6513 | 1.76k | stageBuiltins[EShLangTessControl].append( |
6514 | 1.76k | "in int gl_PatchVerticesIn;" |
6515 | 1.76k | "in int gl_PrimitiveID;" |
6516 | 1.76k | "in int gl_InvocationID;" |
6517 | | |
6518 | 1.76k | "out gl_PerVertex {" |
6519 | 1.76k | "vec4 gl_Position;" |
6520 | 1.76k | "float gl_PointSize;" |
6521 | 1.76k | "float gl_ClipDistance[];" |
6522 | 1.76k | ); |
6523 | 1.76k | if (profile == ECompatibilityProfile) |
6524 | 13 | stageBuiltins[EShLangTessControl].append( |
6525 | 13 | "vec4 gl_ClipVertex;" |
6526 | 13 | "vec4 gl_FrontColor;" |
6527 | 13 | "vec4 gl_BackColor;" |
6528 | 13 | "vec4 gl_FrontSecondaryColor;" |
6529 | 13 | "vec4 gl_BackSecondaryColor;" |
6530 | 13 | "vec4 gl_TexCoord[];" |
6531 | 13 | "float gl_FogFragCoord;" |
6532 | 13 | ); |
6533 | 1.76k | if (version >= 450) |
6534 | 883 | stageBuiltins[EShLangTessControl].append( |
6535 | 883 | "float gl_CullDistance[];" |
6536 | 883 | ); |
6537 | 1.76k | if (version >= 430) |
6538 | 1.22k | stageBuiltins[EShLangTessControl].append( |
6539 | 1.22k | "int gl_ViewportMask[];" // GL_NV_viewport_array2 |
6540 | 1.22k | ); |
6541 | 1.76k | if (version >= 450) |
6542 | 883 | stageBuiltins[EShLangTessControl].append( |
6543 | 883 | "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering |
6544 | 883 | "int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering |
6545 | 883 | "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
6546 | 883 | "int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
6547 | 883 | ); |
6548 | 1.76k | stageBuiltins[EShLangTessControl].append( |
6549 | 1.76k | "} gl_out[];" |
6550 | | |
6551 | 1.76k | "patch out float gl_TessLevelOuter[4];" |
6552 | 1.76k | "patch out float gl_TessLevelInner[2];" |
6553 | 1.76k | "\n"); |
6554 | | |
6555 | 1.76k | if (version >= 410) |
6556 | 1.24k | stageBuiltins[EShLangTessControl].append( |
6557 | 1.24k | "out int gl_ViewportIndex;" |
6558 | 1.24k | "out int gl_Layer;" |
6559 | 1.24k | "\n"); |
6560 | | |
6561 | 2.57k | } else { |
6562 | | // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, |
6563 | | // as it depends on the resource sizing of gl_MaxPatchVertices. |
6564 | | |
6565 | 2.57k | stageBuiltins[EShLangTessControl].append( |
6566 | 2.57k | "in highp int gl_PatchVerticesIn;" |
6567 | 2.57k | "in highp int gl_PrimitiveID;" |
6568 | 2.57k | "in highp int gl_InvocationID;" |
6569 | | |
6570 | 2.57k | "out gl_PerVertex {" |
6571 | 2.57k | "highp vec4 gl_Position;" |
6572 | 2.57k | "highp float gl_PointSize;" |
6573 | 2.57k | ); |
6574 | 2.57k | stageBuiltins[EShLangTessControl].append( |
6575 | 2.57k | "} gl_out[];" |
6576 | | |
6577 | 2.57k | "patch out highp float gl_TessLevelOuter[4];" |
6578 | 2.57k | "patch out highp float gl_TessLevelInner[2];" |
6579 | 2.57k | "patch out highp vec4 gl_BoundingBoxOES[2];" |
6580 | 2.57k | "patch out highp vec4 gl_BoundingBoxEXT[2];" |
6581 | 2.57k | "\n"); |
6582 | 2.57k | if (profile == EEsProfile && version >= 320) { |
6583 | 44 | stageBuiltins[EShLangTessControl].append( |
6584 | 44 | "patch out highp vec4 gl_BoundingBox[2];" |
6585 | 44 | "\n" |
6586 | 44 | ); |
6587 | 44 | } |
6588 | 2.57k | } |
6589 | | |
6590 | 4.34k | if ((profile != EEsProfile && version >= 140) || |
6591 | 4.34k | (profile == EEsProfile && version >= 310)) { |
6592 | 4.34k | stageBuiltins[EShLangTessControl].append( |
6593 | 4.34k | "in highp int gl_DeviceIndex;" // GL_EXT_device_group |
6594 | 4.34k | "in highp int gl_ViewIndex;" // GL_EXT_multiview |
6595 | 4.34k | "\n"); |
6596 | 4.34k | } |
6597 | | |
6598 | | //============================================================================ |
6599 | | // |
6600 | | // Define the interface to the tessellation evaluation shader. |
6601 | | // |
6602 | | //============================================================================ |
6603 | | |
6604 | 4.34k | if (profile != EEsProfile && version >= 150) { |
6605 | | // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, |
6606 | | // as it depends on the resource sizing of gl_MaxPatchVertices. |
6607 | | |
6608 | 1.76k | stageBuiltins[EShLangTessEvaluation].append( |
6609 | 1.76k | "in int gl_PatchVerticesIn;" |
6610 | 1.76k | "in int gl_PrimitiveID;" |
6611 | 1.76k | "in vec3 gl_TessCoord;" |
6612 | | |
6613 | 1.76k | "patch in float gl_TessLevelOuter[4];" |
6614 | 1.76k | "patch in float gl_TessLevelInner[2];" |
6615 | | |
6616 | 1.76k | "out gl_PerVertex {" |
6617 | 1.76k | "vec4 gl_Position;" |
6618 | 1.76k | "float gl_PointSize;" |
6619 | 1.76k | "float gl_ClipDistance[];" |
6620 | 1.76k | ); |
6621 | 1.76k | if (version >= 400 && profile == ECompatibilityProfile) |
6622 | 6 | stageBuiltins[EShLangTessEvaluation].append( |
6623 | 6 | "vec4 gl_ClipVertex;" |
6624 | 6 | "vec4 gl_FrontColor;" |
6625 | 6 | "vec4 gl_BackColor;" |
6626 | 6 | "vec4 gl_FrontSecondaryColor;" |
6627 | 6 | "vec4 gl_BackSecondaryColor;" |
6628 | 6 | "vec4 gl_TexCoord[];" |
6629 | 6 | "float gl_FogFragCoord;" |
6630 | 6 | ); |
6631 | 1.76k | if (version >= 450) |
6632 | 883 | stageBuiltins[EShLangTessEvaluation].append( |
6633 | 883 | "float gl_CullDistance[];" |
6634 | 883 | ); |
6635 | 1.76k | stageBuiltins[EShLangTessEvaluation].append( |
6636 | 1.76k | "};" |
6637 | 1.76k | "\n"); |
6638 | | |
6639 | 1.76k | if (version >= 410) |
6640 | 1.24k | stageBuiltins[EShLangTessEvaluation].append( |
6641 | 1.24k | "out int gl_ViewportIndex;" |
6642 | 1.24k | "out int gl_Layer;" |
6643 | 1.24k | "\n"); |
6644 | | |
6645 | 1.76k | if (version >= 430) |
6646 | 1.22k | stageBuiltins[EShLangTessEvaluation].append( |
6647 | 1.22k | "out int gl_ViewportMask[];" // GL_NV_viewport_array2 |
6648 | 1.22k | ); |
6649 | | |
6650 | 1.76k | if (version >= 450) |
6651 | 883 | stageBuiltins[EShLangTessEvaluation].append( |
6652 | 883 | "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering |
6653 | 883 | "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering |
6654 | 883 | "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
6655 | 883 | "out int gl_ViewportMaskPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
6656 | 883 | ); |
6657 | | |
6658 | 2.57k | } else if (profile == EEsProfile && version >= 310) { |
6659 | | // Note: "in gl_PerVertex {...} gl_in[gl_MaxPatchVertices];" is declared in initialize() below, |
6660 | | // as it depends on the resource sizing of gl_MaxPatchVertices. |
6661 | | |
6662 | 259 | stageBuiltins[EShLangTessEvaluation].append( |
6663 | 259 | "in highp int gl_PatchVerticesIn;" |
6664 | 259 | "in highp int gl_PrimitiveID;" |
6665 | 259 | "in highp vec3 gl_TessCoord;" |
6666 | | |
6667 | 259 | "patch in highp float gl_TessLevelOuter[4];" |
6668 | 259 | "patch in highp float gl_TessLevelInner[2];" |
6669 | | |
6670 | 259 | "out gl_PerVertex {" |
6671 | 259 | "highp vec4 gl_Position;" |
6672 | 259 | "highp float gl_PointSize;" |
6673 | 259 | ); |
6674 | 259 | stageBuiltins[EShLangTessEvaluation].append( |
6675 | 259 | "};" |
6676 | 259 | "\n"); |
6677 | 259 | } |
6678 | | |
6679 | 4.34k | if ((profile != EEsProfile && version >= 140) || |
6680 | 4.34k | (profile == EEsProfile && version >= 310)) { |
6681 | 4.34k | stageBuiltins[EShLangTessEvaluation].append( |
6682 | 4.34k | "in highp int gl_DeviceIndex;" // GL_EXT_device_group |
6683 | 4.34k | "in highp int gl_ViewIndex;" // GL_EXT_multiview |
6684 | 4.34k | "\n"); |
6685 | 4.34k | } |
6686 | | |
6687 | | //============================================================================ |
6688 | | // |
6689 | | // Define the interface to the fragment shader. |
6690 | | // |
6691 | | //============================================================================ |
6692 | | |
6693 | 4.34k | if (profile != EEsProfile) { |
6694 | | |
6695 | 4.08k | stageBuiltins[EShLangFragment].append( |
6696 | 4.08k | "vec4 gl_FragCoord;" // needs qualifier fixed later |
6697 | 4.08k | "bool gl_FrontFacing;" // needs qualifier fixed later |
6698 | 4.08k | "float gl_FragDepth;" // needs qualifier fixed later |
6699 | 4.08k | ); |
6700 | 4.08k | if (version >= 120) |
6701 | 4.08k | stageBuiltins[EShLangFragment].append( |
6702 | 4.08k | "vec2 gl_PointCoord;" // needs qualifier fixed later |
6703 | 4.08k | ); |
6704 | 4.08k | if (version >= 140) |
6705 | 4.08k | stageBuiltins[EShLangFragment].append( |
6706 | 4.08k | "out int gl_FragStencilRefARB;" |
6707 | 4.08k | ); |
6708 | 4.08k | if (IncludeLegacy(version, profile, spvVersion) || (! ForwardCompatibility && version < 420)) |
6709 | 2.84k | stageBuiltins[EShLangFragment].append( |
6710 | 2.84k | "vec4 gl_FragColor;" // needs qualifier fixed later |
6711 | 2.84k | ); |
6712 | | |
6713 | 4.08k | if (version < 130) { |
6714 | 0 | stageBuiltins[EShLangFragment].append( |
6715 | 0 | "varying vec4 gl_Color;" |
6716 | 0 | "varying vec4 gl_SecondaryColor;" |
6717 | 0 | "varying vec4 gl_TexCoord[];" |
6718 | 0 | "varying float gl_FogFragCoord;" |
6719 | 0 | ); |
6720 | 4.08k | } else { |
6721 | 4.08k | stageBuiltins[EShLangFragment].append( |
6722 | 4.08k | "in float gl_ClipDistance[];" |
6723 | 4.08k | ); |
6724 | | |
6725 | 4.08k | if (IncludeLegacy(version, profile, spvVersion)) { |
6726 | 13 | if (version < 150) |
6727 | 0 | stageBuiltins[EShLangFragment].append( |
6728 | 0 | "in float gl_FogFragCoord;" |
6729 | 0 | "in vec4 gl_TexCoord[];" |
6730 | 0 | "in vec4 gl_Color;" |
6731 | 0 | "in vec4 gl_SecondaryColor;" |
6732 | 0 | ); |
6733 | 13 | else |
6734 | 13 | stageBuiltins[EShLangFragment].append( |
6735 | 13 | "in gl_PerFragment {" |
6736 | 13 | "in float gl_FogFragCoord;" |
6737 | 13 | "in vec4 gl_TexCoord[];" |
6738 | 13 | "in vec4 gl_Color;" |
6739 | 13 | "in vec4 gl_SecondaryColor;" |
6740 | 13 | "};" |
6741 | 13 | ); |
6742 | 13 | } |
6743 | 4.08k | } |
6744 | | |
6745 | 4.08k | if (version >= 150) |
6746 | 1.76k | stageBuiltins[EShLangFragment].append( |
6747 | 1.76k | "flat in int gl_PrimitiveID;" |
6748 | 1.76k | ); |
6749 | | |
6750 | 4.08k | if (version >= 130) { // ARB_sample_shading |
6751 | 4.08k | stageBuiltins[EShLangFragment].append( |
6752 | 4.08k | "flat in int gl_SampleID;" |
6753 | 4.08k | " in vec2 gl_SamplePosition;" |
6754 | 4.08k | " out int gl_SampleMask[];" |
6755 | 4.08k | ); |
6756 | | |
6757 | 4.08k | if (spvVersion.spv == 0) { |
6758 | 0 | stageBuiltins[EShLangFragment].append( |
6759 | 0 | "uniform int gl_NumSamples;" |
6760 | 0 | ); |
6761 | 0 | } |
6762 | 4.08k | } |
6763 | | |
6764 | 4.08k | if (version >= 150) |
6765 | 1.76k | stageBuiltins[EShLangFragment].append( |
6766 | 1.76k | "flat in int gl_SampleMaskIn[];" |
6767 | 1.76k | ); |
6768 | | |
6769 | 4.08k | if (version >= 430) |
6770 | 1.22k | stageBuiltins[EShLangFragment].append( |
6771 | 1.22k | "flat in int gl_Layer;" |
6772 | 1.22k | "flat in int gl_ViewportIndex;" |
6773 | 1.22k | ); |
6774 | | |
6775 | 4.08k | if (version >= 450) |
6776 | 883 | stageBuiltins[EShLangFragment].append( |
6777 | 883 | "in float gl_CullDistance[];" |
6778 | 883 | "bool gl_HelperInvocation;" // needs qualifier fixed later |
6779 | 883 | ); |
6780 | | |
6781 | 4.08k | if (version >= 450) |
6782 | 883 | stageBuiltins[EShLangFragment].append( // GL_EXT_fragment_invocation_density |
6783 | 883 | "flat in ivec2 gl_FragSizeEXT;" |
6784 | 883 | "flat in int gl_FragInvocationCountEXT;" |
6785 | 883 | ); |
6786 | | |
6787 | 4.08k | if (version >= 450) |
6788 | 883 | stageBuiltins[EShLangFragment].append( |
6789 | 883 | "in vec2 gl_BaryCoordNoPerspAMD;" |
6790 | 883 | "in vec2 gl_BaryCoordNoPerspCentroidAMD;" |
6791 | 883 | "in vec2 gl_BaryCoordNoPerspSampleAMD;" |
6792 | 883 | "in vec2 gl_BaryCoordSmoothAMD;" |
6793 | 883 | "in vec2 gl_BaryCoordSmoothCentroidAMD;" |
6794 | 883 | "in vec2 gl_BaryCoordSmoothSampleAMD;" |
6795 | 883 | "in vec3 gl_BaryCoordPullModelAMD;" |
6796 | 883 | ); |
6797 | | |
6798 | 4.08k | if (version >= 430) |
6799 | 1.22k | stageBuiltins[EShLangFragment].append( |
6800 | 1.22k | "in bool gl_FragFullyCoveredNV;" |
6801 | 1.22k | ); |
6802 | 4.08k | if (version >= 450) |
6803 | 883 | stageBuiltins[EShLangFragment].append( |
6804 | 883 | "flat in ivec2 gl_FragmentSizeNV;" // GL_NV_shading_rate_image |
6805 | 883 | "flat in int gl_InvocationsPerPixelNV;" |
6806 | 883 | "in vec3 gl_BaryCoordNV;" // GL_NV_fragment_shader_barycentric |
6807 | 883 | "in vec3 gl_BaryCoordNoPerspNV;" |
6808 | 883 | "in vec3 gl_BaryCoordEXT;" // GL_EXT_fragment_shader_barycentric |
6809 | 883 | "in vec3 gl_BaryCoordNoPerspEXT;" |
6810 | 883 | ); |
6811 | | |
6812 | 4.08k | if (version >= 450) |
6813 | 883 | stageBuiltins[EShLangFragment].append( |
6814 | 883 | "flat in int gl_ShadingRateEXT;" // GL_EXT_fragment_shading_rate |
6815 | 883 | ); |
6816 | | |
6817 | 4.08k | } else { |
6818 | | // ES profile |
6819 | | |
6820 | 259 | if (version == 100) { |
6821 | 0 | stageBuiltins[EShLangFragment].append( |
6822 | 0 | "mediump vec4 gl_FragCoord;" // needs qualifier fixed later |
6823 | 0 | " bool gl_FrontFacing;" // needs qualifier fixed later |
6824 | 0 | "mediump vec4 gl_FragColor;" // needs qualifier fixed later |
6825 | 0 | "mediump vec2 gl_PointCoord;" // needs qualifier fixed later |
6826 | 0 | ); |
6827 | 0 | } |
6828 | 259 | if (version >= 300) { |
6829 | 259 | stageBuiltins[EShLangFragment].append( |
6830 | 259 | "highp vec4 gl_FragCoord;" // needs qualifier fixed later |
6831 | 259 | " bool gl_FrontFacing;" // needs qualifier fixed later |
6832 | 259 | "mediump vec2 gl_PointCoord;" // needs qualifier fixed later |
6833 | 259 | "highp float gl_FragDepth;" // needs qualifier fixed later |
6834 | 259 | ); |
6835 | 259 | } |
6836 | 259 | if (version >= 310) { |
6837 | 259 | stageBuiltins[EShLangFragment].append( |
6838 | 259 | "bool gl_HelperInvocation;" // needs qualifier fixed later |
6839 | 259 | "flat in highp int gl_PrimitiveID;" // needs qualifier fixed later |
6840 | 259 | "flat in highp int gl_Layer;" // needs qualifier fixed later |
6841 | 259 | ); |
6842 | | |
6843 | 259 | stageBuiltins[EShLangFragment].append( // GL_OES_sample_variables |
6844 | 259 | "flat in lowp int gl_SampleID;" |
6845 | 259 | " in mediump vec2 gl_SamplePosition;" |
6846 | 259 | "flat in highp int gl_SampleMaskIn[];" |
6847 | 259 | " out highp int gl_SampleMask[];" |
6848 | 259 | ); |
6849 | 259 | if (spvVersion.spv == 0) |
6850 | 0 | stageBuiltins[EShLangFragment].append( // GL_OES_sample_variables |
6851 | 0 | "uniform lowp int gl_NumSamples;" |
6852 | 0 | ); |
6853 | 259 | } |
6854 | 259 | stageBuiltins[EShLangFragment].append( |
6855 | 259 | "highp float gl_FragDepthEXT;" // GL_EXT_frag_depth |
6856 | 259 | ); |
6857 | | |
6858 | 259 | if (version >= 310) |
6859 | 259 | stageBuiltins[EShLangFragment].append( // GL_EXT_fragment_invocation_density |
6860 | 259 | "flat in ivec2 gl_FragSizeEXT;" |
6861 | 259 | "flat in int gl_FragInvocationCountEXT;" |
6862 | 259 | ); |
6863 | 259 | if (version >= 320) |
6864 | 44 | stageBuiltins[EShLangFragment].append( // GL_NV_shading_rate_image |
6865 | 44 | "flat in ivec2 gl_FragmentSizeNV;" |
6866 | 44 | "flat in int gl_InvocationsPerPixelNV;" |
6867 | 44 | ); |
6868 | 259 | if (version >= 320) |
6869 | 44 | stageBuiltins[EShLangFragment].append( |
6870 | 44 | "in vec3 gl_BaryCoordNV;" |
6871 | 44 | "in vec3 gl_BaryCoordNoPerspNV;" |
6872 | 44 | "in vec3 gl_BaryCoordEXT;" |
6873 | 44 | "in vec3 gl_BaryCoordNoPerspEXT;" |
6874 | 44 | ); |
6875 | 259 | if (version >= 310) |
6876 | 259 | stageBuiltins[EShLangFragment].append( |
6877 | 259 | "flat in highp int gl_ShadingRateEXT;" // GL_EXT_fragment_shading_rate |
6878 | 259 | ); |
6879 | 259 | } |
6880 | | |
6881 | 4.34k | stageBuiltins[EShLangFragment].append("\n"); |
6882 | | |
6883 | 4.34k | if (version >= 130) |
6884 | 4.34k | add2ndGenerationSamplingImaging(version, profile, spvVersion); |
6885 | | |
6886 | 4.34k | if ((profile != EEsProfile && version >= 140) || |
6887 | 4.34k | (profile == EEsProfile && version >= 310)) { |
6888 | 4.34k | stageBuiltins[EShLangFragment].append( |
6889 | 4.34k | "flat in highp int gl_DeviceIndex;" // GL_EXT_device_group |
6890 | 4.34k | "flat in highp int gl_ViewIndex;" // GL_EXT_multiview |
6891 | 4.34k | "\n"); |
6892 | 4.34k | } |
6893 | | |
6894 | 4.34k | if (version >= 300 /* both ES and non-ES */) { |
6895 | 1.84k | stageBuiltins[EShLangFragment].append( |
6896 | 1.84k | "flat in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2 |
6897 | 1.84k | "\n"); |
6898 | 1.84k | } |
6899 | | |
6900 | | // GL_QCOM_tile_shading |
6901 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
6902 | 4.08k | (profile != EEsProfile && version >= 460)) { |
6903 | 367 | stageBuiltins[EShLangFragment].append( |
6904 | 367 | "flat in highp uvec2 gl_TileOffsetQCOM;" // GL_QCOM_tile_shading |
6905 | 367 | "flat in highp uvec3 gl_TileDimensionQCOM;" // GL_QCOM_tile_shading |
6906 | 367 | "flat in highp uvec2 gl_TileApronSizeQCOM;" // GL_QCOM_tile_shading |
6907 | 367 | "\n"); |
6908 | 367 | } |
6909 | | |
6910 | | // GL_ARB_shader_ballot |
6911 | 4.34k | if (profile != EEsProfile && version >= 450) { |
6912 | 883 | const char* ballotDecls = |
6913 | 883 | "uniform uint gl_SubGroupSizeARB;" |
6914 | 883 | "in uint gl_SubGroupInvocationARB;" |
6915 | 883 | "in uint64_t gl_SubGroupEqMaskARB;" |
6916 | 883 | "in uint64_t gl_SubGroupGeMaskARB;" |
6917 | 883 | "in uint64_t gl_SubGroupGtMaskARB;" |
6918 | 883 | "in uint64_t gl_SubGroupLeMaskARB;" |
6919 | 883 | "in uint64_t gl_SubGroupLtMaskARB;" |
6920 | 883 | "\n"; |
6921 | 883 | const char* rtBallotDecls = |
6922 | 883 | "uniform volatile uint gl_SubGroupSizeARB;" |
6923 | 883 | "in volatile uint gl_SubGroupInvocationARB;" |
6924 | 883 | "in volatile uint64_t gl_SubGroupEqMaskARB;" |
6925 | 883 | "in volatile uint64_t gl_SubGroupGeMaskARB;" |
6926 | 883 | "in volatile uint64_t gl_SubGroupGtMaskARB;" |
6927 | 883 | "in volatile uint64_t gl_SubGroupLeMaskARB;" |
6928 | 883 | "in volatile uint64_t gl_SubGroupLtMaskARB;" |
6929 | 883 | "\n"; |
6930 | 883 | const char* fragmentBallotDecls = |
6931 | 883 | "uniform uint gl_SubGroupSizeARB;" |
6932 | 883 | "flat in uint gl_SubGroupInvocationARB;" |
6933 | 883 | "flat in uint64_t gl_SubGroupEqMaskARB;" |
6934 | 883 | "flat in uint64_t gl_SubGroupGeMaskARB;" |
6935 | 883 | "flat in uint64_t gl_SubGroupGtMaskARB;" |
6936 | 883 | "flat in uint64_t gl_SubGroupLeMaskARB;" |
6937 | 883 | "flat in uint64_t gl_SubGroupLtMaskARB;" |
6938 | 883 | "\n"; |
6939 | 883 | stageBuiltins[EShLangVertex] .append(ballotDecls); |
6940 | 883 | stageBuiltins[EShLangTessControl] .append(ballotDecls); |
6941 | 883 | stageBuiltins[EShLangTessEvaluation].append(ballotDecls); |
6942 | 883 | stageBuiltins[EShLangGeometry] .append(ballotDecls); |
6943 | 883 | stageBuiltins[EShLangCompute] .append(ballotDecls); |
6944 | 883 | stageBuiltins[EShLangFragment] .append(fragmentBallotDecls); |
6945 | 883 | stageBuiltins[EShLangMesh] .append(ballotDecls); |
6946 | 883 | stageBuiltins[EShLangTask] .append(ballotDecls); |
6947 | 883 | stageBuiltins[EShLangRayGen] .append(rtBallotDecls); |
6948 | 883 | stageBuiltins[EShLangIntersect] .append(rtBallotDecls); |
6949 | | // No volatile qualifier on these builtins in any-hit |
6950 | 883 | stageBuiltins[EShLangAnyHit] .append(ballotDecls); |
6951 | 883 | stageBuiltins[EShLangClosestHit] .append(rtBallotDecls); |
6952 | 883 | stageBuiltins[EShLangMiss] .append(rtBallotDecls); |
6953 | 883 | stageBuiltins[EShLangCallable] .append(rtBallotDecls); |
6954 | 883 | } |
6955 | | |
6956 | | // GL_KHR_shader_subgroup |
6957 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
6958 | 4.34k | (profile != EEsProfile && version >= 140)) { |
6959 | 4.34k | const char* subgroupDecls = |
6960 | 4.34k | "in mediump uint gl_SubgroupSize;" |
6961 | 4.34k | "in mediump uint gl_SubgroupInvocationID;" |
6962 | 4.34k | "in highp uvec4 gl_SubgroupEqMask;" |
6963 | 4.34k | "in highp uvec4 gl_SubgroupGeMask;" |
6964 | 4.34k | "in highp uvec4 gl_SubgroupGtMask;" |
6965 | 4.34k | "in highp uvec4 gl_SubgroupLeMask;" |
6966 | 4.34k | "in highp uvec4 gl_SubgroupLtMask;" |
6967 | | // GL_NV_shader_sm_builtins |
6968 | 4.34k | "in highp uint gl_WarpsPerSMNV;" |
6969 | 4.34k | "in highp uint gl_SMCountNV;" |
6970 | 4.34k | "in highp uint gl_WarpIDNV;" |
6971 | 4.34k | "in highp uint gl_SMIDNV;" |
6972 | | // GL_ARM_shader_core_builtins |
6973 | 4.34k | "in highp uint gl_CoreIDARM;" |
6974 | 4.34k | "in highp uint gl_CoreCountARM;" |
6975 | 4.34k | "in highp uint gl_CoreMaxIDARM;" |
6976 | 4.34k | "in highp uint gl_WarpIDARM;" |
6977 | 4.34k | "in highp uint gl_WarpMaxIDARM;" |
6978 | 4.34k | "\n"; |
6979 | 4.34k | const char* fragmentSubgroupDecls = |
6980 | 4.34k | "flat in mediump uint gl_SubgroupSize;" |
6981 | 4.34k | "flat in mediump uint gl_SubgroupInvocationID;" |
6982 | 4.34k | "flat in highp uvec4 gl_SubgroupEqMask;" |
6983 | 4.34k | "flat in highp uvec4 gl_SubgroupGeMask;" |
6984 | 4.34k | "flat in highp uvec4 gl_SubgroupGtMask;" |
6985 | 4.34k | "flat in highp uvec4 gl_SubgroupLeMask;" |
6986 | 4.34k | "flat in highp uvec4 gl_SubgroupLtMask;" |
6987 | | // GL_NV_shader_sm_builtins |
6988 | 4.34k | "flat in highp uint gl_WarpsPerSMNV;" |
6989 | 4.34k | "flat in highp uint gl_SMCountNV;" |
6990 | 4.34k | "flat in highp uint gl_WarpIDNV;" |
6991 | 4.34k | "flat in highp uint gl_SMIDNV;" |
6992 | | // GL_ARM_shader_core_builtins |
6993 | 4.34k | "flat in highp uint gl_CoreIDARM;" |
6994 | 4.34k | "flat in highp uint gl_CoreCountARM;" |
6995 | 4.34k | "flat in highp uint gl_CoreMaxIDARM;" |
6996 | 4.34k | "flat in highp uint gl_WarpIDARM;" |
6997 | 4.34k | "flat in highp uint gl_WarpMaxIDARM;" |
6998 | 4.34k | "\n"; |
6999 | 4.34k | const char* computeSubgroupDecls = |
7000 | 4.34k | "in highp uint gl_NumSubgroups;" |
7001 | 4.34k | "in highp uint gl_SubgroupID;" |
7002 | 4.34k | "\n"; |
7003 | | // These builtins are volatile for RT stages |
7004 | 4.34k | const char* rtSubgroupDecls = |
7005 | 4.34k | "in mediump volatile uint gl_SubgroupSize;" |
7006 | 4.34k | "in mediump volatile uint gl_SubgroupInvocationID;" |
7007 | 4.34k | "in highp volatile uvec4 gl_SubgroupEqMask;" |
7008 | 4.34k | "in highp volatile uvec4 gl_SubgroupGeMask;" |
7009 | 4.34k | "in highp volatile uvec4 gl_SubgroupGtMask;" |
7010 | 4.34k | "in highp volatile uvec4 gl_SubgroupLeMask;" |
7011 | 4.34k | "in highp volatile uvec4 gl_SubgroupLtMask;" |
7012 | | // GL_NV_shader_sm_builtins |
7013 | 4.34k | "in highp uint gl_WarpsPerSMNV;" |
7014 | 4.34k | "in highp uint gl_SMCountNV;" |
7015 | 4.34k | "in highp volatile uint gl_WarpIDNV;" |
7016 | 4.34k | "in highp volatile uint gl_SMIDNV;" |
7017 | | // GL_ARM_shader_core_builtins |
7018 | 4.34k | "in highp uint gl_CoreIDARM;" |
7019 | 4.34k | "in highp uint gl_CoreCountARM;" |
7020 | 4.34k | "in highp uint gl_CoreMaxIDARM;" |
7021 | 4.34k | "in highp uint gl_WarpIDARM;" |
7022 | 4.34k | "in highp uint gl_WarpMaxIDARM;" |
7023 | 4.34k | "\n"; |
7024 | | |
7025 | 4.34k | stageBuiltins[EShLangVertex] .append(subgroupDecls); |
7026 | 4.34k | stageBuiltins[EShLangTessControl] .append(subgroupDecls); |
7027 | 4.34k | stageBuiltins[EShLangTessEvaluation].append(subgroupDecls); |
7028 | 4.34k | stageBuiltins[EShLangGeometry] .append(subgroupDecls); |
7029 | 4.34k | stageBuiltins[EShLangCompute] .append(subgroupDecls); |
7030 | 4.34k | stageBuiltins[EShLangCompute] .append(computeSubgroupDecls); |
7031 | 4.34k | stageBuiltins[EShLangFragment] .append(fragmentSubgroupDecls); |
7032 | 4.34k | stageBuiltins[EShLangMesh] .append(subgroupDecls); |
7033 | 4.34k | stageBuiltins[EShLangMesh] .append(computeSubgroupDecls); |
7034 | 4.34k | stageBuiltins[EShLangTask] .append(subgroupDecls); |
7035 | 4.34k | stageBuiltins[EShLangTask] .append(computeSubgroupDecls); |
7036 | 4.34k | stageBuiltins[EShLangRayGen] .append(rtSubgroupDecls); |
7037 | 4.34k | stageBuiltins[EShLangIntersect] .append(rtSubgroupDecls); |
7038 | | // No volatile qualifier on these builtins in any-hit |
7039 | 4.34k | stageBuiltins[EShLangAnyHit] .append(subgroupDecls); |
7040 | 4.34k | stageBuiltins[EShLangClosestHit] .append(rtSubgroupDecls); |
7041 | 4.34k | stageBuiltins[EShLangMiss] .append(rtSubgroupDecls); |
7042 | 4.34k | stageBuiltins[EShLangCallable] .append(rtSubgroupDecls); |
7043 | 4.34k | } |
7044 | | |
7045 | | // GL_NV_ray_tracing/GL_EXT_ray_tracing |
7046 | 4.34k | if (profile != EEsProfile && version >= 460) { |
7047 | | |
7048 | 108 | const char *constRayFlags = |
7049 | 108 | "const uint gl_RayFlagsNoneNV = 0U;" |
7050 | 108 | "const uint gl_RayFlagsNoneEXT = 0U;" |
7051 | 108 | "const uint gl_RayFlagsOpaqueNV = 1U;" |
7052 | 108 | "const uint gl_RayFlagsOpaqueEXT = 1U;" |
7053 | 108 | "const uint gl_RayFlagsNoOpaqueNV = 2U;" |
7054 | 108 | "const uint gl_RayFlagsNoOpaqueEXT = 2U;" |
7055 | 108 | "const uint gl_RayFlagsTerminateOnFirstHitNV = 4U;" |
7056 | 108 | "const uint gl_RayFlagsTerminateOnFirstHitEXT = 4U;" |
7057 | 108 | "const uint gl_RayFlagsSkipClosestHitShaderNV = 8U;" |
7058 | 108 | "const uint gl_RayFlagsSkipClosestHitShaderEXT = 8U;" |
7059 | 108 | "const uint gl_RayFlagsCullBackFacingTrianglesNV = 16U;" |
7060 | 108 | "const uint gl_RayFlagsCullBackFacingTrianglesEXT = 16U;" |
7061 | 108 | "const uint gl_RayFlagsCullFrontFacingTrianglesNV = 32U;" |
7062 | 108 | "const uint gl_RayFlagsCullFrontFacingTrianglesEXT = 32U;" |
7063 | 108 | "const uint gl_RayFlagsCullOpaqueNV = 64U;" |
7064 | 108 | "const uint gl_RayFlagsCullOpaqueEXT = 64U;" |
7065 | 108 | "const uint gl_RayFlagsCullNoOpaqueNV = 128U;" |
7066 | 108 | "const uint gl_RayFlagsCullNoOpaqueEXT = 128U;" |
7067 | 108 | "const uint gl_RayFlagsSkipTrianglesEXT = 256U;" |
7068 | 108 | "const uint gl_RayFlagsSkipBuiltinPrimitivesNV = 256U;" |
7069 | 108 | "const uint gl_RayFlagsSkipAABBEXT = 512U;" |
7070 | 108 | "const uint gl_RayFlagsForceOpacityMicromap2StateEXT = 1024U;" |
7071 | 108 | "const uint gl_HitKindFrontFacingTriangleEXT = 254U;" |
7072 | 108 | "const uint gl_HitKindBackFacingTriangleEXT = 255U;" |
7073 | 108 | "in uint gl_HitKindFrontFacingMicroTriangleNV;" |
7074 | 108 | "in uint gl_HitKindBackFacingMicroTriangleNV;" |
7075 | 108 | "const int gl_ClusterIDNoneNV = -1;" |
7076 | 108 | "\n"; |
7077 | | |
7078 | 108 | const char *constRayQueryIntersection = |
7079 | 108 | "const uint gl_RayQueryCandidateIntersectionEXT = 0U;" |
7080 | 108 | "const uint gl_RayQueryCommittedIntersectionEXT = 1U;" |
7081 | 108 | "const uint gl_RayQueryCommittedIntersectionNoneEXT = 0U;" |
7082 | 108 | "const uint gl_RayQueryCommittedIntersectionTriangleEXT = 1U;" |
7083 | 108 | "const uint gl_RayQueryCommittedIntersectionGeneratedEXT = 2U;" |
7084 | 108 | "const uint gl_RayQueryCandidateIntersectionTriangleEXT = 0U;" |
7085 | 108 | "const uint gl_RayQueryCandidateIntersectionAABBEXT = 1U;" |
7086 | 108 | "\n"; |
7087 | | |
7088 | 108 | const char *rayGenDecls = |
7089 | 108 | "in uvec3 gl_LaunchIDNV;" |
7090 | 108 | "in uvec3 gl_LaunchIDEXT;" |
7091 | 108 | "in uvec3 gl_LaunchSizeNV;" |
7092 | 108 | "in uvec3 gl_LaunchSizeEXT;" |
7093 | 108 | "\n"; |
7094 | 108 | const char *intersectDecls = |
7095 | 108 | "in uvec3 gl_LaunchIDNV;" |
7096 | 108 | "in uvec3 gl_LaunchIDEXT;" |
7097 | 108 | "in uvec3 gl_LaunchSizeNV;" |
7098 | 108 | "in uvec3 gl_LaunchSizeEXT;" |
7099 | 108 | "in int gl_PrimitiveID;" |
7100 | 108 | "in int gl_InstanceID;" |
7101 | 108 | "in int gl_InstanceCustomIndexNV;" |
7102 | 108 | "in int gl_InstanceCustomIndexEXT;" |
7103 | 108 | "in int gl_GeometryIndexEXT;" |
7104 | 108 | "in vec3 gl_WorldRayOriginNV;" |
7105 | 108 | "in vec3 gl_WorldRayOriginEXT;" |
7106 | 108 | "in vec3 gl_WorldRayDirectionNV;" |
7107 | 108 | "in vec3 gl_WorldRayDirectionEXT;" |
7108 | 108 | "in vec3 gl_ObjectRayOriginNV;" |
7109 | 108 | "in vec3 gl_ObjectRayOriginEXT;" |
7110 | 108 | "in vec3 gl_ObjectRayDirectionNV;" |
7111 | 108 | "in vec3 gl_ObjectRayDirectionEXT;" |
7112 | 108 | "in float gl_RayTminNV;" |
7113 | 108 | "in float gl_RayTminEXT;" |
7114 | 108 | "in float gl_RayTmaxNV;" |
7115 | 108 | "in volatile float gl_RayTmaxEXT;" |
7116 | 108 | "in mat4x3 gl_ObjectToWorldNV;" |
7117 | 108 | "in mat4x3 gl_ObjectToWorldEXT;" |
7118 | 108 | "in mat3x4 gl_ObjectToWorld3x4EXT;" |
7119 | 108 | "in mat4x3 gl_WorldToObjectNV;" |
7120 | 108 | "in mat4x3 gl_WorldToObjectEXT;" |
7121 | 108 | "in mat3x4 gl_WorldToObject3x4EXT;" |
7122 | 108 | "in uint gl_IncomingRayFlagsNV;" |
7123 | 108 | "in uint gl_IncomingRayFlagsEXT;" |
7124 | 108 | "in float gl_CurrentRayTimeNV;" |
7125 | 108 | "in uint gl_CullMaskEXT;" |
7126 | 108 | "\n"; |
7127 | 108 | const char *hitDecls = |
7128 | 108 | "in uvec3 gl_LaunchIDNV;" |
7129 | 108 | "in uvec3 gl_LaunchIDEXT;" |
7130 | 108 | "in uvec3 gl_LaunchSizeNV;" |
7131 | 108 | "in uvec3 gl_LaunchSizeEXT;" |
7132 | 108 | "in int gl_PrimitiveID;" |
7133 | 108 | "in int gl_InstanceID;" |
7134 | 108 | "in int gl_InstanceCustomIndexNV;" |
7135 | 108 | "in int gl_InstanceCustomIndexEXT;" |
7136 | 108 | "in int gl_GeometryIndexEXT;" |
7137 | 108 | "in vec3 gl_WorldRayOriginNV;" |
7138 | 108 | "in vec3 gl_WorldRayOriginEXT;" |
7139 | 108 | "in vec3 gl_WorldRayDirectionNV;" |
7140 | 108 | "in vec3 gl_WorldRayDirectionEXT;" |
7141 | 108 | "in vec3 gl_ObjectRayOriginNV;" |
7142 | 108 | "in vec3 gl_ObjectRayOriginEXT;" |
7143 | 108 | "in vec3 gl_ObjectRayDirectionNV;" |
7144 | 108 | "in vec3 gl_ObjectRayDirectionEXT;" |
7145 | 108 | "in float gl_RayTminNV;" |
7146 | 108 | "in float gl_RayTminEXT;" |
7147 | 108 | "in float gl_RayTmaxNV;" |
7148 | 108 | "in float gl_RayTmaxEXT;" |
7149 | 108 | "in float gl_HitTNV;" |
7150 | 108 | "in float gl_HitTEXT;" |
7151 | 108 | "in uint gl_HitKindNV;" |
7152 | 108 | "in uint gl_HitKindEXT;" |
7153 | 108 | "in mat4x3 gl_ObjectToWorldNV;" |
7154 | 108 | "in mat4x3 gl_ObjectToWorldEXT;" |
7155 | 108 | "in mat3x4 gl_ObjectToWorld3x4EXT;" |
7156 | 108 | "in mat4x3 gl_WorldToObjectNV;" |
7157 | 108 | "in mat4x3 gl_WorldToObjectEXT;" |
7158 | 108 | "in mat3x4 gl_WorldToObject3x4EXT;" |
7159 | 108 | "in uint gl_IncomingRayFlagsNV;" |
7160 | 108 | "in uint gl_IncomingRayFlagsEXT;" |
7161 | 108 | "in float gl_CurrentRayTimeNV;" |
7162 | 108 | "in uint gl_CullMaskEXT;" |
7163 | 108 | "in vec3 gl_HitTriangleVertexPositionsEXT[3];" |
7164 | 108 | "in vec3 gl_HitMicroTriangleVertexPositionsNV[3];" |
7165 | 108 | "in vec2 gl_HitMicroTriangleVertexBarycentricsNV[3];" |
7166 | 108 | "in int gl_ClusterIDNV;" |
7167 | 108 | "in bool gl_HitIsSphereNV;" |
7168 | 108 | "in bool gl_HitIsLSSNV;" |
7169 | 108 | "in vec3 gl_HitSpherePositionNV;" |
7170 | 108 | "in float gl_HitSphereRadiusNV;" |
7171 | 108 | "in vec3 gl_HitLSSPositionsNV[2];" |
7172 | 108 | "in float gl_HitLSSRadiiNV[2];" |
7173 | 108 | "\n"; |
7174 | | |
7175 | 108 | const char *missDecls = |
7176 | 108 | "in uvec3 gl_LaunchIDNV;" |
7177 | 108 | "in uvec3 gl_LaunchIDEXT;" |
7178 | 108 | "in uvec3 gl_LaunchSizeNV;" |
7179 | 108 | "in uvec3 gl_LaunchSizeEXT;" |
7180 | 108 | "in vec3 gl_WorldRayOriginNV;" |
7181 | 108 | "in vec3 gl_WorldRayOriginEXT;" |
7182 | 108 | "in vec3 gl_WorldRayDirectionNV;" |
7183 | 108 | "in vec3 gl_WorldRayDirectionEXT;" |
7184 | 108 | "in vec3 gl_ObjectRayOriginNV;" |
7185 | 108 | "in vec3 gl_ObjectRayDirectionNV;" |
7186 | 108 | "in float gl_RayTminNV;" |
7187 | 108 | "in float gl_RayTminEXT;" |
7188 | 108 | "in float gl_RayTmaxNV;" |
7189 | 108 | "in float gl_RayTmaxEXT;" |
7190 | 108 | "in uint gl_IncomingRayFlagsNV;" |
7191 | 108 | "in uint gl_IncomingRayFlagsEXT;" |
7192 | 108 | "in float gl_CurrentRayTimeNV;" |
7193 | 108 | "in uint gl_CullMaskEXT;" |
7194 | 108 | "\n"; |
7195 | | |
7196 | 108 | const char *callableDecls = |
7197 | 108 | "in uvec3 gl_LaunchIDNV;" |
7198 | 108 | "in uvec3 gl_LaunchIDEXT;" |
7199 | 108 | "in uvec3 gl_LaunchSizeNV;" |
7200 | 108 | "in uvec3 gl_LaunchSizeEXT;" |
7201 | 108 | "\n"; |
7202 | | |
7203 | | |
7204 | 108 | commonBuiltins.append(constRayQueryIntersection); |
7205 | 108 | commonBuiltins.append(constRayFlags); |
7206 | | |
7207 | 108 | stageBuiltins[EShLangRayGen].append(rayGenDecls); |
7208 | 108 | stageBuiltins[EShLangIntersect].append(intersectDecls); |
7209 | 108 | stageBuiltins[EShLangAnyHit].append(hitDecls); |
7210 | 108 | stageBuiltins[EShLangClosestHit].append(hitDecls); |
7211 | 108 | stageBuiltins[EShLangMiss].append(missDecls); |
7212 | 108 | stageBuiltins[EShLangCallable].append(callableDecls); |
7213 | | |
7214 | 108 | } |
7215 | | |
7216 | 4.34k | if ((profile != EEsProfile && version >= 140)) { |
7217 | 4.08k | const char *deviceIndex = |
7218 | 4.08k | "in highp int gl_DeviceIndex;" // GL_EXT_device_group |
7219 | 4.08k | "\n"; |
7220 | | |
7221 | 4.08k | stageBuiltins[EShLangRayGen].append(deviceIndex); |
7222 | 4.08k | stageBuiltins[EShLangIntersect].append(deviceIndex); |
7223 | 4.08k | stageBuiltins[EShLangAnyHit].append(deviceIndex); |
7224 | 4.08k | stageBuiltins[EShLangClosestHit].append(deviceIndex); |
7225 | 4.08k | stageBuiltins[EShLangMiss].append(deviceIndex); |
7226 | 4.08k | } |
7227 | | |
7228 | 4.34k | if ((profile != EEsProfile && version >= 420) || |
7229 | 3.09k | (profile == EEsProfile && version >= 310)) { |
7230 | 1.50k | commonBuiltins.append("const int gl_ScopeDevice = 1;\n"); |
7231 | 1.50k | commonBuiltins.append("const int gl_ScopeWorkgroup = 2;\n"); |
7232 | 1.50k | commonBuiltins.append("const int gl_ScopeSubgroup = 3;\n"); |
7233 | 1.50k | commonBuiltins.append("const int gl_ScopeInvocation = 4;\n"); |
7234 | 1.50k | commonBuiltins.append("const int gl_ScopeQueueFamily = 5;\n"); |
7235 | 1.50k | commonBuiltins.append("const int gl_ScopeShaderCallEXT = 6;\n"); |
7236 | | |
7237 | 1.50k | commonBuiltins.append("const int gl_SemanticsRelaxed = 0x0;\n"); |
7238 | 1.50k | commonBuiltins.append("const int gl_SemanticsAcquire = 0x2;\n"); |
7239 | 1.50k | commonBuiltins.append("const int gl_SemanticsRelease = 0x4;\n"); |
7240 | 1.50k | commonBuiltins.append("const int gl_SemanticsAcquireRelease = 0x8;\n"); |
7241 | 1.50k | commonBuiltins.append("const int gl_SemanticsMakeAvailable = 0x2000;\n"); |
7242 | 1.50k | commonBuiltins.append("const int gl_SemanticsMakeVisible = 0x4000;\n"); |
7243 | 1.50k | commonBuiltins.append("const int gl_SemanticsVolatile = 0x8000;\n"); |
7244 | | |
7245 | 1.50k | commonBuiltins.append("const int gl_StorageSemanticsNone = 0x0;\n"); |
7246 | 1.50k | commonBuiltins.append("const int gl_StorageSemanticsBuffer = 0x40;\n"); |
7247 | 1.50k | commonBuiltins.append("const int gl_StorageSemanticsShared = 0x100;\n"); |
7248 | 1.50k | commonBuiltins.append("const int gl_StorageSemanticsImage = 0x800;\n"); |
7249 | 1.50k | commonBuiltins.append("const int gl_StorageSemanticsOutput = 0x1000;\n"); |
7250 | 1.50k | } |
7251 | | |
7252 | | // Adding these to common built-ins triggers an assert due to a memory corruption in related code when testing |
7253 | | // So instead add to each stage individually, avoiding the GLSLang bug |
7254 | 4.34k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { |
7255 | 17.1k | for (int stage=EShLangVertex; stage<EShLangCount; stage++) |
7256 | 15.9k | { |
7257 | 15.9k | stageBuiltins[static_cast<EShLanguage>(stage)].append("const highp int gl_ShadingRateFlag2VerticalPixelsEXT = 1;\n"); |
7258 | 15.9k | stageBuiltins[static_cast<EShLanguage>(stage)].append("const highp int gl_ShadingRateFlag4VerticalPixelsEXT = 2;\n"); |
7259 | 15.9k | stageBuiltins[static_cast<EShLanguage>(stage)].append("const highp int gl_ShadingRateFlag2HorizontalPixelsEXT = 4;\n"); |
7260 | 15.9k | stageBuiltins[static_cast<EShLanguage>(stage)].append("const highp int gl_ShadingRateFlag4HorizontalPixelsEXT = 8;\n"); |
7261 | 15.9k | } |
7262 | 1.14k | } |
7263 | | |
7264 | | // GL_EXT_shader_image_int64 |
7265 | 4.34k | if ((profile != EEsProfile && version >= 420) || |
7266 | 3.09k | (profile == EEsProfile && version >= 310)) { |
7267 | | |
7268 | 1.50k | const TBasicType bTypes[] = { EbtInt64, EbtUint64 }; |
7269 | 4.50k | for (int ms = 0; ms <= 1; ++ms) { // loop over "bool" multisample or not |
7270 | 9.01k | for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not |
7271 | 42.0k | for (int dim = Esd1D; dim < EsdSubpass; ++dim) { // 1D, ..., buffer |
7272 | 36.0k | if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) |
7273 | 2.07k | continue; |
7274 | | |
7275 | 33.9k | if ((dim == Esd3D || dim == EsdRect || dim == EsdBuffer) && arrayed) |
7276 | 8.49k | continue; |
7277 | | |
7278 | 25.4k | if (dim != Esd2D && ms) |
7279 | 9.73k | continue; |
7280 | | |
7281 | | // Loop over the bTypes |
7282 | 47.2k | for (size_t bType = 0; bType < sizeof(bTypes)/sizeof(TBasicType); ++bType) { |
7283 | | // |
7284 | | // Now, make all the function prototypes for the type we just built... |
7285 | | // |
7286 | 31.4k | TSampler sampler; |
7287 | | |
7288 | 31.4k | sampler.setImage(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, |
7289 | 31.4k | false, |
7290 | 31.4k | ms ? true : false); |
7291 | | |
7292 | 31.4k | TString typeName = TString{sampler.getString()}; |
7293 | | |
7294 | 31.4k | addQueryFunctions(sampler, typeName, version, profile); |
7295 | 31.4k | addImageFunctions(sampler, typeName, version, profile); |
7296 | 31.4k | } |
7297 | 15.7k | } |
7298 | 6.00k | } |
7299 | 3.00k | } |
7300 | 1.50k | } |
7301 | | |
7302 | | // printf("%s\n", commonBuiltins.c_str()); |
7303 | | // printf("%s\n", stageBuiltins[EShLangFragment].c_str()); |
7304 | 4.34k | } |
7305 | | |
7306 | | // |
7307 | | // Helper function for initialize(), to add the second set of names for texturing, |
7308 | | // when adding context-independent built-in functions. |
7309 | | // |
7310 | | void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, const SpvVersion& spvVersion) |
7311 | 4.34k | { |
7312 | | // |
7313 | | // In this function proper, enumerate the types, then calls the next set of functions |
7314 | | // to enumerate all the uses for that type. |
7315 | | // |
7316 | | |
7317 | | // enumerate all the types |
7318 | 4.34k | const TBasicType bTypes[] = { EbtFloat, EbtInt, EbtUint, |
7319 | 4.34k | EbtFloat16 |
7320 | 4.34k | }; |
7321 | 4.34k | bool skipBuffer = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 140); |
7322 | 4.34k | bool skipCubeArrayed = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 130); |
7323 | 13.0k | for (int image = 0; image <= 1; ++image) // loop over "bool" image vs sampler |
7324 | 8.68k | { |
7325 | 26.0k | for (int shadow = 0; shadow <= 1; ++shadow) { // loop over "bool" shadow or not |
7326 | 52.0k | for (int ms = 0; ms <= 1; ++ms) // loop over "bool" multisample or not |
7327 | 34.7k | { |
7328 | 34.7k | if ((ms || image) && shadow) |
7329 | 13.0k | continue; |
7330 | 21.7k | if (ms && profile != EEsProfile && version < 140) |
7331 | 0 | continue; |
7332 | 21.7k | if (ms && image && profile == EEsProfile) |
7333 | 259 | continue; |
7334 | 21.4k | if (ms && profile == EEsProfile && version < 310) |
7335 | 0 | continue; |
7336 | | |
7337 | 64.3k | for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not |
7338 | 386k | for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, ..., buffer, subpass |
7339 | 343k | if (dim == EsdAttachmentEXT) |
7340 | 42.8k | continue; |
7341 | 300k | if (dim == EsdSubpass && spvVersion.vulkan == 0) |
7342 | 0 | continue; |
7343 | 300k | if (dim == EsdSubpass && (image || shadow || arrayed)) |
7344 | 34.2k | continue; |
7345 | 266k | if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) |
7346 | 4.14k | continue; |
7347 | 261k | if (dim == EsdSubpass && spvVersion.vulkan == 0) |
7348 | 0 | continue; |
7349 | 261k | if (dim == EsdSubpass && (image || shadow || arrayed)) |
7350 | 0 | continue; |
7351 | 261k | if ((dim == Esd1D || dim == EsdRect) && profile == EEsProfile) |
7352 | 0 | continue; |
7353 | 261k | if (dim != Esd2D && dim != EsdSubpass && ms) |
7354 | 83.1k | continue; |
7355 | 178k | if (dim == EsdBuffer && skipBuffer) |
7356 | 0 | continue; |
7357 | 178k | if (dim == EsdBuffer && (shadow || arrayed || ms)) |
7358 | 17.3k | continue; |
7359 | 161k | if (ms && arrayed && profile == EEsProfile && version < 310) |
7360 | 0 | continue; |
7361 | 161k | if (dim == Esd3D && shadow) |
7362 | 8.68k | continue; |
7363 | 152k | if (dim == EsdCube && arrayed && skipCubeArrayed) |
7364 | 0 | continue; |
7365 | 152k | if ((dim == Esd3D || dim == EsdRect) && arrayed) |
7366 | 20.9k | continue; |
7367 | | |
7368 | | // Loop over the bTypes |
7369 | 658k | for (size_t bType = 0; bType < sizeof(bTypes)/sizeof(TBasicType); ++bType) { |
7370 | 526k | if (bTypes[bType] == EbtFloat16 && (profile == EEsProfile || version < 450)) |
7371 | 104k | continue; |
7372 | 422k | if (dim == EsdRect && version < 140 && bType > 0) |
7373 | 0 | continue; |
7374 | 422k | if (shadow && (bTypes[bType] == EbtInt || bTypes[bType] == EbtUint)) |
7375 | 59.2k | continue; |
7376 | | // |
7377 | | // Now, make all the function prototypes for the type we just built... |
7378 | | // |
7379 | 363k | TSampler sampler; |
7380 | 363k | if (dim == EsdSubpass) { |
7381 | 27.8k | sampler.setSubpass(bTypes[bType], ms ? true : false); |
7382 | 335k | } else if (dim == EsdAttachmentEXT) { |
7383 | 0 | sampler.setAttachmentEXT(bTypes[bType]); |
7384 | 0 | } else |
7385 | 335k | if (image) { |
7386 | 149k | sampler.setImage(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, |
7387 | 149k | shadow ? true : false, |
7388 | 149k | ms ? true : false); |
7389 | 186k | } else { |
7390 | 186k | sampler.set(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false, |
7391 | 186k | shadow ? true : false, |
7392 | 186k | ms ? true : false); |
7393 | 186k | } |
7394 | | |
7395 | 363k | TString typeName = TString{sampler.getString()}; |
7396 | | |
7397 | 363k | if (dim == EsdSubpass) { |
7398 | 27.8k | addSubpassSampling(sampler, typeName, version, profile); |
7399 | 27.8k | continue; |
7400 | 27.8k | } |
7401 | | |
7402 | 335k | addQueryFunctions(sampler, typeName, version, profile); |
7403 | | |
7404 | 335k | if (image) |
7405 | 149k | addImageFunctions(sampler, typeName, version, profile); |
7406 | 186k | else { |
7407 | 186k | addSamplingFunctions(sampler, typeName, version, profile); |
7408 | 186k | addGatherFunctions(sampler, typeName, version, profile); |
7409 | 186k | if (spvVersion.vulkan > 0 && sampler.isCombined() && !sampler.shadow) { |
7410 | | // Base Vulkan allows texelFetch() for |
7411 | | // textureBuffer (i.e. without sampler). |
7412 | | // |
7413 | | // GL_EXT_samplerless_texture_functions |
7414 | | // allows texelFetch() and query functions |
7415 | | // (other than textureQueryLod()) for all |
7416 | | // texture types. |
7417 | 150k | sampler.setTexture(sampler.type, sampler.dim, sampler.arrayed, sampler.shadow, |
7418 | 150k | sampler.ms); |
7419 | 150k | TString textureTypeName = TString{sampler.getString()}; |
7420 | 150k | addSamplingFunctions(sampler, textureTypeName, version, profile); |
7421 | 150k | addQueryFunctions(sampler, textureTypeName, version, profile); |
7422 | 150k | } |
7423 | 186k | } |
7424 | 335k | } |
7425 | 131k | } |
7426 | 42.8k | } |
7427 | 21.4k | } |
7428 | 17.3k | } |
7429 | 8.68k | } |
7430 | | |
7431 | | // |
7432 | | // sparseTexelsResidentARB() |
7433 | | // |
7434 | 4.34k | if (profile != EEsProfile && version >= 450) { |
7435 | 883 | commonBuiltins.append("bool sparseTexelsResidentARB(int code);\n"); |
7436 | 883 | } |
7437 | 4.34k | } |
7438 | | |
7439 | | // |
7440 | | // Helper function for add2ndGenerationSamplingImaging(), |
7441 | | // when adding context-independent built-in functions. |
7442 | | // |
7443 | | // Add all the query functions for the given type. |
7444 | | // |
7445 | | void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) |
7446 | 517k | { |
7447 | | // |
7448 | | // textureSize() and imageSize() |
7449 | | // |
7450 | | |
7451 | 517k | int sizeDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0) - (sampler.dim == EsdCube ? 1 : 0); |
7452 | | |
7453 | 517k | if (sampler.isImage() && ((profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 420))) |
7454 | 93.6k | return; |
7455 | | |
7456 | 423k | if (profile == EEsProfile) |
7457 | 22.2k | commonBuiltins.append("highp "); |
7458 | 423k | if (sizeDims == 1) |
7459 | 74.5k | commonBuiltins.append("int"); |
7460 | 349k | else { |
7461 | 349k | commonBuiltins.append("ivec"); |
7462 | 349k | commonBuiltins.append(postfixes[sizeDims]); |
7463 | 349k | } |
7464 | 423k | if (sampler.isImage()) |
7465 | 86.8k | commonBuiltins.append(" imageSize(readonly writeonly volatile coherent nontemporal "); |
7466 | 337k | else |
7467 | 337k | commonBuiltins.append(" textureSize("); |
7468 | 423k | commonBuiltins.append(typeName); |
7469 | 423k | if (! sampler.isImage() && ! sampler.isRect() && ! sampler.isBuffer() && ! sampler.isMultiSample()) |
7470 | 222k | commonBuiltins.append(",int);\n"); |
7471 | 201k | else |
7472 | 201k | commonBuiltins.append(");\n"); |
7473 | | |
7474 | | // |
7475 | | // textureSamples() and imageSamples() |
7476 | | // |
7477 | | |
7478 | | // GL_ARB_shader_texture_image_samples |
7479 | | // TODO: spec issue? there are no memory qualifiers; how to query a writeonly/readonly image, etc? |
7480 | 423k | if (profile != EEsProfile && version >= 430 && sampler.isMultiSample()) { |
7481 | 32.2k | commonBuiltins.append("int "); |
7482 | 32.2k | if (sampler.isImage()) |
7483 | 13.9k | commonBuiltins.append("imageSamples(readonly writeonly volatile coherent nontemporal "); |
7484 | 18.2k | else |
7485 | 18.2k | commonBuiltins.append("textureSamples("); |
7486 | 32.2k | commonBuiltins.append(typeName); |
7487 | 32.2k | commonBuiltins.append(");\n"); |
7488 | 32.2k | } |
7489 | | |
7490 | | // |
7491 | | // textureQueryLod(), fragment stage only |
7492 | | // Also enabled with extension GL_ARB_texture_query_lod |
7493 | | // Extension GL_ARB_texture_query_lod says that textureQueryLOD() also exist at extension. |
7494 | | |
7495 | 423k | if (profile != EEsProfile && version >= 150 && sampler.isCombined() && sampler.dim != EsdRect && |
7496 | 77.8k | ! sampler.isMultiSample() && ! sampler.isBuffer()) { |
7497 | | |
7498 | 59.2k | const TString funcName[2] = {"vec2 textureQueryLod(", "vec2 textureQueryLOD("}; |
7499 | | |
7500 | 177k | for (int i = 0; i < 2; ++i){ |
7501 | 355k | for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) { |
7502 | 236k | if (f16TexAddr && sampler.type != EbtFloat16) |
7503 | 95.5k | continue; |
7504 | 141k | stageBuiltins[EShLangFragment].append(funcName[i]); |
7505 | 141k | stageBuiltins[EShLangFragment].append(typeName); |
7506 | 141k | if (dimMap[sampler.dim] == 1) |
7507 | 42.4k | if (f16TexAddr) |
7508 | 7.06k | stageBuiltins[EShLangFragment].append(", float16_t"); |
7509 | 35.3k | else |
7510 | 35.3k | stageBuiltins[EShLangFragment].append(", float"); |
7511 | 99.0k | else { |
7512 | 99.0k | if (f16TexAddr) |
7513 | 15.8k | stageBuiltins[EShLangFragment].append(", f16vec"); |
7514 | 83.1k | else |
7515 | 83.1k | stageBuiltins[EShLangFragment].append(", vec"); |
7516 | 99.0k | stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]); |
7517 | 99.0k | } |
7518 | 141k | stageBuiltins[EShLangFragment].append(");\n"); |
7519 | 141k | } |
7520 | | |
7521 | 118k | stageBuiltins[EShLangCompute].append(funcName[i]); |
7522 | 118k | stageBuiltins[EShLangCompute].append(typeName); |
7523 | 118k | if (dimMap[sampler.dim] == 1) |
7524 | 35.3k | stageBuiltins[EShLangCompute].append(", float"); |
7525 | 83.1k | else { |
7526 | 83.1k | stageBuiltins[EShLangCompute].append(", vec"); |
7527 | 83.1k | stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]); |
7528 | 83.1k | } |
7529 | 118k | stageBuiltins[EShLangCompute].append(");\n"); |
7530 | 118k | } |
7531 | 59.2k | } |
7532 | | |
7533 | | // |
7534 | | // textureQueryLevels() |
7535 | | // |
7536 | | |
7537 | 423k | if (profile != EEsProfile && version >= 430 && ! sampler.isImage() && sampler.dim != EsdRect && |
7538 | 103k | ! sampler.isMultiSample() && ! sampler.isBuffer()) { |
7539 | 76.3k | commonBuiltins.append("int textureQueryLevels("); |
7540 | 76.3k | commonBuiltins.append(typeName); |
7541 | 76.3k | commonBuiltins.append(");\n"); |
7542 | 76.3k | } |
7543 | 423k | } |
7544 | | |
7545 | | // |
7546 | | // Helper function for add2ndGenerationSamplingImaging(), |
7547 | | // when adding context-independent built-in functions. |
7548 | | // |
7549 | | // Add all the image access functions for the given type. |
7550 | | // |
7551 | | void TBuiltIns::addImageFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) |
7552 | 180k | { |
7553 | 180k | int dims = dimMap[sampler.dim]; |
7554 | | // most things with an array add a dimension, except for cubemaps |
7555 | 180k | if (sampler.arrayed && sampler.dim != EsdCube) |
7556 | 48.6k | ++dims; |
7557 | | |
7558 | 180k | TString imageParams = typeName; |
7559 | 180k | if (dims == 1) |
7560 | 32.5k | imageParams.append(", int"); |
7561 | 148k | else { |
7562 | 148k | imageParams.append(", ivec"); |
7563 | 148k | imageParams.append(postfixes[dims]); |
7564 | 148k | } |
7565 | 180k | if (sampler.isMultiSample()) |
7566 | 32.2k | imageParams.append(", int"); |
7567 | | |
7568 | 180k | if (profile == EEsProfile) |
7569 | 8.80k | commonBuiltins.append("highp "); |
7570 | 180k | commonBuiltins.append(prefixes[sampler.type]); |
7571 | 180k | commonBuiltins.append("vec4 imageLoad(readonly volatile coherent nontemporal "); |
7572 | 180k | commonBuiltins.append(imageParams); |
7573 | 180k | commonBuiltins.append(");\n"); |
7574 | | |
7575 | 180k | commonBuiltins.append("void imageStore(writeonly volatile coherent nontemporal "); |
7576 | 180k | commonBuiltins.append(imageParams); |
7577 | 180k | commonBuiltins.append(", "); |
7578 | 180k | commonBuiltins.append(prefixes[sampler.type]); |
7579 | 180k | commonBuiltins.append("vec4);\n"); |
7580 | | |
7581 | 180k | if (! sampler.is1D() && ! sampler.isBuffer() && profile != EEsProfile && version >= 450) { |
7582 | 42.3k | commonBuiltins.append("int sparseImageLoadARB(readonly volatile coherent nontemporal "); |
7583 | 42.3k | commonBuiltins.append(imageParams); |
7584 | 42.3k | commonBuiltins.append(", out "); |
7585 | 42.3k | commonBuiltins.append(prefixes[sampler.type]); |
7586 | 42.3k | commonBuiltins.append("vec4"); |
7587 | 42.3k | commonBuiltins.append(");\n"); |
7588 | 42.3k | } |
7589 | | |
7590 | 180k | if ( profile != EEsProfile || |
7591 | 180k | (profile == EEsProfile && version >= 310)) { |
7592 | 180k | if (sampler.type == EbtInt || sampler.type == EbtUint || sampler.type == EbtInt64 || sampler.type == EbtUint64 ) { |
7593 | | |
7594 | 124k | const char* dataType; |
7595 | 124k | switch (sampler.type) { |
7596 | 46.4k | case(EbtInt): dataType = "highp int"; break; |
7597 | 46.4k | case(EbtUint): dataType = "highp uint"; break; |
7598 | 15.7k | case(EbtInt64): dataType = "highp int64_t"; break; |
7599 | 15.7k | case(EbtUint64): dataType = "highp uint64_t"; break; |
7600 | 0 | default: dataType = ""; |
7601 | 124k | } |
7602 | | |
7603 | 124k | const int numBuiltins = 7; |
7604 | | |
7605 | 124k | static const char* atomicFunc[numBuiltins] = { |
7606 | 124k | " imageAtomicAdd(volatile coherent nontemporal ", |
7607 | 124k | " imageAtomicMin(volatile coherent nontemporal ", |
7608 | 124k | " imageAtomicMax(volatile coherent nontemporal ", |
7609 | 124k | " imageAtomicAnd(volatile coherent nontemporal ", |
7610 | 124k | " imageAtomicOr(volatile coherent nontemporal ", |
7611 | 124k | " imageAtomicXor(volatile coherent nontemporal ", |
7612 | 124k | " imageAtomicExchange(volatile coherent nontemporal " |
7613 | 124k | }; |
7614 | | |
7615 | | // Loop twice to add prototypes with/without scope/semantics |
7616 | 373k | for (int j = 0; j < 2; ++j) { |
7617 | 1.99M | for (size_t i = 0; i < numBuiltins; ++i) { |
7618 | 1.74M | commonBuiltins.append(dataType); |
7619 | 1.74M | commonBuiltins.append(atomicFunc[i]); |
7620 | 1.74M | commonBuiltins.append(imageParams); |
7621 | 1.74M | commonBuiltins.append(", "); |
7622 | 1.74M | commonBuiltins.append(dataType); |
7623 | 1.74M | if (j == 1) { |
7624 | 870k | commonBuiltins.append(", int, int, int"); |
7625 | 870k | } |
7626 | 1.74M | commonBuiltins.append(");\n"); |
7627 | 1.74M | } |
7628 | | |
7629 | 248k | commonBuiltins.append(dataType); |
7630 | 248k | commonBuiltins.append(" imageAtomicCompSwap(volatile coherent nontemporal "); |
7631 | 248k | commonBuiltins.append(imageParams); |
7632 | 248k | commonBuiltins.append(", "); |
7633 | 248k | commonBuiltins.append(dataType); |
7634 | 248k | commonBuiltins.append(", "); |
7635 | 248k | commonBuiltins.append(dataType); |
7636 | 248k | if (j == 1) { |
7637 | 124k | commonBuiltins.append(", int, int, int, int, int"); |
7638 | 124k | } |
7639 | 248k | commonBuiltins.append(");\n"); |
7640 | 248k | } |
7641 | | |
7642 | 124k | commonBuiltins.append(dataType); |
7643 | 124k | commonBuiltins.append(" imageAtomicLoad(volatile coherent nontemporal "); |
7644 | 124k | commonBuiltins.append(imageParams); |
7645 | 124k | commonBuiltins.append(", int, int, int);\n"); |
7646 | | |
7647 | 124k | commonBuiltins.append("void imageAtomicStore(volatile coherent nontemporal "); |
7648 | 124k | commonBuiltins.append(imageParams); |
7649 | 124k | commonBuiltins.append(", "); |
7650 | 124k | commonBuiltins.append(dataType); |
7651 | 124k | commonBuiltins.append(", int, int, int);\n"); |
7652 | | |
7653 | 124k | } else { |
7654 | | // not int or uint |
7655 | | // GL_ARB_ES3_1_compatibility |
7656 | | // TODO: spec issue: are there restrictions on the kind of layout() that can be used? what about dropping memory qualifiers? |
7657 | 56.1k | if (profile == EEsProfile && version >= 310) { |
7658 | 1.55k | commonBuiltins.append("float imageAtomicExchange(volatile coherent nontemporal "); |
7659 | 1.55k | commonBuiltins.append(imageParams); |
7660 | 1.55k | commonBuiltins.append(", float);\n"); |
7661 | 1.55k | } |
7662 | | |
7663 | | // GL_NV_shader_atomic_fp16_vector |
7664 | 56.1k | if (profile != EEsProfile && version >= 430) { |
7665 | 23.1k | const int numFp16Builtins = 4; |
7666 | 23.1k | const char* atomicFp16Func[numFp16Builtins] = { |
7667 | 23.1k | " imageAtomicAdd(volatile coherent nontemporal ", |
7668 | 23.1k | " imageAtomicMin(volatile coherent nontemporal ", |
7669 | 23.1k | " imageAtomicMax(volatile coherent nontemporal ", |
7670 | 23.1k | " imageAtomicExchange(volatile coherent nontemporal " |
7671 | 23.1k | }; |
7672 | 23.1k | const int numFp16DataTypes = 2; |
7673 | 23.1k | const char* atomicFp16DataTypes[numFp16DataTypes] = { |
7674 | 23.1k | "f16vec2", |
7675 | 23.1k | "f16vec4" |
7676 | 23.1k | }; |
7677 | | // Loop twice to add prototypes with/without scope/semantics |
7678 | 69.4k | for (int j = 0; j < numFp16DataTypes; ++j) { |
7679 | 231k | for (int i = 0; i < numFp16Builtins; ++i) { |
7680 | 185k | commonBuiltins.append(atomicFp16DataTypes[j]); |
7681 | 185k | commonBuiltins.append(atomicFp16Func[i]); |
7682 | 185k | commonBuiltins.append(imageParams); |
7683 | 185k | commonBuiltins.append(", "); |
7684 | 185k | commonBuiltins.append(atomicFp16DataTypes[j]); |
7685 | 185k | commonBuiltins.append(");\n"); |
7686 | 185k | } |
7687 | 46.3k | } |
7688 | 23.1k | } |
7689 | | |
7690 | 56.1k | if (profile != EEsProfile && version >= 450) { |
7691 | 19.4k | commonBuiltins.append("float imageAtomicAdd(volatile coherent nontemporal "); |
7692 | 19.4k | commonBuiltins.append(imageParams); |
7693 | 19.4k | commonBuiltins.append(", float);\n"); |
7694 | | |
7695 | 19.4k | commonBuiltins.append("float imageAtomicAdd(volatile coherent nontemporal "); |
7696 | 19.4k | commonBuiltins.append(imageParams); |
7697 | 19.4k | commonBuiltins.append(", float"); |
7698 | 19.4k | commonBuiltins.append(", int, int, int);\n"); |
7699 | | |
7700 | 19.4k | commonBuiltins.append("float imageAtomicExchange(volatile coherent nontemporal "); |
7701 | 19.4k | commonBuiltins.append(imageParams); |
7702 | 19.4k | commonBuiltins.append(", float);\n"); |
7703 | | |
7704 | 19.4k | commonBuiltins.append("float imageAtomicExchange(volatile coherent nontemporal "); |
7705 | 19.4k | commonBuiltins.append(imageParams); |
7706 | 19.4k | commonBuiltins.append(", float"); |
7707 | 19.4k | commonBuiltins.append(", int, int, int);\n"); |
7708 | | |
7709 | 19.4k | commonBuiltins.append("float imageAtomicLoad(readonly volatile coherent nontemporal "); |
7710 | 19.4k | commonBuiltins.append(imageParams); |
7711 | 19.4k | commonBuiltins.append(", int, int, int);\n"); |
7712 | | |
7713 | 19.4k | commonBuiltins.append("void imageAtomicStore(writeonly volatile coherent nontemporal "); |
7714 | 19.4k | commonBuiltins.append(imageParams); |
7715 | 19.4k | commonBuiltins.append(", float"); |
7716 | 19.4k | commonBuiltins.append(", int, int, int);\n"); |
7717 | | |
7718 | 19.4k | commonBuiltins.append("float imageAtomicMin(volatile coherent nontemporal "); |
7719 | 19.4k | commonBuiltins.append(imageParams); |
7720 | 19.4k | commonBuiltins.append(", float);\n"); |
7721 | | |
7722 | 19.4k | commonBuiltins.append("float imageAtomicMin(volatile coherent nontemporal "); |
7723 | 19.4k | commonBuiltins.append(imageParams); |
7724 | 19.4k | commonBuiltins.append(", float"); |
7725 | 19.4k | commonBuiltins.append(", int, int, int);\n"); |
7726 | | |
7727 | 19.4k | commonBuiltins.append("float imageAtomicMax(volatile coherent nontemporal "); |
7728 | 19.4k | commonBuiltins.append(imageParams); |
7729 | 19.4k | commonBuiltins.append(", float);\n"); |
7730 | | |
7731 | 19.4k | commonBuiltins.append("float imageAtomicMax(volatile coherent nontemporal "); |
7732 | 19.4k | commonBuiltins.append(imageParams); |
7733 | 19.4k | commonBuiltins.append(", float"); |
7734 | 19.4k | commonBuiltins.append(", int, int, int);\n"); |
7735 | 19.4k | } |
7736 | 56.1k | } |
7737 | 180k | } |
7738 | | |
7739 | 180k | if (sampler.dim == EsdRect || sampler.dim == EsdBuffer || sampler.shadow || sampler.isMultiSample()) |
7740 | 64.7k | return; |
7741 | | |
7742 | 115k | if (profile == EEsProfile || version < 450) |
7743 | 78.6k | return; |
7744 | | |
7745 | 37.0k | TString imageLodParams = typeName; |
7746 | 37.0k | if (dims == 1) |
7747 | 5.29k | imageLodParams.append(", int"); |
7748 | 31.7k | else { |
7749 | 31.7k | imageLodParams.append(", ivec"); |
7750 | 31.7k | imageLodParams.append(postfixes[dims]); |
7751 | 31.7k | } |
7752 | 37.0k | imageLodParams.append(", int"); |
7753 | | |
7754 | 37.0k | commonBuiltins.append(prefixes[sampler.type]); |
7755 | 37.0k | commonBuiltins.append("vec4 imageLoadLodAMD(readonly volatile coherent nontemporal "); |
7756 | 37.0k | commonBuiltins.append(imageLodParams); |
7757 | 37.0k | commonBuiltins.append(");\n"); |
7758 | | |
7759 | 37.0k | commonBuiltins.append("void imageStoreLodAMD(writeonly volatile coherent nontemporal "); |
7760 | 37.0k | commonBuiltins.append(imageLodParams); |
7761 | 37.0k | commonBuiltins.append(", "); |
7762 | 37.0k | commonBuiltins.append(prefixes[sampler.type]); |
7763 | 37.0k | commonBuiltins.append("vec4);\n"); |
7764 | | |
7765 | 37.0k | if (! sampler.is1D()) { |
7766 | 26.4k | commonBuiltins.append("int sparseImageLoadLodAMD(readonly volatile coherent nontemporal "); |
7767 | 26.4k | commonBuiltins.append(imageLodParams); |
7768 | 26.4k | commonBuiltins.append(", out "); |
7769 | 26.4k | commonBuiltins.append(prefixes[sampler.type]); |
7770 | 26.4k | commonBuiltins.append("vec4"); |
7771 | 26.4k | commonBuiltins.append(");\n"); |
7772 | 26.4k | } |
7773 | 37.0k | } |
7774 | | |
7775 | | // |
7776 | | // Helper function for initialize(), |
7777 | | // when adding context-independent built-in functions. |
7778 | | // |
7779 | | // Add all the subpass access functions for the given type. |
7780 | | // |
7781 | | void TBuiltIns::addSubpassSampling(TSampler sampler, const TString& typeName, int /*version*/, EProfile /*profile*/) |
7782 | 27.8k | { |
7783 | 27.8k | stageBuiltins[EShLangFragment].append(prefixes[sampler.type]); |
7784 | 27.8k | stageBuiltins[EShLangFragment].append("vec4 subpassLoad"); |
7785 | 27.8k | stageBuiltins[EShLangFragment].append("("); |
7786 | 27.8k | stageBuiltins[EShLangFragment].append(typeName.c_str()); |
7787 | 27.8k | if (sampler.isMultiSample()) |
7788 | 13.9k | stageBuiltins[EShLangFragment].append(", int"); |
7789 | 27.8k | stageBuiltins[EShLangFragment].append(");\n"); |
7790 | 27.8k | } |
7791 | | |
7792 | | // |
7793 | | // Helper function for add2ndGenerationSamplingImaging(), |
7794 | | // when adding context-independent built-in functions. |
7795 | | // |
7796 | | // Add all the texture lookup functions for the given type. |
7797 | | // |
7798 | | void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) |
7799 | 337k | { |
7800 | | // |
7801 | | // texturing |
7802 | | // |
7803 | 1.01M | for (int proj = 0; proj <= 1; ++proj) { // loop over "bool" projective or not |
7804 | | |
7805 | 674k | if (proj && (sampler.dim == EsdCube || sampler.isBuffer() || sampler.arrayed || sampler.isMultiSample() |
7806 | 123k | || !sampler.isCombined())) |
7807 | 267k | continue; |
7808 | | |
7809 | 1.21M | for (int lod = 0; lod <= 1; ++lod) { |
7810 | | |
7811 | 812k | if (lod && (sampler.isBuffer() || sampler.isRect() || sampler.isMultiSample() || !sampler.isCombined())) |
7812 | 228k | continue; |
7813 | 584k | if (lod && sampler.dim == Esd2D && sampler.arrayed && sampler.shadow) |
7814 | 5.22k | continue; |
7815 | 578k | if (lod && sampler.dim == EsdCube && sampler.shadow) |
7816 | 10.4k | continue; |
7817 | | |
7818 | 1.70M | for (int bias = 0; bias <= 1; ++bias) { |
7819 | | |
7820 | 1.13M | if (bias && (lod || sampler.isMultiSample() || !sampler.isCombined())) |
7821 | 340k | continue; |
7822 | 796k | if (bias && (sampler.dim == Esd2D || sampler.dim == EsdCube) && sampler.shadow && sampler.arrayed) |
7823 | 10.4k | continue; |
7824 | 785k | if (bias && (sampler.isRect() || sampler.isBuffer())) |
7825 | 50.0k | continue; |
7826 | | |
7827 | 2.20M | for (int offset = 0; offset <= 1; ++offset) { // loop over "bool" offset or not |
7828 | | |
7829 | 1.47M | if (proj + offset + bias + lod > 3) |
7830 | 0 | continue; |
7831 | 1.47M | if (offset && (sampler.dim == EsdCube || sampler.isBuffer() || sampler.isMultiSample())) |
7832 | 210k | continue; |
7833 | | |
7834 | 3.78M | for (int fetch = 0; fetch <= 1; ++fetch) { // loop over "bool" fetch or not |
7835 | | |
7836 | 2.52M | if (proj + offset + fetch + bias + lod > 3) |
7837 | 102k | continue; |
7838 | 2.41M | if (fetch && (lod || bias)) |
7839 | 495k | continue; |
7840 | 1.92M | if (fetch && (sampler.shadow || sampler.dim == EsdCube)) |
7841 | 147k | continue; |
7842 | 1.77M | if (fetch == 0 && (sampler.isMultiSample() || sampler.isBuffer() |
7843 | 1.17M | || !sampler.isCombined())) |
7844 | 273k | continue; |
7845 | | |
7846 | 4.51M | for (int grad = 0; grad <= 1; ++grad) { // loop over "bool" grad or not |
7847 | | |
7848 | 3.00M | if (grad && (lod || bias || sampler.isMultiSample() || !sampler.isCombined())) |
7849 | 829k | continue; |
7850 | 2.17M | if (grad && sampler.isBuffer()) |
7851 | 13.9k | continue; |
7852 | 2.16M | if (proj + offset + fetch + grad + bias + lod > 3) |
7853 | 54.0k | continue; |
7854 | | |
7855 | 6.32M | for (int extraProj = 0; extraProj <= 1; ++extraProj) { |
7856 | 4.21M | bool compare = false; |
7857 | 4.21M | int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); |
7858 | | // skip dummy unused second component for 1D non-array shadows |
7859 | 4.21M | if (sampler.shadow && totalDims < 2) |
7860 | 158k | totalDims = 2; |
7861 | 4.21M | totalDims += (sampler.shadow ? 1 : 0) + proj; |
7862 | 4.21M | if (totalDims > 4 && sampler.shadow) { |
7863 | 20.8k | compare = true; |
7864 | 20.8k | totalDims = 4; |
7865 | 20.8k | } |
7866 | 4.21M | assert(totalDims <= 4); |
7867 | | |
7868 | 4.21M | if (extraProj && ! proj) |
7869 | 1.46M | continue; |
7870 | 2.75M | if (extraProj && (sampler.dim == Esd3D || sampler.shadow || !sampler.isCombined())) |
7871 | 254k | continue; |
7872 | | |
7873 | | // loop over 16-bit floating-point texel addressing |
7874 | 7.49M | for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) |
7875 | 4.99M | { |
7876 | 4.99M | if (f16TexAddr && sampler.type != EbtFloat16) |
7877 | 2.30M | continue; |
7878 | 2.69M | if (f16TexAddr && sampler.shadow && ! compare) { |
7879 | 48.5k | compare = true; // compare argument is always present |
7880 | 48.5k | totalDims--; |
7881 | 48.5k | } |
7882 | | // loop over "bool" lod clamp |
7883 | 8.07M | for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp) |
7884 | 5.38M | { |
7885 | 5.38M | if (lodClamp && (profile == EEsProfile || version < 450)) |
7886 | 1.82M | continue; |
7887 | 3.56M | if (lodClamp && (proj || lod || fetch)) |
7888 | 611k | continue; |
7889 | | |
7890 | | // loop over "bool" sparse or not |
7891 | 8.85M | for (int sparse = 0; sparse <= 1; ++sparse) |
7892 | 5.90M | { |
7893 | 5.90M | if (sparse && (profile == EEsProfile || version < 450)) |
7894 | 1.82M | continue; |
7895 | | // Sparse sampling is not for 1D/1D array texture, buffer texture, and |
7896 | | // projective texture |
7897 | 4.08M | if (sparse && (sampler.is1D() || sampler.isBuffer() || proj)) |
7898 | 617k | continue; |
7899 | | |
7900 | 3.46M | TString s; |
7901 | | |
7902 | | // return type |
7903 | 3.46M | if (sparse) |
7904 | 512k | s.append("int "); |
7905 | 2.95M | else { |
7906 | 2.95M | if (sampler.shadow) |
7907 | 421k | if (sampler.type == EbtFloat16) |
7908 | 155k | s.append("float16_t "); |
7909 | 266k | else |
7910 | 266k | s.append("float "); |
7911 | 2.52M | else { |
7912 | 2.52M | s.append(prefixes[sampler.type]); |
7913 | 2.52M | s.append("vec4 "); |
7914 | 2.52M | } |
7915 | 2.95M | } |
7916 | | |
7917 | | // name |
7918 | 3.46M | if (sparse) { |
7919 | 512k | if (fetch) |
7920 | 123k | s.append("sparseTexel"); |
7921 | 388k | else |
7922 | 388k | s.append("sparseTexture"); |
7923 | 512k | } |
7924 | 2.95M | else { |
7925 | 2.95M | if (fetch) |
7926 | 908k | s.append("texel"); |
7927 | 2.04M | else |
7928 | 2.04M | s.append("texture"); |
7929 | 2.95M | } |
7930 | 3.46M | if (proj) |
7931 | 1.11M | s.append("Proj"); |
7932 | 3.46M | if (lod) |
7933 | 419k | s.append("Lod"); |
7934 | 3.46M | if (grad) |
7935 | 1.04M | s.append("Grad"); |
7936 | 3.46M | if (fetch) |
7937 | 1.03M | s.append("Fetch"); |
7938 | 3.46M | if (offset) |
7939 | 1.49M | s.append("Offset"); |
7940 | 3.46M | if (lodClamp) |
7941 | 432k | s.append("Clamp"); |
7942 | 3.46M | if (lodClamp != 0 || sparse) |
7943 | 770k | s.append("ARB"); |
7944 | 3.46M | s.append("("); |
7945 | | |
7946 | | // sampler type |
7947 | 3.46M | s.append(typeName); |
7948 | | // P coordinate |
7949 | 3.46M | if (extraProj) { |
7950 | 414k | if (f16TexAddr) |
7951 | 25.6k | s.append(",f16vec4"); |
7952 | 389k | else |
7953 | 389k | s.append(",vec4"); |
7954 | 3.04M | } else { |
7955 | 3.04M | s.append(","); |
7956 | 3.04M | TBasicType t = fetch ? EbtInt : (f16TexAddr ? EbtFloat16 : EbtFloat); |
7957 | 3.04M | if (totalDims == 1) |
7958 | 252k | s.append(TType::getBasicString(t)); |
7959 | 2.79M | else { |
7960 | 2.79M | s.append(prefixes[t]); |
7961 | 2.79M | s.append("vec"); |
7962 | 2.79M | s.append(postfixes[totalDims]); |
7963 | 2.79M | } |
7964 | 3.04M | } |
7965 | | // non-optional compare |
7966 | 3.46M | if (compare) |
7967 | 134k | s.append(",float"); |
7968 | | |
7969 | | // non-optional lod argument (lod that's not driven by lod loop) or sample |
7970 | 3.46M | if ((fetch && !sampler.isBuffer() && |
7971 | 1.00M | !sampler.isRect() && !sampler.isMultiSample()) |
7972 | 2.73M | || (sampler.isMultiSample() && fetch)) |
7973 | 807k | s.append(",int"); |
7974 | | // non-optional lod |
7975 | 3.46M | if (lod) { |
7976 | 419k | if (f16TexAddr) |
7977 | 37.0k | s.append(",float16_t"); |
7978 | 382k | else |
7979 | 382k | s.append(",float"); |
7980 | 419k | } |
7981 | | |
7982 | | // gradient arguments |
7983 | 3.46M | if (grad) { |
7984 | 1.04M | if (dimMap[sampler.dim] == 1) { |
7985 | 259k | if (f16TexAddr) |
7986 | 24.7k | s.append(",float16_t,float16_t"); |
7987 | 234k | else |
7988 | 234k | s.append(",float,float"); |
7989 | 783k | } else { |
7990 | 783k | if (f16TexAddr) |
7991 | 94.4k | s.append(",f16vec"); |
7992 | 689k | else |
7993 | 689k | s.append(",vec"); |
7994 | 783k | s.append(postfixes[dimMap[sampler.dim]]); |
7995 | 783k | if (f16TexAddr) |
7996 | 94.4k | s.append(",f16vec"); |
7997 | 689k | else |
7998 | 689k | s.append(",vec"); |
7999 | 783k | s.append(postfixes[dimMap[sampler.dim]]); |
8000 | 783k | } |
8001 | 1.04M | } |
8002 | | // offset |
8003 | 3.46M | if (offset) { |
8004 | 1.49M | if (dimMap[sampler.dim] == 1) |
8005 | 448k | s.append(",int"); |
8006 | 1.04M | else { |
8007 | 1.04M | s.append(",ivec"); |
8008 | 1.04M | s.append(postfixes[dimMap[sampler.dim]]); |
8009 | 1.04M | } |
8010 | 1.49M | } |
8011 | | |
8012 | | // lod clamp |
8013 | 3.46M | if (lodClamp) { |
8014 | 432k | if (f16TexAddr) |
8015 | 104k | s.append(",float16_t"); |
8016 | 328k | else |
8017 | 328k | s.append(",float"); |
8018 | 432k | } |
8019 | | // texel out (for sparse texture) |
8020 | 3.46M | if (sparse) { |
8021 | 512k | s.append(",out "); |
8022 | 512k | if (sampler.shadow) |
8023 | 105k | if (sampler.type == EbtFloat16) |
8024 | 70.6k | s.append("float16_t"); |
8025 | 35.3k | else |
8026 | 35.3k | s.append("float"); |
8027 | 406k | else { |
8028 | 406k | s.append(prefixes[sampler.type]); |
8029 | 406k | s.append("vec4"); |
8030 | 406k | } |
8031 | 512k | } |
8032 | | // optional bias |
8033 | 3.46M | if (bias) { |
8034 | 542k | if (f16TexAddr) |
8035 | 65.3k | s.append(",float16_t"); |
8036 | 477k | else |
8037 | 477k | s.append(",float"); |
8038 | 542k | } |
8039 | 3.46M | s.append(");\n"); |
8040 | | |
8041 | | // Add to the per-language set of built-ins |
8042 | 3.46M | if (!grad && (bias || lodClamp != 0)) { |
8043 | 701k | stageBuiltins[EShLangFragment].append(s); |
8044 | 701k | stageBuiltins[EShLangCompute].append(s); |
8045 | 701k | } else |
8046 | 2.76M | commonBuiltins.append(s); |
8047 | | |
8048 | 3.46M | } |
8049 | 2.95M | } |
8050 | 2.69M | } |
8051 | 2.49M | } |
8052 | 2.10M | } |
8053 | 1.50M | } |
8054 | 1.26M | } |
8055 | 735k | } |
8056 | 568k | } |
8057 | 406k | } |
8058 | 337k | } |
8059 | | |
8060 | | // |
8061 | | // Helper function for add2ndGenerationSamplingImaging(), |
8062 | | // when adding context-independent built-in functions. |
8063 | | // |
8064 | | // Add all the texture gather functions for the given type. |
8065 | | // |
8066 | | void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) |
8067 | 186k | { |
8068 | 186k | switch (sampler.dim) { |
8069 | 66.0k | case Esd2D: |
8070 | 84.1k | case EsdRect: |
8071 | 122k | case EsdCube: |
8072 | 122k | break; |
8073 | 64.0k | default: |
8074 | 64.0k | return; |
8075 | 186k | } |
8076 | | |
8077 | 122k | if (sampler.isMultiSample()) |
8078 | 27.8k | return; |
8079 | | |
8080 | 94.6k | if (version < 140 && sampler.dim == EsdRect && sampler.type != EbtFloat) |
8081 | 0 | return; |
8082 | | |
8083 | 283k | for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing |
8084 | | |
8085 | 189k | if (f16TexAddr && sampler.type != EbtFloat16) |
8086 | 85.7k | continue; |
8087 | 413k | for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets |
8088 | | |
8089 | 930k | for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument |
8090 | | |
8091 | 620k | if (comp > 0 && sampler.shadow) |
8092 | 90.8k | continue; |
8093 | | |
8094 | 529k | if (offset > 0 && sampler.dim == EsdCube) |
8095 | 142k | continue; |
8096 | | |
8097 | 1.16M | for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not |
8098 | 774k | if (sparse && (profile == EEsProfile || version < 450)) |
8099 | 260k | continue; |
8100 | | |
8101 | 513k | TString s; |
8102 | | |
8103 | | // return type |
8104 | 513k | if (sparse) |
8105 | 126k | s.append("int "); |
8106 | 387k | else { |
8107 | 387k | s.append(prefixes[sampler.type]); |
8108 | 387k | s.append("vec4 "); |
8109 | 387k | } |
8110 | | |
8111 | | // name |
8112 | 513k | if (sparse) |
8113 | 126k | s.append("sparseTextureGather"); |
8114 | 387k | else |
8115 | 387k | s.append("textureGather"); |
8116 | 513k | switch (offset) { |
8117 | 139k | case 1: |
8118 | 139k | s.append("Offset"); |
8119 | 139k | break; |
8120 | 139k | case 2: |
8121 | 139k | s.append("Offsets"); |
8122 | 139k | break; |
8123 | 234k | default: |
8124 | 234k | break; |
8125 | 513k | } |
8126 | 513k | if (sparse) |
8127 | 126k | s.append("ARB"); |
8128 | 513k | s.append("("); |
8129 | | |
8130 | | // sampler type argument |
8131 | 513k | s.append(typeName); |
8132 | | |
8133 | | // P coordinate argument |
8134 | 513k | if (f16TexAddr) |
8135 | 58.2k | s.append(",f16vec"); |
8136 | 455k | else |
8137 | 455k | s.append(",vec"); |
8138 | 513k | int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); |
8139 | 513k | s.append(postfixes[totalDims]); |
8140 | | |
8141 | | // refZ argument |
8142 | 513k | if (sampler.shadow) |
8143 | 95.5k | s.append(",float"); |
8144 | | |
8145 | | // offset argument |
8146 | 513k | if (offset > 0) { |
8147 | 279k | s.append(",ivec2"); |
8148 | 279k | if (offset == 2) |
8149 | 139k | s.append("[4]"); |
8150 | 279k | } |
8151 | | |
8152 | | // texel out (for sparse texture) |
8153 | 513k | if (sparse) { |
8154 | 126k | s.append(",out "); |
8155 | 126k | s.append(prefixes[sampler.type]); |
8156 | 126k | s.append("vec4 "); |
8157 | 126k | } |
8158 | | |
8159 | | // comp argument |
8160 | 513k | if (comp) |
8161 | 208k | s.append(",int"); |
8162 | | |
8163 | 513k | s.append(");\n"); |
8164 | 513k | commonBuiltins.append(s); |
8165 | 513k | } |
8166 | 387k | } |
8167 | 310k | } |
8168 | 103k | } |
8169 | | |
8170 | 94.6k | if (sampler.dim == EsdRect || sampler.shadow) |
8171 | 38.9k | return; |
8172 | | |
8173 | 55.6k | if (profile == EEsProfile || version < 450) |
8174 | 41.4k | return; |
8175 | | |
8176 | 42.3k | for (int bias = 0; bias < 2; ++bias) { // loop over presence of bias argument |
8177 | | |
8178 | 84.7k | for (int lod = 0; lod < 2; ++lod) { // loop over presence of lod argument |
8179 | | |
8180 | 56.5k | if ((lod && bias) || (lod == 0 && bias == 0)) |
8181 | 28.2k | continue; |
8182 | | |
8183 | 84.7k | for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr) { // loop over 16-bit floating-point texel addressing |
8184 | | |
8185 | 56.5k | if (f16TexAddr && sampler.type != EbtFloat16) |
8186 | 21.1k | continue; |
8187 | | |
8188 | 141k | for (int offset = 0; offset < 3; ++offset) { // loop over three forms of offset in the call name: none, Offset, and Offsets |
8189 | | |
8190 | 317k | for (int comp = 0; comp < 2; ++comp) { // loop over presence of comp argument |
8191 | | |
8192 | 211k | if (comp == 0 && bias) |
8193 | 52.9k | continue; |
8194 | | |
8195 | 158k | if (offset > 0 && sampler.dim == EsdCube) |
8196 | 52.9k | continue; |
8197 | | |
8198 | 317k | for (int sparse = 0; sparse <= 1; ++sparse) { // loop over "bool" sparse or not |
8199 | 211k | if (sparse && (profile == EEsProfile || version < 450)) |
8200 | 0 | continue; |
8201 | | |
8202 | 211k | TString s; |
8203 | | |
8204 | | // return type |
8205 | 211k | if (sparse) |
8206 | 105k | s.append("int "); |
8207 | 105k | else { |
8208 | 105k | s.append(prefixes[sampler.type]); |
8209 | 105k | s.append("vec4 "); |
8210 | 105k | } |
8211 | | |
8212 | | // name |
8213 | 211k | if (sparse) |
8214 | 105k | s.append("sparseTextureGather"); |
8215 | 105k | else |
8216 | 105k | s.append("textureGather"); |
8217 | | |
8218 | 211k | if (lod) |
8219 | 141k | s.append("Lod"); |
8220 | | |
8221 | 211k | switch (offset) { |
8222 | 52.9k | case 1: |
8223 | 52.9k | s.append("Offset"); |
8224 | 52.9k | break; |
8225 | 52.9k | case 2: |
8226 | 52.9k | s.append("Offsets"); |
8227 | 52.9k | break; |
8228 | 105k | default: |
8229 | 105k | break; |
8230 | 211k | } |
8231 | | |
8232 | 211k | if (lod) |
8233 | 141k | s.append("AMD"); |
8234 | 70.6k | else if (sparse) |
8235 | 35.3k | s.append("ARB"); |
8236 | | |
8237 | 211k | s.append("("); |
8238 | | |
8239 | | // sampler type argument |
8240 | 211k | s.append(typeName); |
8241 | | |
8242 | | // P coordinate argument |
8243 | 211k | if (f16TexAddr) |
8244 | 42.3k | s.append(",f16vec"); |
8245 | 169k | else |
8246 | 169k | s.append(",vec"); |
8247 | 211k | int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0); |
8248 | 211k | s.append(postfixes[totalDims]); |
8249 | | |
8250 | | // lod argument |
8251 | 211k | if (lod) { |
8252 | 141k | if (f16TexAddr) |
8253 | 28.2k | s.append(",float16_t"); |
8254 | 113k | else |
8255 | 113k | s.append(",float"); |
8256 | 141k | } |
8257 | | |
8258 | | // offset argument |
8259 | 211k | if (offset > 0) { |
8260 | 105k | s.append(",ivec2"); |
8261 | 105k | if (offset == 2) |
8262 | 52.9k | s.append("[4]"); |
8263 | 105k | } |
8264 | | |
8265 | | // texel out (for sparse texture) |
8266 | 211k | if (sparse) { |
8267 | 105k | s.append(",out "); |
8268 | 105k | s.append(prefixes[sampler.type]); |
8269 | 105k | s.append("vec4 "); |
8270 | 105k | } |
8271 | | |
8272 | | // comp argument |
8273 | 211k | if (comp) |
8274 | 141k | s.append(",int"); |
8275 | | |
8276 | | // bias argument |
8277 | 211k | if (bias) { |
8278 | 70.6k | if (f16TexAddr) |
8279 | 14.1k | s.append(",float16_t"); |
8280 | 56.5k | else |
8281 | 56.5k | s.append(",float"); |
8282 | 70.6k | } |
8283 | | |
8284 | 211k | s.append(");\n"); |
8285 | 211k | if (bias) |
8286 | 70.6k | stageBuiltins[EShLangFragment].append(s); |
8287 | 141k | else |
8288 | 141k | commonBuiltins.append(s); |
8289 | 211k | } |
8290 | 105k | } |
8291 | 105k | } |
8292 | 35.3k | } |
8293 | 28.2k | } |
8294 | 28.2k | } |
8295 | 14.1k | } |
8296 | | |
8297 | | // |
8298 | | // Add context-dependent built-in functions and variables that are present |
8299 | | // for the given version and profile. All the results are put into just the |
8300 | | // commonBuiltins, because it is called for just a specific stage. So, |
8301 | | // add stage-specific entries to the commonBuiltins, and only if that stage |
8302 | | // was requested. |
8303 | | // |
8304 | | void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language) |
8305 | 10.4k | { |
8306 | | // |
8307 | | // Initialize the context-dependent (resource-dependent) built-in strings for parsing. |
8308 | | // |
8309 | | |
8310 | | //============================================================================ |
8311 | | // |
8312 | | // Standard Uniforms |
8313 | | // |
8314 | | //============================================================================ |
8315 | | |
8316 | 10.4k | TString& s = commonBuiltins; |
8317 | 10.4k | const int maxSize = 200; |
8318 | 10.4k | char builtInConstant[maxSize]; |
8319 | | |
8320 | | // |
8321 | | // Build string of implementation dependent constants. |
8322 | | // |
8323 | | |
8324 | 10.4k | if (profile == EEsProfile) { |
8325 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVertexAttribs = %d;", resources.maxVertexAttribs); |
8326 | 835 | s.append(builtInConstant); |
8327 | | |
8328 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVertexUniformVectors = %d;", resources.maxVertexUniformVectors); |
8329 | 835 | s.append(builtInConstant); |
8330 | | |
8331 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVertexTextureImageUnits = %d;", resources.maxVertexTextureImageUnits); |
8332 | 835 | s.append(builtInConstant); |
8333 | | |
8334 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxCombinedTextureImageUnits = %d;", resources.maxCombinedTextureImageUnits); |
8335 | 835 | s.append(builtInConstant); |
8336 | | |
8337 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxTextureImageUnits = %d;", resources.maxTextureImageUnits); |
8338 | 835 | s.append(builtInConstant); |
8339 | | |
8340 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxFragmentUniformVectors = %d;", resources.maxFragmentUniformVectors); |
8341 | 835 | s.append(builtInConstant); |
8342 | | |
8343 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxDrawBuffers = %d;", resources.maxDrawBuffers); |
8344 | 835 | s.append(builtInConstant); |
8345 | | |
8346 | 835 | if (version == 100) { |
8347 | 0 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVaryingVectors = %d;", resources.maxVaryingVectors); |
8348 | 0 | s.append(builtInConstant); |
8349 | 835 | } else { |
8350 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxVertexOutputVectors = %d;", resources.maxVertexOutputVectors); |
8351 | 835 | s.append(builtInConstant); |
8352 | | |
8353 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxFragmentInputVectors = %d;", resources.maxFragmentInputVectors); |
8354 | 835 | s.append(builtInConstant); |
8355 | | |
8356 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MinProgramTexelOffset = %d;", resources.minProgramTexelOffset); |
8357 | 835 | s.append(builtInConstant); |
8358 | | |
8359 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxProgramTexelOffset = %d;", resources.maxProgramTexelOffset); |
8360 | 835 | s.append(builtInConstant); |
8361 | 835 | } |
8362 | | |
8363 | 835 | if (version >= 310) { |
8364 | | // geometry |
8365 | | |
8366 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryInputComponents = %d;", resources.maxGeometryInputComponents); |
8367 | 835 | s.append(builtInConstant); |
8368 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryOutputComponents = %d;", resources.maxGeometryOutputComponents); |
8369 | 835 | s.append(builtInConstant); |
8370 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryImageUniforms = %d;", resources.maxGeometryImageUniforms); |
8371 | 835 | s.append(builtInConstant); |
8372 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryTextureImageUnits = %d;", resources.maxGeometryTextureImageUnits); |
8373 | 835 | s.append(builtInConstant); |
8374 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryOutputVertices = %d;", resources.maxGeometryOutputVertices); |
8375 | 835 | s.append(builtInConstant); |
8376 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryTotalOutputComponents = %d;", resources.maxGeometryTotalOutputComponents); |
8377 | 835 | s.append(builtInConstant); |
8378 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryUniformComponents = %d;", resources.maxGeometryUniformComponents); |
8379 | 835 | s.append(builtInConstant); |
8380 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounters = %d;", resources.maxGeometryAtomicCounters); |
8381 | 835 | s.append(builtInConstant); |
8382 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounterBuffers = %d;", resources.maxGeometryAtomicCounterBuffers); |
8383 | 835 | s.append(builtInConstant); |
8384 | | |
8385 | | // tessellation |
8386 | | |
8387 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlInputComponents = %d;", resources.maxTessControlInputComponents); |
8388 | 835 | s.append(builtInConstant); |
8389 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlOutputComponents = %d;", resources.maxTessControlOutputComponents); |
8390 | 835 | s.append(builtInConstant); |
8391 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTextureImageUnits = %d;", resources.maxTessControlTextureImageUnits); |
8392 | 835 | s.append(builtInConstant); |
8393 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlUniformComponents = %d;", resources.maxTessControlUniformComponents); |
8394 | 835 | s.append(builtInConstant); |
8395 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTotalOutputComponents = %d;", resources.maxTessControlTotalOutputComponents); |
8396 | 835 | s.append(builtInConstant); |
8397 | | |
8398 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationInputComponents = %d;", resources.maxTessEvaluationInputComponents); |
8399 | 835 | s.append(builtInConstant); |
8400 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationOutputComponents = %d;", resources.maxTessEvaluationOutputComponents); |
8401 | 835 | s.append(builtInConstant); |
8402 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationTextureImageUnits = %d;", resources.maxTessEvaluationTextureImageUnits); |
8403 | 835 | s.append(builtInConstant); |
8404 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationUniformComponents = %d;", resources.maxTessEvaluationUniformComponents); |
8405 | 835 | s.append(builtInConstant); |
8406 | | |
8407 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessPatchComponents = %d;", resources.maxTessPatchComponents); |
8408 | 835 | s.append(builtInConstant); |
8409 | | |
8410 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxPatchVertices = %d;", resources.maxPatchVertices); |
8411 | 835 | s.append(builtInConstant); |
8412 | 835 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessGenLevel = %d;", resources.maxTessGenLevel); |
8413 | 835 | s.append(builtInConstant); |
8414 | | |
8415 | | // this is here instead of with the others in initialize(version, profile) due to the dependence on gl_MaxPatchVertices |
8416 | 835 | if (language == EShLangTessControl || language == EShLangTessEvaluation) { |
8417 | 0 | s.append( |
8418 | 0 | "in gl_PerVertex {" |
8419 | 0 | "highp vec4 gl_Position;" |
8420 | 0 | "highp float gl_PointSize;" |
8421 | 0 | "highp vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering |
8422 | 0 | "highp vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
8423 | 0 | "} gl_in[gl_MaxPatchVertices];" |
8424 | 0 | "\n"); |
8425 | 0 | } |
8426 | 835 | } |
8427 | | |
8428 | 835 | if (version >= 320) { |
8429 | | // tessellation |
8430 | | |
8431 | 159 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlImageUniforms = %d;", resources.maxTessControlImageUniforms); |
8432 | 159 | s.append(builtInConstant); |
8433 | 159 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationImageUniforms = %d;", resources.maxTessEvaluationImageUniforms); |
8434 | 159 | s.append(builtInConstant); |
8435 | 159 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounters = %d;", resources.maxTessControlAtomicCounters); |
8436 | 159 | s.append(builtInConstant); |
8437 | 159 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounters = %d;", resources.maxTessEvaluationAtomicCounters); |
8438 | 159 | s.append(builtInConstant); |
8439 | 159 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounterBuffers = %d;", resources.maxTessControlAtomicCounterBuffers); |
8440 | 159 | s.append(builtInConstant); |
8441 | 159 | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounterBuffers = %d;", resources.maxTessEvaluationAtomicCounterBuffers); |
8442 | 159 | s.append(builtInConstant); |
8443 | 159 | } |
8444 | | |
8445 | 835 | if (version >= 100) { |
8446 | | // GL_EXT_blend_func_extended |
8447 | 835 | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxDualSourceDrawBuffersEXT = %d;", resources.maxDualSourceDrawBuffersEXT); |
8448 | 835 | s.append(builtInConstant); |
8449 | | // this is here instead of with the others in initialize(version, profile) due to the dependence on gl_MaxDualSourceDrawBuffersEXT |
8450 | 835 | if (language == EShLangFragment) { |
8451 | 72 | s.append( |
8452 | 72 | "mediump vec4 gl_SecondaryFragColorEXT;" |
8453 | 72 | "mediump vec4 gl_SecondaryFragDataEXT[gl_MaxDualSourceDrawBuffersEXT];" |
8454 | 72 | "\n"); |
8455 | 72 | } |
8456 | 835 | } |
8457 | 9.63k | } else { |
8458 | | // non-ES profile |
8459 | | |
8460 | 9.63k | if (version > 400) { |
8461 | 4.58k | snprintf(builtInConstant, maxSize, "const int gl_MaxVertexUniformVectors = %d;", resources.maxVertexUniformVectors); |
8462 | 4.58k | s.append(builtInConstant); |
8463 | | |
8464 | 4.58k | snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentUniformVectors = %d;", resources.maxFragmentUniformVectors); |
8465 | 4.58k | s.append(builtInConstant); |
8466 | | |
8467 | 4.58k | snprintf(builtInConstant, maxSize, "const int gl_MaxVaryingVectors = %d;", resources.maxVaryingVectors); |
8468 | 4.58k | s.append(builtInConstant); |
8469 | 4.58k | } |
8470 | | |
8471 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAttribs = %d;", resources.maxVertexAttribs); |
8472 | 9.63k | s.append(builtInConstant); |
8473 | | |
8474 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxVertexTextureImageUnits = %d;", resources.maxVertexTextureImageUnits); |
8475 | 9.63k | s.append(builtInConstant); |
8476 | | |
8477 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedTextureImageUnits = %d;", resources.maxCombinedTextureImageUnits); |
8478 | 9.63k | s.append(builtInConstant); |
8479 | | |
8480 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxTextureImageUnits = %d;", resources.maxTextureImageUnits); |
8481 | 9.63k | s.append(builtInConstant); |
8482 | | |
8483 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxDrawBuffers = %d;", resources.maxDrawBuffers); |
8484 | 9.63k | s.append(builtInConstant); |
8485 | | |
8486 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxLights = %d;", resources.maxLights); |
8487 | 9.63k | s.append(builtInConstant); |
8488 | | |
8489 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxClipPlanes = %d;", resources.maxClipPlanes); |
8490 | 9.63k | s.append(builtInConstant); |
8491 | | |
8492 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxTextureUnits = %d;", resources.maxTextureUnits); |
8493 | 9.63k | s.append(builtInConstant); |
8494 | | |
8495 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxTextureCoords = %d;", resources.maxTextureCoords); |
8496 | 9.63k | s.append(builtInConstant); |
8497 | | |
8498 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxVertexUniformComponents = %d;", resources.maxVertexUniformComponents); |
8499 | 9.63k | s.append(builtInConstant); |
8500 | | |
8501 | | // Moved from just being deprecated into compatibility profile only as of 4.20 |
8502 | 9.63k | if (version < 420 || profile == ECompatibilityProfile) { |
8503 | 5.06k | snprintf(builtInConstant, maxSize, "const int gl_MaxVaryingFloats = %d;", resources.maxVaryingFloats); |
8504 | 5.06k | s.append(builtInConstant); |
8505 | 5.06k | } |
8506 | | |
8507 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentUniformComponents = %d;", resources.maxFragmentUniformComponents); |
8508 | 9.63k | s.append(builtInConstant); |
8509 | | |
8510 | 9.63k | if (spvVersion.spv == 0 && IncludeLegacy(version, profile, spvVersion)) { |
8511 | | // |
8512 | | // OpenGL'uniform' state. Page numbers are in reference to version |
8513 | | // 1.4 of the OpenGL specification. |
8514 | | // |
8515 | | |
8516 | | // |
8517 | | // Matrix state. p. 31, 32, 37, 39, 40. |
8518 | | // |
8519 | 0 | s.append("uniform mat4 gl_TextureMatrix[gl_MaxTextureCoords];" |
8520 | | |
8521 | | // |
8522 | | // Derived matrix state that provides inverse and transposed versions |
8523 | | // of the matrices above. |
8524 | | // |
8525 | 0 | "uniform mat4 gl_TextureMatrixInverse[gl_MaxTextureCoords];" |
8526 | |
|
8527 | 0 | "uniform mat4 gl_TextureMatrixTranspose[gl_MaxTextureCoords];" |
8528 | |
|
8529 | 0 | "uniform mat4 gl_TextureMatrixInverseTranspose[gl_MaxTextureCoords];" |
8530 | | |
8531 | | // |
8532 | | // Clip planes p. 42. |
8533 | | // |
8534 | 0 | "uniform vec4 gl_ClipPlane[gl_MaxClipPlanes];" |
8535 | | |
8536 | | // |
8537 | | // Light State p 50, 53, 55. |
8538 | | // |
8539 | 0 | "uniform gl_LightSourceParameters gl_LightSource[gl_MaxLights];" |
8540 | | |
8541 | | // |
8542 | | // Derived state from products of light. |
8543 | | // |
8544 | 0 | "uniform gl_LightProducts gl_FrontLightProduct[gl_MaxLights];" |
8545 | 0 | "uniform gl_LightProducts gl_BackLightProduct[gl_MaxLights];" |
8546 | | |
8547 | | // |
8548 | | // Texture Environment and Generation, p. 152, p. 40-42. |
8549 | | // |
8550 | 0 | "uniform vec4 gl_TextureEnvColor[gl_MaxTextureImageUnits];" |
8551 | 0 | "uniform vec4 gl_EyePlaneS[gl_MaxTextureCoords];" |
8552 | 0 | "uniform vec4 gl_EyePlaneT[gl_MaxTextureCoords];" |
8553 | 0 | "uniform vec4 gl_EyePlaneR[gl_MaxTextureCoords];" |
8554 | 0 | "uniform vec4 gl_EyePlaneQ[gl_MaxTextureCoords];" |
8555 | 0 | "uniform vec4 gl_ObjectPlaneS[gl_MaxTextureCoords];" |
8556 | 0 | "uniform vec4 gl_ObjectPlaneT[gl_MaxTextureCoords];" |
8557 | 0 | "uniform vec4 gl_ObjectPlaneR[gl_MaxTextureCoords];" |
8558 | 0 | "uniform vec4 gl_ObjectPlaneQ[gl_MaxTextureCoords];"); |
8559 | 0 | } |
8560 | | |
8561 | 9.63k | if (version >= 130) { |
8562 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxClipDistances = %d;", resources.maxClipDistances); |
8563 | 9.63k | s.append(builtInConstant); |
8564 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxVaryingComponents = %d;", resources.maxVaryingComponents); |
8565 | 9.63k | s.append(builtInConstant); |
8566 | | |
8567 | | // GL_ARB_shading_language_420pack |
8568 | 9.63k | snprintf(builtInConstant, maxSize, "const mediump int gl_MinProgramTexelOffset = %d;", resources.minProgramTexelOffset); |
8569 | 9.63k | s.append(builtInConstant); |
8570 | 9.63k | snprintf(builtInConstant, maxSize, "const mediump int gl_MaxProgramTexelOffset = %d;", resources.maxProgramTexelOffset); |
8571 | 9.63k | s.append(builtInConstant); |
8572 | 9.63k | } |
8573 | | |
8574 | | // geometry |
8575 | 9.63k | if (version >= 150) { |
8576 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryInputComponents = %d;", resources.maxGeometryInputComponents); |
8577 | 6.53k | s.append(builtInConstant); |
8578 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryOutputComponents = %d;", resources.maxGeometryOutputComponents); |
8579 | 6.53k | s.append(builtInConstant); |
8580 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryTextureImageUnits = %d;", resources.maxGeometryTextureImageUnits); |
8581 | 6.53k | s.append(builtInConstant); |
8582 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryOutputVertices = %d;", resources.maxGeometryOutputVertices); |
8583 | 6.53k | s.append(builtInConstant); |
8584 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryTotalOutputComponents = %d;", resources.maxGeometryTotalOutputComponents); |
8585 | 6.53k | s.append(builtInConstant); |
8586 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryUniformComponents = %d;", resources.maxGeometryUniformComponents); |
8587 | 6.53k | s.append(builtInConstant); |
8588 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryVaryingComponents = %d;", resources.maxGeometryVaryingComponents); |
8589 | 6.53k | s.append(builtInConstant); |
8590 | | |
8591 | 6.53k | } |
8592 | | |
8593 | 9.63k | if (version >= 150) { |
8594 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxVertexOutputComponents = %d;", resources.maxVertexOutputComponents); |
8595 | 6.53k | s.append(builtInConstant); |
8596 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentInputComponents = %d;", resources.maxFragmentInputComponents); |
8597 | 6.53k | s.append(builtInConstant); |
8598 | 6.53k | } |
8599 | | |
8600 | | // tessellation |
8601 | 9.63k | if (version >= 150) { |
8602 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlInputComponents = %d;", resources.maxTessControlInputComponents); |
8603 | 6.53k | s.append(builtInConstant); |
8604 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlOutputComponents = %d;", resources.maxTessControlOutputComponents); |
8605 | 6.53k | s.append(builtInConstant); |
8606 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTextureImageUnits = %d;", resources.maxTessControlTextureImageUnits); |
8607 | 6.53k | s.append(builtInConstant); |
8608 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlUniformComponents = %d;", resources.maxTessControlUniformComponents); |
8609 | 6.53k | s.append(builtInConstant); |
8610 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlTotalOutputComponents = %d;", resources.maxTessControlTotalOutputComponents); |
8611 | 6.53k | s.append(builtInConstant); |
8612 | | |
8613 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationInputComponents = %d;", resources.maxTessEvaluationInputComponents); |
8614 | 6.53k | s.append(builtInConstant); |
8615 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationOutputComponents = %d;", resources.maxTessEvaluationOutputComponents); |
8616 | 6.53k | s.append(builtInConstant); |
8617 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationTextureImageUnits = %d;", resources.maxTessEvaluationTextureImageUnits); |
8618 | 6.53k | s.append(builtInConstant); |
8619 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationUniformComponents = %d;", resources.maxTessEvaluationUniformComponents); |
8620 | 6.53k | s.append(builtInConstant); |
8621 | | |
8622 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessPatchComponents = %d;", resources.maxTessPatchComponents); |
8623 | 6.53k | s.append(builtInConstant); |
8624 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessGenLevel = %d;", resources.maxTessGenLevel); |
8625 | 6.53k | s.append(builtInConstant); |
8626 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxPatchVertices = %d;", resources.maxPatchVertices); |
8627 | 6.53k | s.append(builtInConstant); |
8628 | | |
8629 | | // this is here instead of with the others in initialize(version, profile) due to the dependence on gl_MaxPatchVertices |
8630 | 6.53k | if (language == EShLangTessControl || language == EShLangTessEvaluation) { |
8631 | 7 | s.append( |
8632 | 7 | "in gl_PerVertex {" |
8633 | 7 | "vec4 gl_Position;" |
8634 | 7 | "float gl_PointSize;" |
8635 | 7 | "float gl_ClipDistance[];" |
8636 | 7 | ); |
8637 | 7 | if (profile == ECompatibilityProfile) |
8638 | 0 | s.append( |
8639 | 0 | "vec4 gl_ClipVertex;" |
8640 | 0 | "vec4 gl_FrontColor;" |
8641 | 0 | "vec4 gl_BackColor;" |
8642 | 0 | "vec4 gl_FrontSecondaryColor;" |
8643 | 0 | "vec4 gl_BackSecondaryColor;" |
8644 | 0 | "vec4 gl_TexCoord[];" |
8645 | 0 | "float gl_FogFragCoord;" |
8646 | 0 | ); |
8647 | 7 | if (profile != EEsProfile && version >= 450) |
8648 | 6 | s.append( |
8649 | 6 | "float gl_CullDistance[];" |
8650 | 6 | "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering |
8651 | 6 | "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes |
8652 | 6 | ); |
8653 | 7 | s.append( |
8654 | 7 | "} gl_in[gl_MaxPatchVertices];" |
8655 | 7 | "\n"); |
8656 | 7 | } |
8657 | 6.53k | } |
8658 | | |
8659 | 9.63k | if (version >= 150) { |
8660 | 6.53k | snprintf(builtInConstant, maxSize, "const int gl_MaxViewports = %d;", resources.maxViewports); |
8661 | 6.53k | s.append(builtInConstant); |
8662 | 6.53k | } |
8663 | | |
8664 | | // images |
8665 | 9.63k | if (version >= 130) { |
8666 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedImageUnitsAndFragmentOutputs = %d;", resources.maxCombinedImageUnitsAndFragmentOutputs); |
8667 | 9.63k | s.append(builtInConstant); |
8668 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxImageSamples = %d;", resources.maxImageSamples); |
8669 | 9.63k | s.append(builtInConstant); |
8670 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlImageUniforms = %d;", resources.maxTessControlImageUniforms); |
8671 | 9.63k | s.append(builtInConstant); |
8672 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationImageUniforms = %d;", resources.maxTessEvaluationImageUniforms); |
8673 | 9.63k | s.append(builtInConstant); |
8674 | 9.63k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryImageUniforms = %d;", resources.maxGeometryImageUniforms); |
8675 | 9.63k | s.append(builtInConstant); |
8676 | 9.63k | } |
8677 | | |
8678 | | // enhanced layouts |
8679 | 9.63k | if (version >= 430) { |
8680 | 4.50k | snprintf(builtInConstant, maxSize, "const int gl_MaxTransformFeedbackBuffers = %d;", resources.maxTransformFeedbackBuffers); |
8681 | 4.50k | s.append(builtInConstant); |
8682 | 4.50k | snprintf(builtInConstant, maxSize, "const int gl_MaxTransformFeedbackInterleavedComponents = %d;", resources.maxTransformFeedbackInterleavedComponents); |
8683 | 4.50k | s.append(builtInConstant); |
8684 | 4.50k | } |
8685 | 9.63k | } |
8686 | | |
8687 | | // compute |
8688 | 10.4k | if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) { |
8689 | 5.41k | snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX, |
8690 | 5.41k | resources.maxComputeWorkGroupCountY, |
8691 | 5.41k | resources.maxComputeWorkGroupCountZ); |
8692 | 5.41k | s.append(builtInConstant); |
8693 | 5.41k | snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupSize = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupSizeX, |
8694 | 5.41k | resources.maxComputeWorkGroupSizeY, |
8695 | 5.41k | resources.maxComputeWorkGroupSizeZ); |
8696 | 5.41k | s.append(builtInConstant); |
8697 | | |
8698 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxComputeUniformComponents = %d;", resources.maxComputeUniformComponents); |
8699 | 5.41k | s.append(builtInConstant); |
8700 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxComputeTextureImageUnits = %d;", resources.maxComputeTextureImageUnits); |
8701 | 5.41k | s.append(builtInConstant); |
8702 | | |
8703 | | // GL_ARM_tensors operands. |
8704 | 5.41k | snprintf(builtInConstant, maxSize, "const uint gl_TensorOperandsNonTemporalARM = 0x1U;"); |
8705 | 5.41k | s.append(builtInConstant); |
8706 | 5.41k | snprintf(builtInConstant, maxSize, "const uint gl_TensorOperandsOutOfBoundsValueARM = 0x2U;"); |
8707 | 5.41k | s.append(builtInConstant); |
8708 | | |
8709 | 5.41k | s.append("\n"); |
8710 | 5.41k | } |
8711 | | |
8712 | | // images (some in compute below) |
8713 | 10.4k | if ((profile == EEsProfile && version >= 310) || |
8714 | 10.4k | (profile != EEsProfile && version >= 130)) { |
8715 | 10.4k | snprintf(builtInConstant, maxSize, "const int gl_MaxImageUnits = %d;", resources.maxImageUnits); |
8716 | 10.4k | s.append(builtInConstant); |
8717 | 10.4k | snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedShaderOutputResources = %d;", resources.maxCombinedShaderOutputResources); |
8718 | 10.4k | s.append(builtInConstant); |
8719 | 10.4k | snprintf(builtInConstant, maxSize, "const int gl_MaxVertexImageUniforms = %d;", resources.maxVertexImageUniforms); |
8720 | 10.4k | s.append(builtInConstant); |
8721 | 10.4k | snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentImageUniforms = %d;", resources.maxFragmentImageUniforms); |
8722 | 10.4k | s.append(builtInConstant); |
8723 | 10.4k | snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedImageUniforms = %d;", resources.maxCombinedImageUniforms); |
8724 | 10.4k | s.append(builtInConstant); |
8725 | 10.4k | } |
8726 | | |
8727 | | // compute |
8728 | 10.4k | if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) { |
8729 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxComputeImageUniforms = %d;", resources.maxComputeImageUniforms); |
8730 | 5.41k | s.append(builtInConstant); |
8731 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounters = %d;", resources.maxComputeAtomicCounters); |
8732 | 5.41k | s.append(builtInConstant); |
8733 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxComputeAtomicCounterBuffers = %d;", resources.maxComputeAtomicCounterBuffers); |
8734 | 5.41k | s.append(builtInConstant); |
8735 | | |
8736 | 5.41k | s.append("\n"); |
8737 | 5.41k | } |
8738 | | |
8739 | | // atomic counters (some in compute below) |
8740 | 10.4k | if ((profile == EEsProfile && version >= 310) || |
8741 | 9.63k | (profile != EEsProfile && version >= 420)) { |
8742 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAtomicCounters = %d;", resources. maxVertexAtomicCounters); |
8743 | 5.41k | s.append(builtInConstant); |
8744 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentAtomicCounters = %d;", resources. maxFragmentAtomicCounters); |
8745 | 5.41k | s.append(builtInConstant); |
8746 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedAtomicCounters = %d;", resources. maxCombinedAtomicCounters); |
8747 | 5.41k | s.append(builtInConstant); |
8748 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxAtomicCounterBindings = %d;", resources. maxAtomicCounterBindings); |
8749 | 5.41k | s.append(builtInConstant); |
8750 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAtomicCounterBuffers = %d;", resources. maxVertexAtomicCounterBuffers); |
8751 | 5.41k | s.append(builtInConstant); |
8752 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentAtomicCounterBuffers = %d;", resources. maxFragmentAtomicCounterBuffers); |
8753 | 5.41k | s.append(builtInConstant); |
8754 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedAtomicCounterBuffers = %d;", resources. maxCombinedAtomicCounterBuffers); |
8755 | 5.41k | s.append(builtInConstant); |
8756 | 5.41k | snprintf(builtInConstant, maxSize, "const int gl_MaxAtomicCounterBufferSize = %d;", resources. maxAtomicCounterBufferSize); |
8757 | 5.41k | s.append(builtInConstant); |
8758 | 5.41k | } |
8759 | 10.4k | if (profile != EEsProfile && version >= 420) { |
8760 | 4.58k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounters = %d;", resources. maxTessControlAtomicCounters); |
8761 | 4.58k | s.append(builtInConstant); |
8762 | 4.58k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounters = %d;", resources. maxTessEvaluationAtomicCounters); |
8763 | 4.58k | s.append(builtInConstant); |
8764 | 4.58k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounters = %d;", resources. maxGeometryAtomicCounters); |
8765 | 4.58k | s.append(builtInConstant); |
8766 | 4.58k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounterBuffers = %d;", resources. maxTessControlAtomicCounterBuffers); |
8767 | 4.58k | s.append(builtInConstant); |
8768 | 4.58k | snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounterBuffers = %d;", resources. maxTessEvaluationAtomicCounterBuffers); |
8769 | 4.58k | s.append(builtInConstant); |
8770 | 4.58k | snprintf(builtInConstant, maxSize, "const int gl_MaxGeometryAtomicCounterBuffers = %d;", resources. maxGeometryAtomicCounterBuffers); |
8771 | 4.58k | s.append(builtInConstant); |
8772 | | |
8773 | 4.58k | s.append("\n"); |
8774 | 4.58k | } |
8775 | | |
8776 | | // GL_ARB_cull_distance |
8777 | 10.4k | if (profile != EEsProfile && version >= 450) { |
8778 | 3.21k | snprintf(builtInConstant, maxSize, "const int gl_MaxCullDistances = %d;", resources.maxCullDistances); |
8779 | 3.21k | s.append(builtInConstant); |
8780 | 3.21k | snprintf(builtInConstant, maxSize, "const int gl_MaxCombinedClipAndCullDistances = %d;", resources.maxCombinedClipAndCullDistances); |
8781 | 3.21k | s.append(builtInConstant); |
8782 | 3.21k | } |
8783 | | |
8784 | | // GL_ARB_ES3_1_compatibility |
8785 | 10.4k | if ((profile != EEsProfile && version >= 450) || |
8786 | 7.25k | (profile == EEsProfile && version >= 310)) { |
8787 | 4.04k | snprintf(builtInConstant, maxSize, "const int gl_MaxSamples = %d;", resources.maxSamples); |
8788 | 4.04k | s.append(builtInConstant); |
8789 | 4.04k | } |
8790 | | |
8791 | | // SPV_NV_mesh_shader |
8792 | 10.4k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
8793 | 3.36k | snprintf(builtInConstant, maxSize, "const int gl_MaxMeshOutputVerticesNV = %d;", resources.maxMeshOutputVerticesNV); |
8794 | 3.36k | s.append(builtInConstant); |
8795 | | |
8796 | 3.36k | snprintf(builtInConstant, maxSize, "const int gl_MaxMeshOutputPrimitivesNV = %d;", resources.maxMeshOutputPrimitivesNV); |
8797 | 3.36k | s.append(builtInConstant); |
8798 | | |
8799 | 3.36k | snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxMeshWorkGroupSizeNV = ivec3(%d,%d,%d);", resources.maxMeshWorkGroupSizeX_NV, |
8800 | 3.36k | resources.maxMeshWorkGroupSizeY_NV, |
8801 | 3.36k | resources.maxMeshWorkGroupSizeZ_NV); |
8802 | 3.36k | s.append(builtInConstant); |
8803 | 3.36k | snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxTaskWorkGroupSizeNV = ivec3(%d,%d,%d);", resources.maxTaskWorkGroupSizeX_NV, |
8804 | 3.36k | resources.maxTaskWorkGroupSizeY_NV, |
8805 | 3.36k | resources.maxTaskWorkGroupSizeZ_NV); |
8806 | 3.36k | s.append(builtInConstant); |
8807 | | |
8808 | 3.36k | snprintf(builtInConstant, maxSize, "const int gl_MaxMeshViewCountNV = %d;", resources.maxMeshViewCountNV); |
8809 | 3.36k | s.append(builtInConstant); |
8810 | | |
8811 | 3.36k | s.append("\n"); |
8812 | 3.36k | } |
8813 | | |
8814 | 10.4k | s.append("\n"); |
8815 | 10.4k | } |
8816 | | |
8817 | | // |
8818 | | // To support special built-ins that have a special qualifier that cannot be declared textually |
8819 | | // in a shader, like gl_Position. |
8820 | | // |
8821 | | // This lets the type of the built-in be declared textually, and then have just its qualifier be |
8822 | | // updated afterward. |
8823 | | // |
8824 | | // Safe to call even if name is not present. |
8825 | | // |
8826 | | // Only use this for built-in variables that have a special qualifier in TStorageQualifier. |
8827 | | // New built-in variables should use a generic (textually declarable) qualifier in |
8828 | | // TStoraregQualifier and only call BuiltInVariable(). |
8829 | | // |
8830 | | static void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBuiltInVariable builtIn, TSymbolTable& symbolTable) |
8831 | 83.4k | { |
8832 | 83.4k | TSymbol* symbol = symbolTable.find(name); |
8833 | 83.4k | if (symbol == nullptr) |
8834 | 34.5k | return; |
8835 | | |
8836 | 48.8k | TQualifier& symQualifier = symbol->getWritableType().getQualifier(); |
8837 | 48.8k | symQualifier.storage = qualifier; |
8838 | 48.8k | symQualifier.builtIn = builtIn; |
8839 | 48.8k | } |
8840 | | |
8841 | | // |
8842 | | // Modify the symbol's flat decoration. |
8843 | | // |
8844 | | // Safe to call even if name is not present. |
8845 | | // |
8846 | | // Originally written to transform gl_SubGroupSizeARB from uniform to fragment input in Vulkan. |
8847 | | // |
8848 | | static void ModifyFlatDecoration(const char* name, bool flat, TSymbolTable& symbolTable) |
8849 | 4.08k | { |
8850 | 4.08k | TSymbol* symbol = symbolTable.find(name); |
8851 | 4.08k | if (symbol == nullptr) |
8852 | 3.19k | return; |
8853 | | |
8854 | 883 | TQualifier& symQualifier = symbol->getWritableType().getQualifier(); |
8855 | 883 | symQualifier.flat = flat; |
8856 | 883 | } |
8857 | | |
8858 | | // |
8859 | | // To tag built-in variables with their TBuiltInVariable enum. Use this when the |
8860 | | // normal declaration text already gets the qualifier right, and all that's needed |
8861 | | // is setting the builtIn field. This should be the normal way for all new |
8862 | | // built-in variables. |
8863 | | // |
8864 | | // If SpecialQualifier() was called, this does not need to be called. |
8865 | | // |
8866 | | // Safe to call even if name is not present. |
8867 | | // |
8868 | | static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) |
8869 | 870k | { |
8870 | 870k | TSymbol* symbol = symbolTable.find(name); |
8871 | 870k | if (symbol == nullptr) |
8872 | 306k | return; |
8873 | | |
8874 | 563k | TQualifier& symQualifier = symbol->getWritableType().getQualifier(); |
8875 | 563k | symQualifier.builtIn = builtIn; |
8876 | 563k | } |
8877 | | |
8878 | | static void RetargetVariable(const char* from, const char* to, TSymbolTable& symbolTable) |
8879 | 1.29k | { |
8880 | 1.29k | symbolTable.retargetSymbol(from, to); |
8881 | 1.29k | } |
8882 | | |
8883 | | // |
8884 | | // For built-in variables inside a named block. |
8885 | | // SpecialQualifier() won't ever go inside a block; their member's qualifier come |
8886 | | // from the qualification of the block. |
8887 | | // |
8888 | | // See comments above for other detail. |
8889 | | // |
8890 | | static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVariable builtIn, TSymbolTable& symbolTable) |
8891 | 331k | { |
8892 | 331k | TSymbol* symbol = symbolTable.find(blockName); |
8893 | 331k | if (symbol == nullptr) |
8894 | 252k | return; |
8895 | | |
8896 | 78.7k | TTypeList& structure = *symbol->getWritableType().getWritableStruct(); |
8897 | 349k | for (int i = 0; i < (int)structure.size(); ++i) { |
8898 | 310k | if (structure[i].type->getFieldName().compare(name) == 0) { |
8899 | 40.0k | structure[i].type->getQualifier().builtIn = builtIn; |
8900 | 40.0k | return; |
8901 | 40.0k | } |
8902 | 310k | } |
8903 | 78.7k | } |
8904 | | |
8905 | | // |
8906 | | // Finish adding/processing context-independent built-in symbols. |
8907 | | // 1) Programmatically add symbols that could not be added by simple text strings above. |
8908 | | // 2) Map built-in functions to operators, for those that will turn into an operation node |
8909 | | // instead of remaining a function call. |
8910 | | // 3) Tag extension-related symbols added to their base version with their extensions, so |
8911 | | // that if an early version has the extension turned off, there is an error reported on use. |
8912 | | // |
8913 | | void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable) |
8914 | 23.4k | { |
8915 | | // |
8916 | | // Tag built-in variables and functions with additional qualifier and extension information |
8917 | | // that cannot be declared with the text strings. |
8918 | | // |
8919 | | |
8920 | | // N.B.: a symbol should only be tagged once, and this function is called multiple times, once |
8921 | | // per stage that's used for this profile. So |
8922 | | // - generally, stick common ones in the fragment stage to ensure they are tagged exactly once |
8923 | | // - for ES, which has different precisions for different stages, the coarsest-grained tagging |
8924 | | // for a built-in used in many stages needs to be once for the fragment stage and once for |
8925 | | // the vertex stage |
8926 | | |
8927 | 23.4k | switch(language) { |
8928 | 4.34k | case EShLangVertex: |
8929 | 4.34k | if (spvVersion.vulkan > 0) { |
8930 | 4.34k | BuiltInVariable("gl_VertexIndex", EbvVertexIndex, symbolTable); |
8931 | 4.34k | BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable); |
8932 | 4.34k | } |
8933 | | |
8934 | 4.34k | if (spvVersion.vulkan == 0) { |
8935 | 0 | SpecialQualifier("gl_VertexID", EvqVertexId, EbvVertexId, symbolTable); |
8936 | 0 | SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable); |
8937 | 0 | if (version < 140) |
8938 | 0 | symbolTable.setVariableExtensions("gl_InstanceID", 1, &E_GL_EXT_draw_instanced); |
8939 | 0 | } |
8940 | | |
8941 | 4.34k | if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) { |
8942 | | // treat these built-ins as aliases of VertexIndex and InstanceIndex |
8943 | 0 | RetargetVariable("gl_InstanceID", "gl_InstanceIndex", symbolTable); |
8944 | 0 | RetargetVariable("gl_VertexID", "gl_VertexIndex", symbolTable); |
8945 | 0 | } |
8946 | | |
8947 | 4.34k | if (profile != EEsProfile) { |
8948 | 4.08k | if (version >= 440) { |
8949 | 951 | symbolTable.setVariableExtensions("gl_BaseVertexARB", 1, &E_GL_ARB_shader_draw_parameters); |
8950 | 951 | symbolTable.setVariableExtensions("gl_BaseInstanceARB", 1, &E_GL_ARB_shader_draw_parameters); |
8951 | 951 | symbolTable.setVariableExtensions("gl_DrawIDARB", 1, &E_GL_ARB_shader_draw_parameters); |
8952 | 951 | BuiltInVariable("gl_BaseVertexARB", EbvBaseVertex, symbolTable); |
8953 | 951 | BuiltInVariable("gl_BaseInstanceARB", EbvBaseInstance, symbolTable); |
8954 | 951 | BuiltInVariable("gl_DrawIDARB", EbvDrawId, symbolTable); |
8955 | 951 | } |
8956 | 4.08k | if (version >= 460) { |
8957 | 108 | BuiltInVariable("gl_BaseVertex", EbvBaseVertex, symbolTable); |
8958 | 108 | BuiltInVariable("gl_BaseInstance", EbvBaseInstance, symbolTable); |
8959 | 108 | BuiltInVariable("gl_DrawID", EbvDrawId, symbolTable); |
8960 | 108 | } |
8961 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); |
8962 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); |
8963 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); |
8964 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); |
8965 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); |
8966 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); |
8967 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); |
8968 | | |
8969 | 4.08k | symbolTable.setFunctionExtensions("ballotARB", 1, &E_GL_ARB_shader_ballot); |
8970 | 4.08k | symbolTable.setFunctionExtensions("readInvocationARB", 1, &E_GL_ARB_shader_ballot); |
8971 | 4.08k | symbolTable.setFunctionExtensions("readFirstInvocationARB", 1, &E_GL_ARB_shader_ballot); |
8972 | | |
8973 | 4.08k | if (version >= 430) { |
8974 | 1.22k | symbolTable.setFunctionExtensions("anyInvocationARB", 1, &E_GL_ARB_shader_group_vote); |
8975 | 1.22k | symbolTable.setFunctionExtensions("allInvocationsARB", 1, &E_GL_ARB_shader_group_vote); |
8976 | 1.22k | symbolTable.setFunctionExtensions("allInvocationsEqualARB", 1, &E_GL_ARB_shader_group_vote); |
8977 | 1.22k | } |
8978 | 4.08k | if (version >= 150) { |
8979 | 1.76k | symbolTable.setFunctionExtensions("anyThreadNV", 1, &E_GL_NV_gpu_shader5); |
8980 | 1.76k | symbolTable.setFunctionExtensions("allThreadsNV", 1, &E_GL_NV_gpu_shader5); |
8981 | 1.76k | symbolTable.setFunctionExtensions("allThreadsEqualNV", 1, &E_GL_NV_gpu_shader5); |
8982 | 1.76k | } |
8983 | 4.08k | } |
8984 | | |
8985 | | |
8986 | 4.34k | if (profile != EEsProfile) { |
8987 | 4.08k | symbolTable.setFunctionExtensions("minInvocationsAMD", 1, &E_GL_AMD_shader_ballot); |
8988 | 4.08k | symbolTable.setFunctionExtensions("maxInvocationsAMD", 1, &E_GL_AMD_shader_ballot); |
8989 | 4.08k | symbolTable.setFunctionExtensions("addInvocationsAMD", 1, &E_GL_AMD_shader_ballot); |
8990 | 4.08k | symbolTable.setFunctionExtensions("minInvocationsNonUniformAMD", 1, &E_GL_AMD_shader_ballot); |
8991 | 4.08k | symbolTable.setFunctionExtensions("maxInvocationsNonUniformAMD", 1, &E_GL_AMD_shader_ballot); |
8992 | 4.08k | symbolTable.setFunctionExtensions("addInvocationsNonUniformAMD", 1, &E_GL_AMD_shader_ballot); |
8993 | 4.08k | symbolTable.setFunctionExtensions("swizzleInvocationsAMD", 1, &E_GL_AMD_shader_ballot); |
8994 | 4.08k | symbolTable.setFunctionExtensions("swizzleInvocationsWithPatternAMD", 1, &E_GL_AMD_shader_ballot); |
8995 | 4.08k | symbolTable.setFunctionExtensions("writeInvocationAMD", 1, &E_GL_AMD_shader_ballot); |
8996 | 4.08k | symbolTable.setFunctionExtensions("mbcntAMD", 1, &E_GL_AMD_shader_ballot); |
8997 | | |
8998 | 4.08k | symbolTable.setFunctionExtensions("minInvocationsInclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); |
8999 | 4.08k | symbolTable.setFunctionExtensions("maxInvocationsInclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); |
9000 | 4.08k | symbolTable.setFunctionExtensions("addInvocationsInclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); |
9001 | 4.08k | symbolTable.setFunctionExtensions("minInvocationsInclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); |
9002 | 4.08k | symbolTable.setFunctionExtensions("maxInvocationsInclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); |
9003 | 4.08k | symbolTable.setFunctionExtensions("addInvocationsInclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); |
9004 | 4.08k | symbolTable.setFunctionExtensions("minInvocationsExclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); |
9005 | 4.08k | symbolTable.setFunctionExtensions("maxInvocationsExclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); |
9006 | 4.08k | symbolTable.setFunctionExtensions("addInvocationsExclusiveScanAMD", 1, &E_GL_AMD_shader_ballot); |
9007 | 4.08k | symbolTable.setFunctionExtensions("minInvocationsExclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); |
9008 | 4.08k | symbolTable.setFunctionExtensions("maxInvocationsExclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); |
9009 | 4.08k | symbolTable.setFunctionExtensions("addInvocationsExclusiveScanNonUniformAMD", 1, &E_GL_AMD_shader_ballot); |
9010 | 4.08k | } |
9011 | | |
9012 | 4.34k | if (profile != EEsProfile) { |
9013 | 4.08k | symbolTable.setFunctionExtensions("min3", 1, &E_GL_AMD_shader_trinary_minmax); |
9014 | 4.08k | symbolTable.setFunctionExtensions("max3", 1, &E_GL_AMD_shader_trinary_minmax); |
9015 | 4.08k | symbolTable.setFunctionExtensions("mid3", 1, &E_GL_AMD_shader_trinary_minmax); |
9016 | 4.08k | } |
9017 | | |
9018 | 4.34k | if (profile != EEsProfile) { |
9019 | 4.08k | symbolTable.setVariableExtensions("gl_SIMDGroupSizeAMD", 1, &E_GL_AMD_gcn_shader); |
9020 | 4.08k | SpecialQualifier("gl_SIMDGroupSizeAMD", EvqVaryingIn, EbvSubGroupSize, symbolTable); |
9021 | | |
9022 | 4.08k | symbolTable.setFunctionExtensions("cubeFaceIndexAMD", 1, &E_GL_AMD_gcn_shader); |
9023 | 4.08k | symbolTable.setFunctionExtensions("cubeFaceCoordAMD", 1, &E_GL_AMD_gcn_shader); |
9024 | 4.08k | symbolTable.setFunctionExtensions("timeAMD", 1, &E_GL_AMD_gcn_shader); |
9025 | 4.08k | } |
9026 | | |
9027 | 4.34k | if (profile != EEsProfile) { |
9028 | 4.08k | symbolTable.setFunctionExtensions("fragmentMaskFetchAMD", 1, &E_GL_AMD_shader_fragment_mask); |
9029 | 4.08k | symbolTable.setFunctionExtensions("fragmentFetchAMD", 1, &E_GL_AMD_shader_fragment_mask); |
9030 | 4.08k | } |
9031 | | |
9032 | 4.34k | symbolTable.setFunctionExtensions("countLeadingZeros", 1, &E_GL_INTEL_shader_integer_functions2); |
9033 | 4.34k | symbolTable.setFunctionExtensions("countTrailingZeros", 1, &E_GL_INTEL_shader_integer_functions2); |
9034 | 4.34k | symbolTable.setFunctionExtensions("absoluteDifference", 1, &E_GL_INTEL_shader_integer_functions2); |
9035 | 4.34k | symbolTable.setFunctionExtensions("addSaturate", 1, &E_GL_INTEL_shader_integer_functions2); |
9036 | 4.34k | symbolTable.setFunctionExtensions("subtractSaturate", 1, &E_GL_INTEL_shader_integer_functions2); |
9037 | 4.34k | symbolTable.setFunctionExtensions("average", 1, &E_GL_INTEL_shader_integer_functions2); |
9038 | 4.34k | symbolTable.setFunctionExtensions("averageRounded", 1, &E_GL_INTEL_shader_integer_functions2); |
9039 | 4.34k | symbolTable.setFunctionExtensions("multiply32x16", 1, &E_GL_INTEL_shader_integer_functions2); |
9040 | | |
9041 | 4.34k | symbolTable.setFunctionExtensions("textureFootprintNV", 1, &E_GL_NV_shader_texture_footprint); |
9042 | 4.34k | symbolTable.setFunctionExtensions("textureFootprintClampNV", 1, &E_GL_NV_shader_texture_footprint); |
9043 | 4.34k | symbolTable.setFunctionExtensions("textureFootprintLodNV", 1, &E_GL_NV_shader_texture_footprint); |
9044 | 4.34k | symbolTable.setFunctionExtensions("textureFootprintGradNV", 1, &E_GL_NV_shader_texture_footprint); |
9045 | 4.34k | symbolTable.setFunctionExtensions("textureFootprintGradClampNV", 1, &E_GL_NV_shader_texture_footprint); |
9046 | | // Compatibility variables, vertex only |
9047 | 4.34k | if (spvVersion.spv == 0) { |
9048 | 0 | BuiltInVariable("gl_Color", EbvColor, symbolTable); |
9049 | 0 | BuiltInVariable("gl_SecondaryColor", EbvSecondaryColor, symbolTable); |
9050 | 0 | BuiltInVariable("gl_Normal", EbvNormal, symbolTable); |
9051 | 0 | BuiltInVariable("gl_Vertex", EbvVertex, symbolTable); |
9052 | 0 | BuiltInVariable("gl_MultiTexCoord0", EbvMultiTexCoord0, symbolTable); |
9053 | 0 | BuiltInVariable("gl_MultiTexCoord1", EbvMultiTexCoord1, symbolTable); |
9054 | 0 | BuiltInVariable("gl_MultiTexCoord2", EbvMultiTexCoord2, symbolTable); |
9055 | 0 | BuiltInVariable("gl_MultiTexCoord3", EbvMultiTexCoord3, symbolTable); |
9056 | 0 | BuiltInVariable("gl_MultiTexCoord4", EbvMultiTexCoord4, symbolTable); |
9057 | 0 | BuiltInVariable("gl_MultiTexCoord5", EbvMultiTexCoord5, symbolTable); |
9058 | 0 | BuiltInVariable("gl_MultiTexCoord6", EbvMultiTexCoord6, symbolTable); |
9059 | 0 | BuiltInVariable("gl_MultiTexCoord7", EbvMultiTexCoord7, symbolTable); |
9060 | 0 | BuiltInVariable("gl_FogCoord", EbvFogFragCoord, symbolTable); |
9061 | 0 | } |
9062 | | |
9063 | 4.34k | if (profile == EEsProfile) { |
9064 | 259 | if (spvVersion.spv == 0) { |
9065 | 0 | symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &E_GL_EXT_shader_texture_lod); |
9066 | 0 | symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod); |
9067 | 0 | symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &E_GL_EXT_shader_texture_lod); |
9068 | 0 | if (version == 310) |
9069 | 0 | symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5); |
9070 | 0 | } |
9071 | 259 | if (version == 310) { |
9072 | 215 | symbolTable.setFunctionExtensions("fma", Num_AEP_gpu_shader5, AEP_gpu_shader5); |
9073 | 215 | } else if (profile != EEsProfile && version >= 150) { |
9074 | 0 | symbolTable.setFunctionExtensions("fma", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9075 | 0 | } |
9076 | 259 | } |
9077 | | |
9078 | 4.34k | if (profile == EEsProfile && version < 320) { |
9079 | 215 | symbolTable.setFunctionExtensions("imageAtomicAdd", 1, &E_GL_OES_shader_image_atomic); |
9080 | 215 | symbolTable.setFunctionExtensions("imageAtomicMin", 1, &E_GL_OES_shader_image_atomic); |
9081 | 215 | symbolTable.setFunctionExtensions("imageAtomicMax", 1, &E_GL_OES_shader_image_atomic); |
9082 | 215 | symbolTable.setFunctionExtensions("imageAtomicAnd", 1, &E_GL_OES_shader_image_atomic); |
9083 | 215 | symbolTable.setFunctionExtensions("imageAtomicOr", 1, &E_GL_OES_shader_image_atomic); |
9084 | 215 | symbolTable.setFunctionExtensions("imageAtomicXor", 1, &E_GL_OES_shader_image_atomic); |
9085 | 215 | symbolTable.setFunctionExtensions("imageAtomicExchange", 1, &E_GL_OES_shader_image_atomic); |
9086 | 215 | symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic); |
9087 | 215 | } |
9088 | | |
9089 | 4.34k | if (version >= 300 /* both ES and non-ES */) { |
9090 | 1.84k | symbolTable.setVariableExtensions("gl_ViewID_OVR", Num_OVR_multiview_EXTs, OVR_multiview_EXTs); |
9091 | 1.84k | BuiltInVariable("gl_ViewID_OVR", EbvViewIndex, symbolTable); |
9092 | 1.84k | } |
9093 | | |
9094 | 4.34k | if (profile == EEsProfile) { |
9095 | 259 | symbolTable.setFunctionExtensions("shadow2DEXT", 1, &E_GL_EXT_shadow_samplers); |
9096 | 259 | symbolTable.setFunctionExtensions("shadow2DProjEXT", 1, &E_GL_EXT_shadow_samplers); |
9097 | 259 | } |
9098 | | |
9099 | | // E_GL_EXT_texture_array |
9100 | 4.34k | if (profile != EEsProfile && spvVersion.spv == 0) { |
9101 | 0 | symbolTable.setFunctionExtensions("texture1DArray", 1, &E_GL_EXT_texture_array); |
9102 | 0 | symbolTable.setFunctionExtensions("texture2DArray", 1, &E_GL_EXT_texture_array); |
9103 | 0 | symbolTable.setFunctionExtensions("shadow1DArray", 1, &E_GL_EXT_texture_array); |
9104 | 0 | symbolTable.setFunctionExtensions("shadow2DArray", 1, &E_GL_EXT_texture_array); |
9105 | |
|
9106 | 0 | symbolTable.setFunctionExtensions("texture1DArrayLod", 1, &E_GL_EXT_texture_array); |
9107 | 0 | symbolTable.setFunctionExtensions("texture2DArrayLod", 1, &E_GL_EXT_texture_array); |
9108 | 0 | symbolTable.setFunctionExtensions("shadow1DArrayLod", 1, &E_GL_EXT_texture_array); |
9109 | 0 | } |
9110 | 4.34k | [[fallthrough]]; |
9111 | | |
9112 | 6.36k | case EShLangTessControl: |
9113 | 6.36k | if (profile == EEsProfile && version >= 310) { |
9114 | 518 | BuiltInVariable("gl_BoundingBoxEXT", EbvBoundingBox, symbolTable); |
9115 | 518 | symbolTable.setVariableExtensions("gl_BoundingBoxEXT", 1, |
9116 | 518 | &E_GL_EXT_primitive_bounding_box); |
9117 | 518 | BuiltInVariable("gl_BoundingBoxOES", EbvBoundingBox, symbolTable); |
9118 | 518 | symbolTable.setVariableExtensions("gl_BoundingBoxOES", 1, |
9119 | 518 | &E_GL_OES_primitive_bounding_box); |
9120 | | |
9121 | 518 | if (version >= 320) { |
9122 | 88 | BuiltInVariable("gl_BoundingBox", EbvBoundingBox, symbolTable); |
9123 | 88 | } |
9124 | 518 | } |
9125 | 6.36k | [[fallthrough]]; |
9126 | | |
9127 | 8.39k | case EShLangTessEvaluation: |
9128 | 10.4k | case EShLangGeometry: |
9129 | 10.4k | SpecialQualifier("gl_Position", EvqPosition, EbvPosition, symbolTable); |
9130 | 10.4k | SpecialQualifier("gl_PointSize", EvqPointSize, EbvPointSize, symbolTable); |
9131 | | |
9132 | 10.4k | BuiltInVariable("gl_in", "gl_Position", EbvPosition, symbolTable); |
9133 | 10.4k | BuiltInVariable("gl_in", "gl_PointSize", EbvPointSize, symbolTable); |
9134 | | |
9135 | 10.4k | BuiltInVariable("gl_out", "gl_Position", EbvPosition, symbolTable); |
9136 | 10.4k | BuiltInVariable("gl_out", "gl_PointSize", EbvPointSize, symbolTable); |
9137 | | |
9138 | 10.4k | SpecialQualifier("gl_ClipVertex", EvqClipVertex, EbvClipVertex, symbolTable); |
9139 | | |
9140 | 10.4k | BuiltInVariable("gl_in", "gl_ClipDistance", EbvClipDistance, symbolTable); |
9141 | 10.4k | BuiltInVariable("gl_in", "gl_CullDistance", EbvCullDistance, symbolTable); |
9142 | | |
9143 | 10.4k | BuiltInVariable("gl_out", "gl_ClipDistance", EbvClipDistance, symbolTable); |
9144 | 10.4k | BuiltInVariable("gl_out", "gl_CullDistance", EbvCullDistance, symbolTable); |
9145 | | |
9146 | 10.4k | BuiltInVariable("gl_ClipDistance", EbvClipDistance, symbolTable); |
9147 | 10.4k | BuiltInVariable("gl_CullDistance", EbvCullDistance, symbolTable); |
9148 | 10.4k | BuiltInVariable("gl_PrimitiveIDIn", EbvPrimitiveId, symbolTable); |
9149 | 10.4k | BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); |
9150 | 10.4k | BuiltInVariable("gl_InvocationID", EbvInvocationId, symbolTable); |
9151 | 10.4k | BuiltInVariable("gl_Layer", EbvLayer, symbolTable); |
9152 | 10.4k | BuiltInVariable("gl_ViewportIndex", EbvViewportIndex, symbolTable); |
9153 | | |
9154 | 10.4k | if (language != EShLangGeometry) { |
9155 | 8.39k | symbolTable.setVariableExtensions("gl_Layer", Num_viewportEXTs, viewportEXTs); |
9156 | 8.39k | symbolTable.setVariableExtensions("gl_ViewportIndex", Num_viewportEXTs, viewportEXTs); |
9157 | 8.39k | } |
9158 | 10.4k | symbolTable.setVariableExtensions("gl_ViewportMask", 1, &E_GL_NV_viewport_array2); |
9159 | 10.4k | symbolTable.setVariableExtensions("gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); |
9160 | 10.4k | symbolTable.setVariableExtensions("gl_SecondaryViewportMaskNV", 1, &E_GL_NV_stereo_view_rendering); |
9161 | 10.4k | symbolTable.setVariableExtensions("gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); |
9162 | 10.4k | symbolTable.setVariableExtensions("gl_ViewportMaskPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); |
9163 | | |
9164 | 10.4k | if (profile != EEsProfile && language == EShLangGeometry && version < 400) { |
9165 | 336 | symbolTable.setVariableExtensions("gl_InvocationID", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9166 | 336 | } |
9167 | 10.4k | BuiltInVariable("gl_ViewportMask", EbvViewportMaskNV, symbolTable); |
9168 | 10.4k | BuiltInVariable("gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); |
9169 | 10.4k | BuiltInVariable("gl_SecondaryViewportMaskNV", EbvSecondaryViewportMaskNV, symbolTable); |
9170 | 10.4k | BuiltInVariable("gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); |
9171 | 10.4k | BuiltInVariable("gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable); |
9172 | | |
9173 | 10.4k | if (language == EShLangVertex || language == EShLangGeometry) { |
9174 | 6.36k | symbolTable.setVariableExtensions("gl_in", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); |
9175 | 6.36k | symbolTable.setVariableExtensions("gl_in", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); |
9176 | | |
9177 | 6.36k | BuiltInVariable("gl_in", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); |
9178 | 6.36k | BuiltInVariable("gl_in", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); |
9179 | 6.36k | } |
9180 | 10.4k | symbolTable.setVariableExtensions("gl_out", "gl_ViewportMask", 1, &E_GL_NV_viewport_array2); |
9181 | 10.4k | symbolTable.setVariableExtensions("gl_out", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); |
9182 | 10.4k | symbolTable.setVariableExtensions("gl_out", "gl_SecondaryViewportMaskNV", 1, &E_GL_NV_stereo_view_rendering); |
9183 | 10.4k | symbolTable.setVariableExtensions("gl_out", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); |
9184 | 10.4k | symbolTable.setVariableExtensions("gl_out", "gl_ViewportMaskPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); |
9185 | | |
9186 | 10.4k | BuiltInVariable("gl_out", "gl_ViewportMask", EbvViewportMaskNV, symbolTable); |
9187 | 10.4k | BuiltInVariable("gl_out", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); |
9188 | 10.4k | BuiltInVariable("gl_out", "gl_SecondaryViewportMaskNV", EbvSecondaryViewportMaskNV, symbolTable); |
9189 | 10.4k | BuiltInVariable("gl_out", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); |
9190 | 10.4k | BuiltInVariable("gl_out", "gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable); |
9191 | | |
9192 | 10.4k | BuiltInVariable("gl_PatchVerticesIn", EbvPatchVertices, symbolTable); |
9193 | 10.4k | BuiltInVariable("gl_TessLevelOuter", EbvTessLevelOuter, symbolTable); |
9194 | 10.4k | BuiltInVariable("gl_TessLevelInner", EbvTessLevelInner, symbolTable); |
9195 | 10.4k | BuiltInVariable("gl_TessCoord", EbvTessCoord, symbolTable); |
9196 | | |
9197 | 10.4k | if (version < 410) |
9198 | 5.44k | symbolTable.setVariableExtensions("gl_ViewportIndex", 1, &E_GL_ARB_viewport_array); |
9199 | | |
9200 | | // Compatibility variables |
9201 | | |
9202 | 10.4k | BuiltInVariable("gl_in", "gl_ClipVertex", EbvClipVertex, symbolTable); |
9203 | 10.4k | BuiltInVariable("gl_in", "gl_FrontColor", EbvFrontColor, symbolTable); |
9204 | 10.4k | BuiltInVariable("gl_in", "gl_BackColor", EbvBackColor, symbolTable); |
9205 | 10.4k | BuiltInVariable("gl_in", "gl_FrontSecondaryColor", EbvFrontSecondaryColor, symbolTable); |
9206 | 10.4k | BuiltInVariable("gl_in", "gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable); |
9207 | 10.4k | BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable); |
9208 | 10.4k | BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); |
9209 | | |
9210 | 10.4k | BuiltInVariable("gl_out", "gl_ClipVertex", EbvClipVertex, symbolTable); |
9211 | 10.4k | BuiltInVariable("gl_out", "gl_FrontColor", EbvFrontColor, symbolTable); |
9212 | 10.4k | BuiltInVariable("gl_out", "gl_BackColor", EbvBackColor, symbolTable); |
9213 | 10.4k | BuiltInVariable("gl_out", "gl_FrontSecondaryColor", EbvFrontSecondaryColor, symbolTable); |
9214 | 10.4k | BuiltInVariable("gl_out", "gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable); |
9215 | 10.4k | BuiltInVariable("gl_out", "gl_TexCoord", EbvTexCoord, symbolTable); |
9216 | 10.4k | BuiltInVariable("gl_out", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); |
9217 | | |
9218 | 10.4k | BuiltInVariable("gl_ClipVertex", EbvClipVertex, symbolTable); |
9219 | 10.4k | BuiltInVariable("gl_FrontColor", EbvFrontColor, symbolTable); |
9220 | 10.4k | BuiltInVariable("gl_BackColor", EbvBackColor, symbolTable); |
9221 | 10.4k | BuiltInVariable("gl_FrontSecondaryColor", EbvFrontSecondaryColor, symbolTable); |
9222 | 10.4k | BuiltInVariable("gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable); |
9223 | 10.4k | BuiltInVariable("gl_TexCoord", EbvTexCoord, symbolTable); |
9224 | 10.4k | BuiltInVariable("gl_FogFragCoord", EbvFogFragCoord, symbolTable); |
9225 | | |
9226 | | // gl_PointSize, when it needs to be tied to an extension, is always a member of a block. |
9227 | | // (Sometimes with an instance name, sometimes anonymous). |
9228 | 10.4k | if (profile == EEsProfile) { |
9229 | 1.03k | if (language == EShLangGeometry) { |
9230 | 259 | symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size); |
9231 | 259 | symbolTable.setVariableExtensions("gl_in", "gl_PointSize", Num_AEP_geometry_point_size, AEP_geometry_point_size); |
9232 | 777 | } else if (language == EShLangTessEvaluation || language == EShLangTessControl) { |
9233 | | // gl_in tessellation settings of gl_PointSize are in the context-dependent paths |
9234 | 518 | symbolTable.setVariableExtensions("gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); |
9235 | 518 | symbolTable.setVariableExtensions("gl_out", "gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); |
9236 | 518 | } |
9237 | 1.03k | } |
9238 | | |
9239 | 10.4k | if ((profile != EEsProfile && version >= 140) || |
9240 | 10.4k | (profile == EEsProfile && version >= 310)) { |
9241 | 10.4k | symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); |
9242 | 10.4k | BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); |
9243 | 10.4k | symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); |
9244 | 10.4k | BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); |
9245 | 10.4k | } |
9246 | | |
9247 | 10.4k | if (profile != EEsProfile) { |
9248 | 9.38k | BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); |
9249 | 9.38k | BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); |
9250 | 9.38k | BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); |
9251 | 9.38k | BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); |
9252 | 9.38k | BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); |
9253 | 9.38k | BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); |
9254 | | |
9255 | 9.38k | if (spvVersion.vulkan > 0) { |
9256 | | // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan |
9257 | 9.38k | SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); |
9258 | 9.38k | if (language == EShLangFragment) |
9259 | 0 | ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); |
9260 | 9.38k | } |
9261 | 0 | else |
9262 | 0 | BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); |
9263 | 9.38k | } |
9264 | | |
9265 | | // GL_ARB_gpu_shader5/GL_NV_gpu_shader5 |
9266 | 10.4k | if (profile != EEsProfile && version < 400 && language == EShLangGeometry) { |
9267 | 336 | symbolTable.setFunctionExtensions("EmitStreamVertex", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9268 | 336 | symbolTable.setFunctionExtensions("EndStreamPrimitive", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9269 | 336 | } |
9270 | | // GL_KHR_shader_subgroup |
9271 | 10.4k | if ((profile == EEsProfile && version >= 310) || |
9272 | 10.4k | (profile != EEsProfile && version >= 140)) { |
9273 | 10.4k | symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); |
9274 | 10.4k | symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); |
9275 | 10.4k | symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9276 | 10.4k | symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9277 | 10.4k | symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9278 | 10.4k | symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9279 | 10.4k | symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9280 | | |
9281 | 10.4k | BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); |
9282 | 10.4k | BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); |
9283 | 10.4k | BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); |
9284 | 10.4k | BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); |
9285 | 10.4k | BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); |
9286 | 10.4k | BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); |
9287 | 10.4k | BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); |
9288 | | |
9289 | | // GL_NV_shader_sm_builtins |
9290 | 10.4k | symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); |
9291 | 10.4k | symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); |
9292 | 10.4k | symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); |
9293 | 10.4k | symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); |
9294 | 10.4k | BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); |
9295 | 10.4k | BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); |
9296 | 10.4k | BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); |
9297 | 10.4k | BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); |
9298 | | |
9299 | | // GL_ARM_shader_core_builtins |
9300 | 10.4k | symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); |
9301 | 10.4k | symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); |
9302 | 10.4k | symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
9303 | 10.4k | symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); |
9304 | 10.4k | symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
9305 | | |
9306 | 10.4k | BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); |
9307 | 10.4k | BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); |
9308 | 10.4k | BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); |
9309 | 10.4k | BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); |
9310 | 10.4k | BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); |
9311 | 10.4k | } |
9312 | | |
9313 | 10.4k | if (language == EShLangGeometry || language == EShLangVertex) { |
9314 | 6.36k | if ((profile == EEsProfile && version >= 310) || |
9315 | 5.85k | (profile != EEsProfile && version >= 450)) { |
9316 | 2.28k | symbolTable.setVariableExtensions("gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9317 | 2.28k | BuiltInVariable("gl_PrimitiveShadingRateEXT", EbvPrimitiveShadingRateKHR, symbolTable); |
9318 | | |
9319 | 2.28k | symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9320 | 2.28k | symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9321 | 2.28k | symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9322 | 2.28k | symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9323 | 2.28k | } |
9324 | 6.36k | } |
9325 | 10.4k | break; |
9326 | | |
9327 | 4.34k | case EShLangFragment: |
9328 | 4.34k | SpecialQualifier("gl_FrontFacing", EvqFace, EbvFace, symbolTable); |
9329 | 4.34k | SpecialQualifier("gl_FragCoord", EvqFragCoord, EbvFragCoord, symbolTable); |
9330 | 4.34k | SpecialQualifier("gl_PointCoord", EvqPointCoord, EbvPointCoord, symbolTable); |
9331 | 4.34k | if (spvVersion.spv == 0) |
9332 | 0 | SpecialQualifier("gl_FragColor", EvqFragColor, EbvFragColor, symbolTable); |
9333 | 4.34k | else { |
9334 | 4.34k | TSymbol* symbol = symbolTable.find("gl_FragColor"); |
9335 | 4.34k | if (symbol) { |
9336 | 2.84k | symbol->getWritableType().getQualifier().storage = EvqVaryingOut; |
9337 | 2.84k | symbol->getWritableType().getQualifier().layoutLocation = 0; |
9338 | 2.84k | } |
9339 | 4.34k | } |
9340 | 4.34k | SpecialQualifier("gl_FragDepth", EvqFragDepth, EbvFragDepth, symbolTable); |
9341 | 4.34k | SpecialQualifier("gl_FragDepthEXT", EvqFragDepth, EbvFragDepth, symbolTable); |
9342 | 4.34k | SpecialQualifier("gl_FragStencilRefARB", EvqFragStencil, EbvFragStencilRef, symbolTable); |
9343 | 4.34k | SpecialQualifier("gl_HelperInvocation", EvqVaryingIn, EbvHelperInvocation, symbolTable); |
9344 | | |
9345 | 4.34k | BuiltInVariable("gl_ClipDistance", EbvClipDistance, symbolTable); |
9346 | 4.34k | BuiltInVariable("gl_CullDistance", EbvCullDistance, symbolTable); |
9347 | 4.34k | BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); |
9348 | | |
9349 | 4.34k | if (profile != EEsProfile && version >= 140) { |
9350 | 4.08k | symbolTable.setVariableExtensions("gl_FragStencilRefARB", 1, &E_GL_ARB_shader_stencil_export); |
9351 | 4.08k | BuiltInVariable("gl_FragStencilRefARB", EbvFragStencilRef, symbolTable); |
9352 | 4.08k | } |
9353 | | |
9354 | 4.34k | if (profile != EEsProfile && version < 400) { |
9355 | 2.64k | symbolTable.setFunctionExtensions("textureQueryLOD", 1, &E_GL_ARB_texture_query_lod); |
9356 | 2.64k | } |
9357 | | |
9358 | 4.34k | if (profile != EEsProfile && version >= 460) { |
9359 | 108 | symbolTable.setFunctionExtensions("rayQueryInitializeEXT", 1, &E_GL_EXT_ray_query); |
9360 | 108 | symbolTable.setFunctionExtensions("rayQueryTerminateEXT", 1, &E_GL_EXT_ray_query); |
9361 | 108 | symbolTable.setFunctionExtensions("rayQueryGenerateIntersectionEXT", 1, &E_GL_EXT_ray_query); |
9362 | 108 | symbolTable.setFunctionExtensions("rayQueryConfirmIntersectionEXT", 1, &E_GL_EXT_ray_query); |
9363 | 108 | symbolTable.setFunctionExtensions("rayQueryProceedEXT", 1, &E_GL_EXT_ray_query); |
9364 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionTypeEXT", 1, &E_GL_EXT_ray_query); |
9365 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionTEXT", 1, &E_GL_EXT_ray_query); |
9366 | 108 | symbolTable.setFunctionExtensions("rayQueryGetRayFlagsEXT", 1, &E_GL_EXT_ray_query); |
9367 | 108 | symbolTable.setFunctionExtensions("rayQueryGetRayTMinEXT", 1, &E_GL_EXT_ray_query); |
9368 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionInstanceCustomIndexEXT", 1, &E_GL_EXT_ray_query); |
9369 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionInstanceIdEXT", 1, &E_GL_EXT_ray_query); |
9370 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT", 1, &E_GL_EXT_ray_query); |
9371 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionGeometryIndexEXT", 1, &E_GL_EXT_ray_query); |
9372 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionPrimitiveIndexEXT", 1, &E_GL_EXT_ray_query); |
9373 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionBarycentricsEXT", 1, &E_GL_EXT_ray_query); |
9374 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionFrontFaceEXT", 1, &E_GL_EXT_ray_query); |
9375 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionCandidateAABBOpaqueEXT", 1, &E_GL_EXT_ray_query); |
9376 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionObjectRayDirectionEXT", 1, &E_GL_EXT_ray_query); |
9377 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionObjectRayOriginEXT", 1, &E_GL_EXT_ray_query); |
9378 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionObjectToWorldEXT", 1, &E_GL_EXT_ray_query); |
9379 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionWorldToObjectEXT", 1, &E_GL_EXT_ray_query); |
9380 | 108 | symbolTable.setFunctionExtensions("rayQueryGetWorldRayOriginEXT", 1, &E_GL_EXT_ray_query); |
9381 | 108 | symbolTable.setFunctionExtensions("rayQueryGetWorldRayDirectionEXT", 1, &E_GL_EXT_ray_query); |
9382 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch); |
9383 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionClusterIdNV", 1, &E_GL_NV_cluster_acceleration_structure); |
9384 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionSpherePositionNV", 1, &E_GL_NV_linear_swept_spheres); |
9385 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionSphereRadiusNV", 1, &E_GL_NV_linear_swept_spheres); |
9386 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionLSSHitValueNV", 1, &E_GL_NV_linear_swept_spheres); |
9387 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionLSSPositionsNV", 1, &E_GL_NV_linear_swept_spheres); |
9388 | 108 | symbolTable.setFunctionExtensions("rayQueryGetIntersectionLSSRadiiNV", 1, &E_GL_NV_linear_swept_spheres); |
9389 | 108 | symbolTable.setFunctionExtensions("rayQueryIsSphereHitNV", 1, &E_GL_NV_linear_swept_spheres); |
9390 | 108 | symbolTable.setFunctionExtensions("rayQueryIsLSSHitNV", 1, &E_GL_NV_linear_swept_spheres); |
9391 | 108 | symbolTable.setVariableExtensions("gl_RayFlagsSkipAABBEXT", 1, &E_GL_EXT_ray_flags_primitive_culling); |
9392 | 108 | symbolTable.setVariableExtensions("gl_RayFlagsSkipTrianglesEXT", 1, &E_GL_EXT_ray_flags_primitive_culling); |
9393 | 108 | symbolTable.setVariableExtensions("gl_RayFlagsForceOpacityMicromap2StateEXT", 1, &E_GL_EXT_opacity_micromap); |
9394 | 108 | } |
9395 | | |
9396 | 4.34k | if ((profile != EEsProfile && version >= 130) || |
9397 | 4.34k | (profile == EEsProfile && version >= 310)) { |
9398 | 4.34k | BuiltInVariable("gl_SampleID", EbvSampleId, symbolTable); |
9399 | 4.34k | BuiltInVariable("gl_SamplePosition", EbvSamplePosition, symbolTable); |
9400 | 4.34k | BuiltInVariable("gl_SampleMask", EbvSampleMask, symbolTable); |
9401 | | |
9402 | 4.34k | if (profile != EEsProfile && version < 400) { |
9403 | 2.64k | BuiltInVariable("gl_SampleMaskIn", EbvSampleMask, symbolTable); |
9404 | 2.64k | symbolTable.setVariableExtensions("gl_SampleMaskIn", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9405 | | |
9406 | 2.64k | BuiltInVariable("gl_NumSamples", EbvSampleMask, symbolTable); |
9407 | | |
9408 | 2.64k | symbolTable.setVariableExtensions("gl_SampleMask", 1, &E_GL_ARB_sample_shading); |
9409 | 2.64k | symbolTable.setVariableExtensions("gl_SampleID", 1, &E_GL_ARB_sample_shading); |
9410 | 2.64k | symbolTable.setVariableExtensions("gl_SamplePosition", 1, &E_GL_ARB_sample_shading); |
9411 | 2.64k | symbolTable.setVariableExtensions("gl_NumSamples", 1, &E_GL_ARB_sample_shading); |
9412 | 2.64k | } else { |
9413 | 1.69k | BuiltInVariable("gl_SampleMaskIn", EbvSampleMask, symbolTable); |
9414 | | |
9415 | 1.69k | if (profile == EEsProfile && version < 320) { |
9416 | 215 | symbolTable.setVariableExtensions("gl_SampleID", 1, &E_GL_OES_sample_variables); |
9417 | 215 | symbolTable.setVariableExtensions("gl_SamplePosition", 1, &E_GL_OES_sample_variables); |
9418 | 215 | symbolTable.setVariableExtensions("gl_SampleMaskIn", 1, &E_GL_OES_sample_variables); |
9419 | 215 | symbolTable.setVariableExtensions("gl_SampleMask", 1, &E_GL_OES_sample_variables); |
9420 | 215 | symbolTable.setVariableExtensions("gl_NumSamples", 1, &E_GL_OES_sample_variables); |
9421 | 215 | } |
9422 | 1.69k | } |
9423 | 4.34k | } |
9424 | | |
9425 | 4.34k | BuiltInVariable("gl_Layer", EbvLayer, symbolTable); |
9426 | 4.34k | BuiltInVariable("gl_ViewportIndex", EbvViewportIndex, symbolTable); |
9427 | | |
9428 | | // Compatibility variables |
9429 | | |
9430 | 4.34k | BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); |
9431 | 4.34k | BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable); |
9432 | 4.34k | BuiltInVariable("gl_in", "gl_Color", EbvColor, symbolTable); |
9433 | 4.34k | BuiltInVariable("gl_in", "gl_SecondaryColor", EbvSecondaryColor, symbolTable); |
9434 | | |
9435 | 4.34k | BuiltInVariable("gl_FogFragCoord", EbvFogFragCoord, symbolTable); |
9436 | 4.34k | BuiltInVariable("gl_TexCoord", EbvTexCoord, symbolTable); |
9437 | 4.34k | BuiltInVariable("gl_Color", EbvColor, symbolTable); |
9438 | 4.34k | BuiltInVariable("gl_SecondaryColor", EbvSecondaryColor, symbolTable); |
9439 | | |
9440 | | // built-in functions |
9441 | | |
9442 | 4.34k | if (profile == EEsProfile) { |
9443 | 259 | if (spvVersion.spv == 0) { |
9444 | 0 | symbolTable.setFunctionExtensions("texture2DLodEXT", 1, &E_GL_EXT_shader_texture_lod); |
9445 | 0 | symbolTable.setFunctionExtensions("texture2DProjLodEXT", 1, &E_GL_EXT_shader_texture_lod); |
9446 | 0 | symbolTable.setFunctionExtensions("textureCubeLodEXT", 1, &E_GL_EXT_shader_texture_lod); |
9447 | 0 | symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &E_GL_EXT_shader_texture_lod); |
9448 | 0 | symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &E_GL_EXT_shader_texture_lod); |
9449 | 0 | symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &E_GL_EXT_shader_texture_lod); |
9450 | 0 | if (version < 320) |
9451 | 0 | symbolTable.setFunctionExtensions("textureGatherOffsets", Num_AEP_gpu_shader5, AEP_gpu_shader5); |
9452 | 0 | } |
9453 | 259 | if (version == 100) { |
9454 | 0 | symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_OES_standard_derivatives); |
9455 | 0 | symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_OES_standard_derivatives); |
9456 | 0 | symbolTable.setFunctionExtensions("fwidth", 1, &E_GL_OES_standard_derivatives); |
9457 | 0 | } |
9458 | 259 | if (version == 310) { |
9459 | 215 | symbolTable.setFunctionExtensions("fma", Num_AEP_gpu_shader5, AEP_gpu_shader5); |
9460 | 215 | symbolTable.setFunctionExtensions("interpolateAtCentroid", 1, &E_GL_OES_shader_multisample_interpolation); |
9461 | 215 | symbolTable.setFunctionExtensions("interpolateAtSample", 1, &E_GL_OES_shader_multisample_interpolation); |
9462 | 215 | symbolTable.setFunctionExtensions("interpolateAtOffset", 1, &E_GL_OES_shader_multisample_interpolation); |
9463 | 215 | } |
9464 | 4.08k | } else if (version < 130) { |
9465 | 0 | if (spvVersion.spv == 0) { |
9466 | 0 | symbolTable.setFunctionExtensions("texture1DLod", 1, &E_GL_ARB_shader_texture_lod); |
9467 | 0 | symbolTable.setFunctionExtensions("texture2DLod", 1, &E_GL_ARB_shader_texture_lod); |
9468 | 0 | symbolTable.setFunctionExtensions("texture3DLod", 1, &E_GL_ARB_shader_texture_lod); |
9469 | 0 | symbolTable.setFunctionExtensions("textureCubeLod", 1, &E_GL_ARB_shader_texture_lod); |
9470 | 0 | symbolTable.setFunctionExtensions("texture1DProjLod", 1, &E_GL_ARB_shader_texture_lod); |
9471 | 0 | symbolTable.setFunctionExtensions("texture2DProjLod", 1, &E_GL_ARB_shader_texture_lod); |
9472 | 0 | symbolTable.setFunctionExtensions("texture3DProjLod", 1, &E_GL_ARB_shader_texture_lod); |
9473 | 0 | symbolTable.setFunctionExtensions("shadow1DLod", 1, &E_GL_ARB_shader_texture_lod); |
9474 | 0 | symbolTable.setFunctionExtensions("shadow2DLod", 1, &E_GL_ARB_shader_texture_lod); |
9475 | 0 | symbolTable.setFunctionExtensions("shadow1DProjLod", 1, &E_GL_ARB_shader_texture_lod); |
9476 | 0 | symbolTable.setFunctionExtensions("shadow2DProjLod", 1, &E_GL_ARB_shader_texture_lod); |
9477 | 0 | } |
9478 | 0 | } |
9479 | | |
9480 | | // E_GL_ARB_shader_texture_lod functions usable only with the extension enabled |
9481 | 4.34k | if (profile != EEsProfile && spvVersion.spv == 0) { |
9482 | 0 | symbolTable.setFunctionExtensions("texture1DGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9483 | 0 | symbolTable.setFunctionExtensions("texture1DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9484 | 0 | symbolTable.setFunctionExtensions("texture2DGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9485 | 0 | symbolTable.setFunctionExtensions("texture2DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9486 | 0 | symbolTable.setFunctionExtensions("texture3DGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9487 | 0 | symbolTable.setFunctionExtensions("texture3DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9488 | 0 | symbolTable.setFunctionExtensions("textureCubeGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9489 | 0 | symbolTable.setFunctionExtensions("shadow1DGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9490 | 0 | symbolTable.setFunctionExtensions("shadow1DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9491 | 0 | symbolTable.setFunctionExtensions("shadow2DGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9492 | 0 | symbolTable.setFunctionExtensions("shadow2DProjGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9493 | 0 | symbolTable.setFunctionExtensions("texture2DRectGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9494 | 0 | symbolTable.setFunctionExtensions("texture2DRectProjGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9495 | 0 | symbolTable.setFunctionExtensions("shadow2DRectGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9496 | 0 | symbolTable.setFunctionExtensions("shadow2DRectProjGradARB", 1, &E_GL_ARB_shader_texture_lod); |
9497 | 0 | } |
9498 | | |
9499 | | // E_GL_ARB_shader_image_load_store |
9500 | 4.34k | if (profile != EEsProfile && version < 420) |
9501 | 2.83k | symbolTable.setFunctionExtensions("memoryBarrier", 1, &E_GL_ARB_shader_image_load_store); |
9502 | | // All the image access functions are protected by checks on the type of the first argument. |
9503 | | |
9504 | | // E_GL_ARB_shader_atomic_counters |
9505 | 4.34k | if (profile != EEsProfile && version < 420) { |
9506 | 2.83k | symbolTable.setFunctionExtensions("atomicCounterIncrement", 1, &E_GL_ARB_shader_atomic_counters); |
9507 | 2.83k | symbolTable.setFunctionExtensions("atomicCounterDecrement", 1, &E_GL_ARB_shader_atomic_counters); |
9508 | 2.83k | symbolTable.setFunctionExtensions("atomicCounter" , 1, &E_GL_ARB_shader_atomic_counters); |
9509 | 2.83k | } |
9510 | | |
9511 | | // E_GL_ARB_gpu_shader5/E_GL_NV_gpu_shader5 |
9512 | 4.34k | if (profile != EEsProfile && version < 400) { |
9513 | 2.64k | symbolTable.setFunctionExtensions("bitfieldExtract", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9514 | 2.64k | symbolTable.setFunctionExtensions("bitfieldInsert", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9515 | 2.64k | symbolTable.setFunctionExtensions("bitfieldReverse", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9516 | 2.64k | symbolTable.setFunctionExtensions("bitCount", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9517 | 2.64k | symbolTable.setFunctionExtensions("findLSB", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9518 | 2.64k | symbolTable.setFunctionExtensions("findMSB", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9519 | 2.64k | symbolTable.setFunctionExtensions("uaddCarry", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9520 | 2.64k | symbolTable.setFunctionExtensions("usubBorrow", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9521 | 2.64k | symbolTable.setFunctionExtensions("umulExtended", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9522 | 2.64k | symbolTable.setFunctionExtensions("imulExtended", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9523 | 2.64k | symbolTable.setFunctionExtensions("interpolateAtCentroid", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9524 | 2.64k | symbolTable.setFunctionExtensions("interpolateAtSample", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9525 | 2.64k | symbolTable.setFunctionExtensions("interpolateAtOffset", Num_AEP_core_gpu_shader5, AEP_core_gpu_shader5); |
9526 | 2.64k | } |
9527 | | |
9528 | | // E_GL_NV_gpu_shader5 |
9529 | 4.34k | if (profile != EEsProfile && version < 450) { |
9530 | 3.19k | symbolTable.setFunctionExtensions("packInt2x32", 1, &E_GL_NV_gpu_shader5); |
9531 | 3.19k | symbolTable.setFunctionExtensions("packUint2x32", 1, &E_GL_NV_gpu_shader5); |
9532 | 3.19k | symbolTable.setFunctionExtensions("unpackInt2x32", 1, &E_GL_NV_gpu_shader5); |
9533 | 3.19k | symbolTable.setFunctionExtensions("unpackUint2x32", 1, &E_GL_NV_gpu_shader5); |
9534 | 3.19k | symbolTable.setFunctionExtensions("packFloat2x16", 1, &E_GL_NV_gpu_shader5); |
9535 | 3.19k | symbolTable.setFunctionExtensions("unpackFloat2x16", 1, &E_GL_NV_gpu_shader5); |
9536 | 3.19k | symbolTable.setFunctionExtensions("doubleBitsToInt64", 1, &E_GL_NV_gpu_shader5); |
9537 | 3.19k | symbolTable.setFunctionExtensions("doubleBitsToUint64", 1, &E_GL_NV_gpu_shader5); |
9538 | 3.19k | symbolTable.setFunctionExtensions("int64BitsToDouble", 1, &E_GL_NV_gpu_shader5); |
9539 | 3.19k | symbolTable.setFunctionExtensions("uint64BitsToDouble", 1, &E_GL_NV_gpu_shader5); |
9540 | 3.19k | } |
9541 | | |
9542 | | // E_GL_ARB_shader_atomic_counter_ops |
9543 | 4.34k | if (profile != EEsProfile && version == 450) { |
9544 | 775 | symbolTable.setFunctionExtensions("atomicCounterAddARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); |
9545 | 775 | symbolTable.setFunctionExtensions("atomicCounterSubtractARB", 1, &E_GL_ARB_shader_atomic_counter_ops); |
9546 | 775 | symbolTable.setFunctionExtensions("atomicCounterMinARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); |
9547 | 775 | symbolTable.setFunctionExtensions("atomicCounterMaxARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); |
9548 | 775 | symbolTable.setFunctionExtensions("atomicCounterAndARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); |
9549 | 775 | symbolTable.setFunctionExtensions("atomicCounterOrARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); |
9550 | 775 | symbolTable.setFunctionExtensions("atomicCounterXorARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); |
9551 | 775 | symbolTable.setFunctionExtensions("atomicCounterExchangeARB", 1, &E_GL_ARB_shader_atomic_counter_ops); |
9552 | 775 | symbolTable.setFunctionExtensions("atomicCounterCompSwapARB", 1, &E_GL_ARB_shader_atomic_counter_ops); |
9553 | 775 | } |
9554 | | |
9555 | | // E_GL_ARB_derivative_control |
9556 | 4.34k | if (profile != EEsProfile && version < 450) { |
9557 | 3.19k | symbolTable.setFunctionExtensions("dFdxFine", 1, &E_GL_ARB_derivative_control); |
9558 | 3.19k | symbolTable.setFunctionExtensions("dFdyFine", 1, &E_GL_ARB_derivative_control); |
9559 | 3.19k | symbolTable.setFunctionExtensions("fwidthFine", 1, &E_GL_ARB_derivative_control); |
9560 | 3.19k | symbolTable.setFunctionExtensions("dFdxCoarse", 1, &E_GL_ARB_derivative_control); |
9561 | 3.19k | symbolTable.setFunctionExtensions("dFdyCoarse", 1, &E_GL_ARB_derivative_control); |
9562 | 3.19k | symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_ARB_derivative_control); |
9563 | 3.19k | } |
9564 | | |
9565 | | // E_GL_ARB_sparse_texture2 |
9566 | 4.34k | if (profile != EEsProfile) |
9567 | 4.08k | { |
9568 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureARB", 1, &E_GL_ARB_sparse_texture2); |
9569 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureLodARB", 1, &E_GL_ARB_sparse_texture2); |
9570 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureOffsetARB", 1, &E_GL_ARB_sparse_texture2); |
9571 | 4.08k | symbolTable.setFunctionExtensions("sparseTexelFetchARB", 1, &E_GL_ARB_sparse_texture2); |
9572 | 4.08k | symbolTable.setFunctionExtensions("sparseTexelFetchOffsetARB", 1, &E_GL_ARB_sparse_texture2); |
9573 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureLodOffsetARB", 1, &E_GL_ARB_sparse_texture2); |
9574 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGradARB", 1, &E_GL_ARB_sparse_texture2); |
9575 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGradOffsetARB", 1, &E_GL_ARB_sparse_texture2); |
9576 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGatherARB", 1, &E_GL_ARB_sparse_texture2); |
9577 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGatherOffsetARB", 1, &E_GL_ARB_sparse_texture2); |
9578 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGatherOffsetsARB", 1, &E_GL_ARB_sparse_texture2); |
9579 | 4.08k | symbolTable.setFunctionExtensions("sparseImageLoadARB", 1, &E_GL_ARB_sparse_texture2); |
9580 | 4.08k | symbolTable.setFunctionExtensions("sparseTexelsResident", 1, &E_GL_ARB_sparse_texture2); |
9581 | 4.08k | } |
9582 | | |
9583 | | // E_GL_ARB_sparse_texture_clamp |
9584 | 4.34k | if (profile != EEsProfile) |
9585 | 4.08k | { |
9586 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureClampARB", 1, &E_GL_ARB_sparse_texture_clamp); |
9587 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); |
9588 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGradClampARB", 1, &E_GL_ARB_sparse_texture_clamp); |
9589 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); |
9590 | 4.08k | symbolTable.setFunctionExtensions("textureClampARB", 1, &E_GL_ARB_sparse_texture_clamp); |
9591 | 4.08k | symbolTable.setFunctionExtensions("textureOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); |
9592 | 4.08k | symbolTable.setFunctionExtensions("textureGradClampARB", 1, &E_GL_ARB_sparse_texture_clamp); |
9593 | 4.08k | symbolTable.setFunctionExtensions("textureGradOffsetClampARB", 1, &E_GL_ARB_sparse_texture_clamp); |
9594 | 4.08k | } |
9595 | | |
9596 | | // E_GL_AMD_shader_explicit_vertex_parameter |
9597 | 4.34k | if (profile != EEsProfile) { |
9598 | 4.08k | symbolTable.setVariableExtensions("gl_BaryCoordNoPerspAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); |
9599 | 4.08k | symbolTable.setVariableExtensions("gl_BaryCoordNoPerspCentroidAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); |
9600 | 4.08k | symbolTable.setVariableExtensions("gl_BaryCoordNoPerspSampleAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); |
9601 | 4.08k | symbolTable.setVariableExtensions("gl_BaryCoordSmoothAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); |
9602 | 4.08k | symbolTable.setVariableExtensions("gl_BaryCoordSmoothCentroidAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); |
9603 | 4.08k | symbolTable.setVariableExtensions("gl_BaryCoordSmoothSampleAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); |
9604 | 4.08k | symbolTable.setVariableExtensions("gl_BaryCoordPullModelAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); |
9605 | | |
9606 | 4.08k | symbolTable.setFunctionExtensions("interpolateAtVertexAMD", 1, &E_GL_AMD_shader_explicit_vertex_parameter); |
9607 | | |
9608 | 4.08k | BuiltInVariable("gl_BaryCoordNoPerspAMD", EbvBaryCoordNoPersp, symbolTable); |
9609 | 4.08k | BuiltInVariable("gl_BaryCoordNoPerspCentroidAMD", EbvBaryCoordNoPerspCentroid, symbolTable); |
9610 | 4.08k | BuiltInVariable("gl_BaryCoordNoPerspSampleAMD", EbvBaryCoordNoPerspSample, symbolTable); |
9611 | 4.08k | BuiltInVariable("gl_BaryCoordSmoothAMD", EbvBaryCoordSmooth, symbolTable); |
9612 | 4.08k | BuiltInVariable("gl_BaryCoordSmoothCentroidAMD", EbvBaryCoordSmoothCentroid, symbolTable); |
9613 | 4.08k | BuiltInVariable("gl_BaryCoordSmoothSampleAMD", EbvBaryCoordSmoothSample, symbolTable); |
9614 | 4.08k | BuiltInVariable("gl_BaryCoordPullModelAMD", EbvBaryCoordPullModel, symbolTable); |
9615 | 4.08k | } |
9616 | | |
9617 | | // E_GL_AMD_texture_gather_bias_lod |
9618 | 4.34k | if (profile != EEsProfile) { |
9619 | 4.08k | symbolTable.setFunctionExtensions("textureGatherLodAMD", 1, &E_GL_AMD_texture_gather_bias_lod); |
9620 | 4.08k | symbolTable.setFunctionExtensions("textureGatherLodOffsetAMD", 1, &E_GL_AMD_texture_gather_bias_lod); |
9621 | 4.08k | symbolTable.setFunctionExtensions("textureGatherLodOffsetsAMD", 1, &E_GL_AMD_texture_gather_bias_lod); |
9622 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGatherLodAMD", 1, &E_GL_AMD_texture_gather_bias_lod); |
9623 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGatherLodOffsetAMD", 1, &E_GL_AMD_texture_gather_bias_lod); |
9624 | 4.08k | symbolTable.setFunctionExtensions("sparseTextureGatherLodOffsetsAMD", 1, &E_GL_AMD_texture_gather_bias_lod); |
9625 | 4.08k | } |
9626 | | |
9627 | | // E_GL_AMD_shader_image_load_store_lod |
9628 | 4.34k | if (profile != EEsProfile) { |
9629 | 4.08k | symbolTable.setFunctionExtensions("imageLoadLodAMD", 1, &E_GL_AMD_shader_image_load_store_lod); |
9630 | 4.08k | symbolTable.setFunctionExtensions("imageStoreLodAMD", 1, &E_GL_AMD_shader_image_load_store_lod); |
9631 | 4.08k | symbolTable.setFunctionExtensions("sparseImageLoadLodAMD", 1, &E_GL_AMD_shader_image_load_store_lod); |
9632 | 4.08k | } |
9633 | 4.34k | if (profile != EEsProfile && version >= 430) { |
9634 | 1.22k | symbolTable.setVariableExtensions("gl_FragFullyCoveredNV", 1, &E_GL_NV_conservative_raster_underestimation); |
9635 | 1.22k | BuiltInVariable("gl_FragFullyCoveredNV", EbvFragFullyCoveredNV, symbolTable); |
9636 | 1.22k | } |
9637 | 4.34k | if ((profile != EEsProfile && version >= 450) || |
9638 | 3.45k | (profile == EEsProfile && version >= 320)) { |
9639 | 927 | symbolTable.setVariableExtensions("gl_FragmentSizeNV", 1, &E_GL_NV_shading_rate_image); |
9640 | 927 | symbolTable.setVariableExtensions("gl_InvocationsPerPixelNV", 1, &E_GL_NV_shading_rate_image); |
9641 | 927 | BuiltInVariable("gl_FragmentSizeNV", EbvFragmentSizeNV, symbolTable); |
9642 | 927 | BuiltInVariable("gl_InvocationsPerPixelNV", EbvInvocationsPerPixelNV, symbolTable); |
9643 | 927 | symbolTable.setVariableExtensions("gl_BaryCoordNV", 1, &E_GL_NV_fragment_shader_barycentric); |
9644 | 927 | symbolTable.setVariableExtensions("gl_BaryCoordNoPerspNV", 1, &E_GL_NV_fragment_shader_barycentric); |
9645 | 927 | BuiltInVariable("gl_BaryCoordNV", EbvBaryCoordNV, symbolTable); |
9646 | 927 | BuiltInVariable("gl_BaryCoordNoPerspNV", EbvBaryCoordNoPerspNV, symbolTable); |
9647 | 927 | symbolTable.setVariableExtensions("gl_BaryCoordEXT", 1, &E_GL_EXT_fragment_shader_barycentric); |
9648 | 927 | symbolTable.setVariableExtensions("gl_BaryCoordNoPerspEXT", 1, &E_GL_EXT_fragment_shader_barycentric); |
9649 | 927 | BuiltInVariable("gl_BaryCoordEXT", EbvBaryCoordEXT, symbolTable); |
9650 | 927 | BuiltInVariable("gl_BaryCoordNoPerspEXT", EbvBaryCoordNoPerspEXT, symbolTable); |
9651 | 927 | } |
9652 | | |
9653 | 4.34k | if ((profile != EEsProfile && version >= 450) || |
9654 | 3.45k | (profile == EEsProfile && version >= 310)) { |
9655 | 1.14k | symbolTable.setVariableExtensions("gl_FragSizeEXT", 1, &E_GL_EXT_fragment_invocation_density); |
9656 | 1.14k | symbolTable.setVariableExtensions("gl_FragInvocationCountEXT", 1, &E_GL_EXT_fragment_invocation_density); |
9657 | 1.14k | BuiltInVariable("gl_FragSizeEXT", EbvFragSizeEXT, symbolTable); |
9658 | 1.14k | BuiltInVariable("gl_FragInvocationCountEXT", EbvFragInvocationCountEXT, symbolTable); |
9659 | 1.14k | } |
9660 | | |
9661 | 4.34k | symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &E_GL_EXT_frag_depth); |
9662 | | |
9663 | 4.34k | symbolTable.setFunctionExtensions("clockARB", 1, &E_GL_ARB_shader_clock); |
9664 | 4.34k | symbolTable.setFunctionExtensions("clock2x32ARB", 1, &E_GL_ARB_shader_clock); |
9665 | | |
9666 | 4.34k | symbolTable.setFunctionExtensions("clockRealtimeEXT", 1, &E_GL_EXT_shader_realtime_clock); |
9667 | 4.34k | symbolTable.setFunctionExtensions("clockRealtime2x32EXT", 1, &E_GL_EXT_shader_realtime_clock); |
9668 | | |
9669 | 4.34k | if (profile == EEsProfile && version < 320) { |
9670 | 215 | symbolTable.setVariableExtensions("gl_PrimitiveID", Num_AEP_geometry_shader, AEP_geometry_shader); |
9671 | 215 | symbolTable.setVariableExtensions("gl_Layer", Num_AEP_geometry_shader, AEP_geometry_shader); |
9672 | 215 | } |
9673 | | |
9674 | 4.34k | if (profile == EEsProfile && version < 320) { |
9675 | 215 | symbolTable.setFunctionExtensions("imageAtomicAdd", 1, &E_GL_OES_shader_image_atomic); |
9676 | 215 | symbolTable.setFunctionExtensions("imageAtomicMin", 1, &E_GL_OES_shader_image_atomic); |
9677 | 215 | symbolTable.setFunctionExtensions("imageAtomicMax", 1, &E_GL_OES_shader_image_atomic); |
9678 | 215 | symbolTable.setFunctionExtensions("imageAtomicAnd", 1, &E_GL_OES_shader_image_atomic); |
9679 | 215 | symbolTable.setFunctionExtensions("imageAtomicOr", 1, &E_GL_OES_shader_image_atomic); |
9680 | 215 | symbolTable.setFunctionExtensions("imageAtomicXor", 1, &E_GL_OES_shader_image_atomic); |
9681 | 215 | symbolTable.setFunctionExtensions("imageAtomicExchange", 1, &E_GL_OES_shader_image_atomic); |
9682 | 215 | symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic); |
9683 | 215 | } |
9684 | | |
9685 | 4.34k | if (profile != EEsProfile && version < 330 ) { |
9686 | 2.49k | const int numBitEncodingExts = 3; |
9687 | 2.49k | const char* bitEncodingExts[numBitEncodingExts] = { E_GL_ARB_shader_bit_encoding, |
9688 | 2.49k | E_GL_ARB_gpu_shader5, |
9689 | 2.49k | E_GL_NV_gpu_shader5}; |
9690 | 2.49k | symbolTable.setFunctionExtensions("floatBitsToInt", numBitEncodingExts, bitEncodingExts); |
9691 | 2.49k | symbolTable.setFunctionExtensions("floatBitsToUint", numBitEncodingExts, bitEncodingExts); |
9692 | 2.49k | symbolTable.setFunctionExtensions("intBitsToFloat", numBitEncodingExts, bitEncodingExts); |
9693 | 2.49k | symbolTable.setFunctionExtensions("uintBitsToFloat", numBitEncodingExts, bitEncodingExts); |
9694 | | |
9695 | 2.49k | } |
9696 | | |
9697 | 4.34k | if (profile != EEsProfile && version < 430 ) { |
9698 | 2.85k | symbolTable.setFunctionExtensions("imageSize", 1, &E_GL_ARB_shader_image_size); |
9699 | 2.85k | } |
9700 | | |
9701 | | // GL_ARB_shader_storage_buffer_object |
9702 | 4.34k | if (profile != EEsProfile && version < 430 ) { |
9703 | 2.85k | symbolTable.setFunctionExtensions("atomicAdd", 1, &E_GL_ARB_shader_storage_buffer_object); |
9704 | 2.85k | symbolTable.setFunctionExtensions("atomicMin", 1, &E_GL_ARB_shader_storage_buffer_object); |
9705 | 2.85k | symbolTable.setFunctionExtensions("atomicMax", 1, &E_GL_ARB_shader_storage_buffer_object); |
9706 | 2.85k | symbolTable.setFunctionExtensions("atomicAnd", 1, &E_GL_ARB_shader_storage_buffer_object); |
9707 | 2.85k | symbolTable.setFunctionExtensions("atomicOr", 1, &E_GL_ARB_shader_storage_buffer_object); |
9708 | 2.85k | symbolTable.setFunctionExtensions("atomicXor", 1, &E_GL_ARB_shader_storage_buffer_object); |
9709 | 2.85k | symbolTable.setFunctionExtensions("atomicExchange", 1, &E_GL_ARB_shader_storage_buffer_object); |
9710 | 2.85k | symbolTable.setFunctionExtensions("atomicCompSwap", 1, &E_GL_ARB_shader_storage_buffer_object); |
9711 | 2.85k | } |
9712 | | |
9713 | | // GL_ARB_shading_language_packing |
9714 | 4.34k | if (profile != EEsProfile && version < 400 ) { |
9715 | 2.64k | const int numPackingExts = 3; |
9716 | 2.64k | const char* packingExts[numPackingExts] = { E_GL_ARB_shading_language_packing, |
9717 | 2.64k | E_GL_ARB_gpu_shader5, |
9718 | 2.64k | E_GL_NV_gpu_shader5}; |
9719 | 2.64k | symbolTable.setFunctionExtensions("packUnorm2x16", numPackingExts, packingExts); |
9720 | 2.64k | symbolTable.setFunctionExtensions("unpackUnorm2x16", numPackingExts, packingExts); |
9721 | 2.64k | symbolTable.setFunctionExtensions("packSnorm4x8", numPackingExts, packingExts); |
9722 | 2.64k | symbolTable.setFunctionExtensions("packUnorm4x8", numPackingExts, packingExts); |
9723 | 2.64k | symbolTable.setFunctionExtensions("unpackSnorm4x8", numPackingExts, packingExts); |
9724 | 2.64k | symbolTable.setFunctionExtensions("unpackUnorm4x8", numPackingExts, packingExts); |
9725 | 2.64k | } |
9726 | 4.34k | if (profile != EEsProfile && version < 420 ) { |
9727 | 2.83k | symbolTable.setFunctionExtensions("packSnorm2x16", 1, &E_GL_ARB_shading_language_packing); |
9728 | 2.83k | symbolTable.setFunctionExtensions("unpackSnorm2x16", 1, &E_GL_ARB_shading_language_packing); |
9729 | 2.83k | symbolTable.setFunctionExtensions("unpackHalf2x16", 1, &E_GL_ARB_shading_language_packing); |
9730 | 2.83k | symbolTable.setFunctionExtensions("packHalf2x16", 1, &E_GL_ARB_shading_language_packing); |
9731 | 2.83k | } |
9732 | | |
9733 | 4.34k | symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); |
9734 | 4.34k | BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); |
9735 | 4.34k | symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); |
9736 | 4.34k | BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); |
9737 | 4.34k | if (version >= 300 /* both ES and non-ES */) { |
9738 | 1.84k | symbolTable.setVariableExtensions("gl_ViewID_OVR", Num_OVR_multiview_EXTs, OVR_multiview_EXTs); |
9739 | 1.84k | BuiltInVariable("gl_ViewID_OVR", EbvViewIndex, symbolTable); |
9740 | 1.84k | } |
9741 | | |
9742 | | // GL_ARB_shader_ballot |
9743 | 4.34k | if (profile != EEsProfile) { |
9744 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); |
9745 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); |
9746 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); |
9747 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); |
9748 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); |
9749 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); |
9750 | 4.08k | symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); |
9751 | | |
9752 | 4.08k | BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); |
9753 | 4.08k | BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); |
9754 | 4.08k | BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); |
9755 | 4.08k | BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); |
9756 | 4.08k | BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); |
9757 | 4.08k | BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); |
9758 | | |
9759 | 4.08k | if (spvVersion.vulkan > 0) { |
9760 | | // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan |
9761 | 4.08k | SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); |
9762 | 4.08k | if (language == EShLangFragment) |
9763 | 4.08k | ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); |
9764 | 4.08k | } |
9765 | 0 | else |
9766 | 0 | BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); |
9767 | 4.08k | } |
9768 | | |
9769 | | // GL_EXT_expect_assume |
9770 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
9771 | 4.34k | (profile != EEsProfile && version >= 140)) { |
9772 | 4.34k | symbolTable.setFunctionExtensions("assumeEXT", 1, &E_GL_EXT_expect_assume); |
9773 | 4.34k | symbolTable.setFunctionExtensions("expectEXT", 1, &E_GL_EXT_expect_assume); |
9774 | 4.34k | } |
9775 | | |
9776 | | // GL_KHR_shader_subgroup |
9777 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
9778 | 4.34k | (profile != EEsProfile && version >= 140)) { |
9779 | 4.34k | symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); |
9780 | 4.34k | symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); |
9781 | 4.34k | symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9782 | 4.34k | symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9783 | 4.34k | symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9784 | 4.34k | symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9785 | 4.34k | symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
9786 | | |
9787 | 4.34k | BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); |
9788 | 4.34k | BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); |
9789 | 4.34k | BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); |
9790 | 4.34k | BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); |
9791 | 4.34k | BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); |
9792 | 4.34k | BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); |
9793 | 4.34k | BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); |
9794 | | |
9795 | 4.34k | symbolTable.setFunctionExtensions("subgroupBarrier", 1, &E_GL_KHR_shader_subgroup_basic); |
9796 | 4.34k | symbolTable.setFunctionExtensions("subgroupMemoryBarrier", 1, &E_GL_KHR_shader_subgroup_basic); |
9797 | 4.34k | symbolTable.setFunctionExtensions("subgroupMemoryBarrierBuffer", 1, &E_GL_KHR_shader_subgroup_basic); |
9798 | 4.34k | symbolTable.setFunctionExtensions("subgroupMemoryBarrierImage", 1, &E_GL_KHR_shader_subgroup_basic); |
9799 | 4.34k | symbolTable.setFunctionExtensions("subgroupElect", 1, &E_GL_KHR_shader_subgroup_basic); |
9800 | 4.34k | symbolTable.setFunctionExtensions("subgroupAll", 1, &E_GL_KHR_shader_subgroup_vote); |
9801 | 4.34k | symbolTable.setFunctionExtensions("subgroupAny", 1, &E_GL_KHR_shader_subgroup_vote); |
9802 | 4.34k | symbolTable.setFunctionExtensions("subgroupAllEqual", 1, &E_GL_KHR_shader_subgroup_vote); |
9803 | 4.34k | symbolTable.setFunctionExtensions("subgroupBroadcast", 1, &E_GL_KHR_shader_subgroup_ballot); |
9804 | 4.34k | symbolTable.setFunctionExtensions("subgroupBroadcastFirst", 1, &E_GL_KHR_shader_subgroup_ballot); |
9805 | 4.34k | symbolTable.setFunctionExtensions("subgroupBallot", 1, &E_GL_KHR_shader_subgroup_ballot); |
9806 | 4.34k | symbolTable.setFunctionExtensions("subgroupInverseBallot", 1, &E_GL_KHR_shader_subgroup_ballot); |
9807 | 4.34k | symbolTable.setFunctionExtensions("subgroupBallotBitExtract", 1, &E_GL_KHR_shader_subgroup_ballot); |
9808 | 4.34k | symbolTable.setFunctionExtensions("subgroupBallotBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); |
9809 | 4.34k | symbolTable.setFunctionExtensions("subgroupBallotInclusiveBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); |
9810 | 4.34k | symbolTable.setFunctionExtensions("subgroupBallotExclusiveBitCount", 1, &E_GL_KHR_shader_subgroup_ballot); |
9811 | 4.34k | symbolTable.setFunctionExtensions("subgroupBallotFindLSB", 1, &E_GL_KHR_shader_subgroup_ballot); |
9812 | 4.34k | symbolTable.setFunctionExtensions("subgroupBallotFindMSB", 1, &E_GL_KHR_shader_subgroup_ballot); |
9813 | 4.34k | symbolTable.setFunctionExtensions("subgroupShuffle", 1, &E_GL_KHR_shader_subgroup_shuffle); |
9814 | 4.34k | symbolTable.setFunctionExtensions("subgroupShuffleXor", 1, &E_GL_KHR_shader_subgroup_shuffle); |
9815 | 4.34k | symbolTable.setFunctionExtensions("subgroupShuffleUp", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); |
9816 | 4.34k | symbolTable.setFunctionExtensions("subgroupShuffleDown", 1, &E_GL_KHR_shader_subgroup_shuffle_relative); |
9817 | 4.34k | symbolTable.setFunctionExtensions("subgroupRotate", 1, &E_GL_KHR_shader_subgroup_rotate); |
9818 | 4.34k | symbolTable.setFunctionExtensions("subgroupClusteredRotate", 1, &E_GL_KHR_shader_subgroup_rotate); |
9819 | 4.34k | symbolTable.setFunctionExtensions("subgroupAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9820 | 4.34k | symbolTable.setFunctionExtensions("subgroupMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9821 | 4.34k | symbolTable.setFunctionExtensions("subgroupMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9822 | 4.34k | symbolTable.setFunctionExtensions("subgroupMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9823 | 4.34k | symbolTable.setFunctionExtensions("subgroupAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9824 | 4.34k | symbolTable.setFunctionExtensions("subgroupOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9825 | 4.34k | symbolTable.setFunctionExtensions("subgroupXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9826 | 4.34k | symbolTable.setFunctionExtensions("subgroupInclusiveAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9827 | 4.34k | symbolTable.setFunctionExtensions("subgroupInclusiveMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9828 | 4.34k | symbolTable.setFunctionExtensions("subgroupInclusiveMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9829 | 4.34k | symbolTable.setFunctionExtensions("subgroupInclusiveMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9830 | 4.34k | symbolTable.setFunctionExtensions("subgroupInclusiveAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9831 | 4.34k | symbolTable.setFunctionExtensions("subgroupInclusiveOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9832 | 4.34k | symbolTable.setFunctionExtensions("subgroupInclusiveXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9833 | 4.34k | symbolTable.setFunctionExtensions("subgroupExclusiveAdd", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9834 | 4.34k | symbolTable.setFunctionExtensions("subgroupExclusiveMul", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9835 | 4.34k | symbolTable.setFunctionExtensions("subgroupExclusiveMin", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9836 | 4.34k | symbolTable.setFunctionExtensions("subgroupExclusiveMax", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9837 | 4.34k | symbolTable.setFunctionExtensions("subgroupExclusiveAnd", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9838 | 4.34k | symbolTable.setFunctionExtensions("subgroupExclusiveOr", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9839 | 4.34k | symbolTable.setFunctionExtensions("subgroupExclusiveXor", 1, &E_GL_KHR_shader_subgroup_arithmetic); |
9840 | 4.34k | symbolTable.setFunctionExtensions("subgroupClusteredAdd", 1, &E_GL_KHR_shader_subgroup_clustered); |
9841 | 4.34k | symbolTable.setFunctionExtensions("subgroupClusteredMul", 1, &E_GL_KHR_shader_subgroup_clustered); |
9842 | 4.34k | symbolTable.setFunctionExtensions("subgroupClusteredMin", 1, &E_GL_KHR_shader_subgroup_clustered); |
9843 | 4.34k | symbolTable.setFunctionExtensions("subgroupClusteredMax", 1, &E_GL_KHR_shader_subgroup_clustered); |
9844 | 4.34k | symbolTable.setFunctionExtensions("subgroupClusteredAnd", 1, &E_GL_KHR_shader_subgroup_clustered); |
9845 | 4.34k | symbolTable.setFunctionExtensions("subgroupClusteredOr", 1, &E_GL_KHR_shader_subgroup_clustered); |
9846 | 4.34k | symbolTable.setFunctionExtensions("subgroupClusteredXor", 1, &E_GL_KHR_shader_subgroup_clustered); |
9847 | 4.34k | symbolTable.setFunctionExtensions("subgroupQuadBroadcast", 1, &E_GL_KHR_shader_subgroup_quad); |
9848 | 4.34k | symbolTable.setFunctionExtensions("subgroupQuadSwapHorizontal", 1, &E_GL_KHR_shader_subgroup_quad); |
9849 | 4.34k | symbolTable.setFunctionExtensions("subgroupQuadSwapVertical", 1, &E_GL_KHR_shader_subgroup_quad); |
9850 | 4.34k | symbolTable.setFunctionExtensions("subgroupQuadSwapDiagonal", 1, &E_GL_KHR_shader_subgroup_quad); |
9851 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9852 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9853 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9854 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9855 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9856 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9857 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9858 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9859 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9860 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9861 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9862 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9863 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9864 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9865 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedInclusiveXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9866 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveAddNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9867 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMulNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9868 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMinNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9869 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveMaxNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9870 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveAndNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9871 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveOrNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9872 | 4.34k | symbolTable.setFunctionExtensions("subgroupPartitionedExclusiveXorNV", 1, &E_GL_NV_shader_subgroup_partitioned); |
9873 | | |
9874 | | // GL_NV_shader_sm_builtins |
9875 | 4.34k | symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); |
9876 | 4.34k | symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); |
9877 | 4.34k | symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); |
9878 | 4.34k | symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); |
9879 | 4.34k | BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); |
9880 | 4.34k | BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); |
9881 | 4.34k | BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); |
9882 | 4.34k | BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); |
9883 | | |
9884 | | // GL_ARM_shader_core_builtins |
9885 | 4.34k | symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); |
9886 | 4.34k | symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); |
9887 | 4.34k | symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
9888 | 4.34k | symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); |
9889 | 4.34k | symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
9890 | | |
9891 | 4.34k | BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); |
9892 | 4.34k | BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); |
9893 | 4.34k | BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); |
9894 | 4.34k | BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); |
9895 | 4.34k | BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); |
9896 | 4.34k | } |
9897 | | |
9898 | 4.34k | if (profile == EEsProfile) { |
9899 | 259 | symbolTable.setFunctionExtensions("shadow2DEXT", 1, &E_GL_EXT_shadow_samplers); |
9900 | 259 | symbolTable.setFunctionExtensions("shadow2DProjEXT", 1, &E_GL_EXT_shadow_samplers); |
9901 | 259 | } |
9902 | | |
9903 | 4.34k | if (spvVersion.vulkan > 0) { |
9904 | 4.34k | symbolTable.setVariableExtensions("gl_ScopeDevice", 1, &E_GL_KHR_memory_scope_semantics); |
9905 | 4.34k | symbolTable.setVariableExtensions("gl_ScopeWorkgroup", 1, &E_GL_KHR_memory_scope_semantics); |
9906 | 4.34k | symbolTable.setVariableExtensions("gl_ScopeSubgroup", 1, &E_GL_KHR_memory_scope_semantics); |
9907 | 4.34k | symbolTable.setVariableExtensions("gl_ScopeInvocation", 1, &E_GL_KHR_memory_scope_semantics); |
9908 | | |
9909 | 4.34k | symbolTable.setVariableExtensions("gl_SemanticsRelaxed", 1, &E_GL_KHR_memory_scope_semantics); |
9910 | 4.34k | symbolTable.setVariableExtensions("gl_SemanticsAcquire", 1, &E_GL_KHR_memory_scope_semantics); |
9911 | 4.34k | symbolTable.setVariableExtensions("gl_SemanticsRelease", 1, &E_GL_KHR_memory_scope_semantics); |
9912 | 4.34k | symbolTable.setVariableExtensions("gl_SemanticsAcquireRelease", 1, &E_GL_KHR_memory_scope_semantics); |
9913 | 4.34k | symbolTable.setVariableExtensions("gl_SemanticsMakeAvailable", 1, &E_GL_KHR_memory_scope_semantics); |
9914 | 4.34k | symbolTable.setVariableExtensions("gl_SemanticsMakeVisible", 1, &E_GL_KHR_memory_scope_semantics); |
9915 | 4.34k | symbolTable.setVariableExtensions("gl_SemanticsVolatile", 1, &E_GL_KHR_memory_scope_semantics); |
9916 | | |
9917 | 4.34k | symbolTable.setVariableExtensions("gl_StorageSemanticsNone", 1, &E_GL_KHR_memory_scope_semantics); |
9918 | 4.34k | symbolTable.setVariableExtensions("gl_StorageSemanticsBuffer", 1, &E_GL_KHR_memory_scope_semantics); |
9919 | 4.34k | symbolTable.setVariableExtensions("gl_StorageSemanticsShared", 1, &E_GL_KHR_memory_scope_semantics); |
9920 | 4.34k | symbolTable.setVariableExtensions("gl_StorageSemanticsImage", 1, &E_GL_KHR_memory_scope_semantics); |
9921 | 4.34k | symbolTable.setVariableExtensions("gl_StorageSemanticsOutput", 1, &E_GL_KHR_memory_scope_semantics); |
9922 | 4.34k | } |
9923 | | |
9924 | 4.34k | symbolTable.setFunctionExtensions("helperInvocationEXT", 1, &E_GL_EXT_demote_to_helper_invocation); |
9925 | | |
9926 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
9927 | 4.08k | (profile != EEsProfile && version >= 450)) { |
9928 | 1.14k | symbolTable.setVariableExtensions("gl_ShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9929 | 1.14k | BuiltInVariable("gl_ShadingRateEXT", EbvShadingRateKHR, symbolTable); |
9930 | | |
9931 | 1.14k | symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9932 | 1.14k | symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9933 | 1.14k | symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9934 | 1.14k | symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
9935 | 1.14k | } |
9936 | | |
9937 | | // GL_EXT_shader_quad_control |
9938 | 4.34k | if ((profile != EEsProfile && version >= 140) || |
9939 | 4.34k | (profile == EEsProfile && version >= 310)) { |
9940 | 4.34k | symbolTable.setFunctionExtensions("subgroupQuadAll", 1, &E_GL_KHR_shader_subgroup_vote); |
9941 | 4.34k | symbolTable.setFunctionExtensions("subgroupQuadAny", 1, &E_GL_KHR_shader_subgroup_vote); |
9942 | 4.34k | } |
9943 | | |
9944 | | // GL_EXT_shader_tile_image |
9945 | 4.34k | symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); |
9946 | 4.34k | symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); |
9947 | 4.34k | symbolTable.setFunctionExtensions("colorAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image); |
9948 | | |
9949 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
9950 | 4.34k | (profile != EEsProfile && version >= 140)) { |
9951 | | |
9952 | 4.34k | symbolTable.setFunctionExtensions("textureWeightedQCOM", 1, &E_GL_QCOM_image_processing); |
9953 | 4.34k | symbolTable.setFunctionExtensions("textureBoxFilterQCOM", 1, &E_GL_QCOM_image_processing); |
9954 | 4.34k | symbolTable.setFunctionExtensions("textureBlockMatchSADQCOM", 1, &E_GL_QCOM_image_processing); |
9955 | 4.34k | symbolTable.setFunctionExtensions("textureBlockMatchSSDQCOM", 1, &E_GL_QCOM_image_processing); |
9956 | | |
9957 | 4.34k | symbolTable.setFunctionExtensions("textureBlockMatchWindowSSDQCOM", 1, &E_GL_QCOM_image_processing2); |
9958 | 4.34k | symbolTable.setFunctionExtensions("textureBlockMatchWindowSADQCOM", 1, &E_GL_QCOM_image_processing2); |
9959 | 4.34k | symbolTable.setFunctionExtensions("textureBlockMatchGatherSSDQCOM", 1, &E_GL_QCOM_image_processing2); |
9960 | 4.34k | symbolTable.setFunctionExtensions("textureBlockMatchGatherSADQCOM", 1, &E_GL_QCOM_image_processing2); |
9961 | 4.34k | } |
9962 | | |
9963 | 4.34k | if ((profile == EEsProfile && version >= 310) || |
9964 | 4.08k | (profile != EEsProfile && version >= 460)) { |
9965 | 367 | BuiltInVariable("gl_TileOffsetQCOM", EbvTileOffsetQCOM, symbolTable); |
9966 | 367 | BuiltInVariable("gl_TileDimensionQCOM", EbvTileDimensionQCOM, symbolTable); |
9967 | 367 | BuiltInVariable("gl_TileApronSizeQCOM", EbvTileApronSizeQCOM, symbolTable); |
9968 | | |
9969 | 367 | symbolTable.setVariableExtensions("gl_TileOffsetQCOM", 1, &E_GL_QCOM_tile_shading); |
9970 | 367 | symbolTable.setVariableExtensions("gl_TileDimensionQCOM", 1, &E_GL_QCOM_tile_shading); |
9971 | 367 | symbolTable.setVariableExtensions("gl_TileApronSizeQCOM", 1, &E_GL_QCOM_tile_shading); |
9972 | 367 | } |
9973 | 4.34k | break; |
9974 | | |
9975 | 1.50k | case EShLangCompute: |
9976 | 1.50k | BuiltInVariable("gl_NumWorkGroups", EbvNumWorkGroups, symbolTable); |
9977 | 1.50k | BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable); |
9978 | 1.50k | BuiltInVariable("gl_WorkGroupID", EbvWorkGroupId, symbolTable); |
9979 | 1.50k | BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); |
9980 | 1.50k | BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); |
9981 | 1.50k | BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); |
9982 | 1.50k | BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); |
9983 | 1.50k | BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); |
9984 | | |
9985 | 1.50k | if ((profile != EEsProfile && version >= 140) || |
9986 | 1.50k | (profile == EEsProfile && version >= 310)) { |
9987 | 1.50k | symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); |
9988 | 1.50k | symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); |
9989 | 1.50k | } |
9990 | | |
9991 | 1.50k | if (profile != EEsProfile && version < 430) { |
9992 | 20 | symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_ARB_compute_shader); |
9993 | 20 | symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_ARB_compute_shader); |
9994 | 20 | symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_ARB_compute_shader); |
9995 | 20 | symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_ARB_compute_shader); |
9996 | 20 | symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_ARB_compute_shader); |
9997 | 20 | symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_ARB_compute_shader); |
9998 | | |
9999 | 20 | symbolTable.setVariableExtensions("gl_MaxComputeWorkGroupCount", 1, &E_GL_ARB_compute_shader); |
10000 | 20 | symbolTable.setVariableExtensions("gl_MaxComputeWorkGroupSize", 1, &E_GL_ARB_compute_shader); |
10001 | 20 | symbolTable.setVariableExtensions("gl_MaxComputeUniformComponents", 1, &E_GL_ARB_compute_shader); |
10002 | 20 | symbolTable.setVariableExtensions("gl_MaxComputeTextureImageUnits", 1, &E_GL_ARB_compute_shader); |
10003 | 20 | symbolTable.setVariableExtensions("gl_MaxComputeImageUniforms", 1, &E_GL_ARB_compute_shader); |
10004 | 20 | symbolTable.setVariableExtensions("gl_MaxComputeAtomicCounters", 1, &E_GL_ARB_compute_shader); |
10005 | 20 | symbolTable.setVariableExtensions("gl_MaxComputeAtomicCounterBuffers", 1, &E_GL_ARB_compute_shader); |
10006 | | |
10007 | 20 | symbolTable.setFunctionExtensions("barrier", 1, &E_GL_ARB_compute_shader); |
10008 | 20 | symbolTable.setFunctionExtensions("memoryBarrierAtomicCounter", 1, &E_GL_ARB_compute_shader); |
10009 | 20 | symbolTable.setFunctionExtensions("memoryBarrierBuffer", 1, &E_GL_ARB_compute_shader); |
10010 | 20 | symbolTable.setFunctionExtensions("memoryBarrierImage", 1, &E_GL_ARB_compute_shader); |
10011 | 20 | symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_ARB_compute_shader); |
10012 | 20 | symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_ARB_compute_shader); |
10013 | 20 | } |
10014 | | |
10015 | | |
10016 | 1.50k | symbolTable.setFunctionExtensions("controlBarrier", 1, &E_GL_KHR_memory_scope_semantics); |
10017 | 1.50k | symbolTable.setFunctionExtensions("debugPrintfEXT", 1, &E_GL_EXT_debug_printf); |
10018 | | |
10019 | | // GL_ARB_shader_ballot |
10020 | 1.50k | if (profile != EEsProfile) { |
10021 | 1.24k | symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); |
10022 | 1.24k | symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); |
10023 | 1.24k | symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); |
10024 | 1.24k | symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); |
10025 | 1.24k | symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); |
10026 | 1.24k | symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); |
10027 | 1.24k | symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); |
10028 | | |
10029 | 1.24k | BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); |
10030 | 1.24k | BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); |
10031 | 1.24k | BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); |
10032 | 1.24k | BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); |
10033 | 1.24k | BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); |
10034 | 1.24k | BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); |
10035 | | |
10036 | 1.24k | if (spvVersion.vulkan > 0) { |
10037 | | // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan |
10038 | 1.24k | SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); |
10039 | 1.24k | if (language == EShLangFragment) |
10040 | 0 | ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); |
10041 | 1.24k | } |
10042 | 0 | else |
10043 | 0 | BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); |
10044 | 1.24k | } |
10045 | | |
10046 | | // GL_KHR_shader_subgroup |
10047 | 1.50k | if ((profile == EEsProfile && version >= 310) || |
10048 | 1.50k | (profile != EEsProfile && version >= 140)) { |
10049 | 1.50k | symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); |
10050 | 1.50k | symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); |
10051 | 1.50k | symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10052 | 1.50k | symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10053 | 1.50k | symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10054 | 1.50k | symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10055 | 1.50k | symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10056 | | |
10057 | 1.50k | BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); |
10058 | 1.50k | BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); |
10059 | 1.50k | BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); |
10060 | 1.50k | BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); |
10061 | 1.50k | BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); |
10062 | 1.50k | BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); |
10063 | 1.50k | BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); |
10064 | | |
10065 | | // GL_NV_shader_sm_builtins |
10066 | 1.50k | symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); |
10067 | 1.50k | symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); |
10068 | 1.50k | symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); |
10069 | 1.50k | symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); |
10070 | 1.50k | BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); |
10071 | 1.50k | BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); |
10072 | 1.50k | BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); |
10073 | 1.50k | BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); |
10074 | | |
10075 | | // GL_ARM_shader_core_builtins |
10076 | 1.50k | symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); |
10077 | 1.50k | symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10078 | 1.50k | symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10079 | 1.50k | symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10080 | 1.50k | symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10081 | | |
10082 | 1.50k | BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); |
10083 | 1.50k | BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); |
10084 | 1.50k | BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); |
10085 | 1.50k | BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); |
10086 | 1.50k | BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); |
10087 | 1.50k | } |
10088 | | |
10089 | | // GL_KHR_shader_subgroup |
10090 | 1.50k | if ((profile == EEsProfile && version >= 310) || |
10091 | 1.50k | (profile != EEsProfile && version >= 140)) { |
10092 | 1.50k | symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); |
10093 | 1.50k | symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); |
10094 | | |
10095 | 1.50k | BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); |
10096 | 1.50k | BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); |
10097 | | |
10098 | 1.50k | symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); |
10099 | 1.50k | } |
10100 | | |
10101 | 1.50k | { |
10102 | 1.50k | const char *coopExt[2] = { E_GL_NV_cooperative_matrix, E_GL_NV_integer_cooperative_matrix }; |
10103 | 1.50k | symbolTable.setFunctionExtensions("coopMatLoadNV", 2, coopExt); |
10104 | 1.50k | symbolTable.setFunctionExtensions("coopMatStoreNV", 2, coopExt); |
10105 | 1.50k | symbolTable.setFunctionExtensions("coopMatMulAddNV", 2, coopExt); |
10106 | 1.50k | } |
10107 | | |
10108 | 1.50k | { |
10109 | 147k | auto coopMatKHRCallback = [](const char *name) -> std::vector<const char *> { |
10110 | 147k | std::vector<const char *> ret; |
10111 | 147k | if (strstr(name, "u64") != nullptr) { |
10112 | 79.2k | ret.push_back(E_GL_EXT_shader_64bit_indexing); |
10113 | 79.2k | } else { |
10114 | 68.6k | ret.push_back(E_GL_KHR_cooperative_matrix); |
10115 | 68.6k | } |
10116 | 147k | return ret; |
10117 | 147k | }; |
10118 | 10.5k | auto coopMat2NVCallback = [](const char *name) -> std::vector<const char *> { |
10119 | 10.5k | std::vector<const char *> ret; |
10120 | 10.5k | if (strstr(name, "u64") != nullptr) { |
10121 | 5.28k | ret.push_back(E_GL_EXT_shader_64bit_indexing); |
10122 | 5.28k | } else { |
10123 | 5.28k | ret.push_back(E_GL_NV_cooperative_matrix2); |
10124 | 5.28k | } |
10125 | 10.5k | return ret; |
10126 | 10.5k | }; |
10127 | | |
10128 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopMatLoad", coopMatKHRCallback); |
10129 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopMatStore", coopMatKHRCallback); |
10130 | 1.50k | symbolTable.setFunctionExtensions("coopMatMulAdd", 1, &E_GL_KHR_cooperative_matrix); |
10131 | | |
10132 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopMatLoadTensorNV", coopMat2NVCallback); |
10133 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopMatStoreTensorNV", coopMat2NVCallback); |
10134 | | |
10135 | 1.50k | symbolTable.setFunctionExtensions("coopMatReduceNV", 1, &E_GL_NV_cooperative_matrix2); |
10136 | 1.50k | symbolTable.setFunctionExtensions("coopMatPerElementNV", 1, &E_GL_NV_cooperative_matrix2); |
10137 | 1.50k | symbolTable.setFunctionExtensions("coopMatTransposeNV", 1, &E_GL_NV_cooperative_matrix2); |
10138 | | |
10139 | 1.50k | symbolTable.setFunctionExtensions("createTensorLayoutNV", 1, &E_GL_NV_cooperative_matrix2); |
10140 | 1.50k | symbolTable.setFunctionExtensions("setTensorLayoutBlockSizeNV", 1, &E_GL_NV_cooperative_matrix2); |
10141 | 1.50k | symbolTable.setFunctionExtensions("setTensorLayoutDimensionNV", 1, &E_GL_NV_cooperative_matrix2); |
10142 | 1.50k | symbolTable.setFunctionExtensions("setTensorLayoutStrideNV", 1, &E_GL_NV_cooperative_matrix2); |
10143 | 1.50k | symbolTable.setFunctionExtensions("sliceTensorLayoutNV", 1, &E_GL_NV_cooperative_matrix2); |
10144 | 1.50k | symbolTable.setFunctionExtensions("setTensorLayoutClampValueNV", 1, &E_GL_NV_cooperative_matrix2); |
10145 | | |
10146 | 1.50k | symbolTable.setFunctionExtensions("createTensorViewNV", 1, &E_GL_NV_cooperative_matrix2); |
10147 | 1.50k | symbolTable.setFunctionExtensions("setTensorViewDimensionsNV", 1, &E_GL_NV_cooperative_matrix2); |
10148 | 1.50k | symbolTable.setFunctionExtensions("setTensorViewStrideNV", 1, &E_GL_NV_cooperative_matrix2); |
10149 | 1.50k | symbolTable.setFunctionExtensions("setTensorViewClipNV", 1, &E_GL_NV_cooperative_matrix2); |
10150 | 1.50k | } |
10151 | | |
10152 | 1.50k | { |
10153 | 1.50k | symbolTable.setFunctionExtensions("tensorReadARM", 1, &E_GL_ARM_tensors); |
10154 | 1.50k | symbolTable.setFunctionExtensions("tensorWriteARM", 1, &E_GL_ARM_tensors); |
10155 | 1.50k | symbolTable.setFunctionExtensions("tensorSizeARM", 1, &E_GL_ARM_tensors); |
10156 | 1.50k | } |
10157 | 1.50k | { |
10158 | 425k | auto coopVecCallback = [](const char *name) -> std::vector<const char *> { |
10159 | 425k | std::vector<const char *> ret; |
10160 | | // This looks for u64 as the last parameter (the offset) |
10161 | 425k | if (strstr(name, "u641;") != nullptr) { |
10162 | 212k | ret.push_back(E_GL_EXT_shader_64bit_indexing); |
10163 | 212k | } else { |
10164 | 212k | ret.push_back(E_GL_NV_cooperative_vector); |
10165 | 212k | } |
10166 | 425k | return ret; |
10167 | 425k | }; |
10168 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopVecMatMulNV", coopVecCallback); |
10169 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopVecMatMulAddNV", coopVecCallback); |
10170 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopVecLoadNV", coopVecCallback); |
10171 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopVecStoreNV", coopVecCallback); |
10172 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopVecOuterProductAccumulateNV", coopVecCallback); |
10173 | 1.50k | symbolTable.setFunctionExtensionsCallback("coopVecReduceSumAccumulateNV", coopVecCallback); |
10174 | 1.50k | } |
10175 | | |
10176 | 1.50k | { |
10177 | 1.50k | symbolTable.setFunctionExtensions("bitcastQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); |
10178 | 1.50k | symbolTable.setFunctionExtensions("extractSubArrayQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); |
10179 | 1.50k | symbolTable.setFunctionExtensions("vectorToCoopmatQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); |
10180 | 1.50k | symbolTable.setFunctionExtensions("coopmatToVectorQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); |
10181 | 1.50k | } |
10182 | | |
10183 | 1.50k | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
10184 | 927 | symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_NV_compute_shader_derivatives); |
10185 | 927 | symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_NV_compute_shader_derivatives); |
10186 | 927 | symbolTable.setFunctionExtensions("fwidth", 1, &E_GL_NV_compute_shader_derivatives); |
10187 | 927 | symbolTable.setFunctionExtensions("dFdxFine", 1, &E_GL_NV_compute_shader_derivatives); |
10188 | 927 | symbolTable.setFunctionExtensions("dFdyFine", 1, &E_GL_NV_compute_shader_derivatives); |
10189 | 927 | symbolTable.setFunctionExtensions("fwidthFine", 1, &E_GL_NV_compute_shader_derivatives); |
10190 | 927 | symbolTable.setFunctionExtensions("dFdxCoarse", 1, &E_GL_NV_compute_shader_derivatives); |
10191 | 927 | symbolTable.setFunctionExtensions("dFdyCoarse", 1, &E_GL_NV_compute_shader_derivatives); |
10192 | 927 | symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_NV_compute_shader_derivatives); |
10193 | 927 | } |
10194 | | |
10195 | 1.50k | if ((profile == EEsProfile && version >= 310) || |
10196 | 1.24k | (profile != EEsProfile && version >= 450)) { |
10197 | 1.14k | symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10198 | 1.14k | symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10199 | 1.14k | symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10200 | 1.14k | symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10201 | 1.14k | } |
10202 | | |
10203 | 1.50k | if ((profile != EEsProfile && version >= 460)) { |
10204 | 108 | symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); |
10205 | 108 | symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); |
10206 | 108 | } |
10207 | | |
10208 | | // GL_EXT_integer_dot_product |
10209 | 1.50k | if ((profile == EEsProfile && version >= 300) || |
10210 | 1.24k | (profile != EEsProfile && version >= 450)) { |
10211 | 1.14k | symbolTable.setFunctionExtensions("dotEXT", 1, &E_GL_EXT_integer_dot_product); |
10212 | 1.14k | symbolTable.setFunctionExtensions("dotPacked4x8EXT", 1, &E_GL_EXT_integer_dot_product); |
10213 | 1.14k | symbolTable.setFunctionExtensions("dotAccSatEXT", 1, &E_GL_EXT_integer_dot_product); |
10214 | 1.14k | symbolTable.setFunctionExtensions("dotPacked4x8AccSatEXT", 1, &E_GL_EXT_integer_dot_product); |
10215 | 1.14k | } |
10216 | | |
10217 | 1.50k | { |
10218 | 1.50k | symbolTable.setFunctionExtensions("bfloat16BitsToIntEXT", 1, &E_GL_EXT_bfloat16); |
10219 | 1.50k | symbolTable.setFunctionExtensions("bfloat16BitsToUintEXT", 1, &E_GL_EXT_bfloat16); |
10220 | 1.50k | symbolTable.setFunctionExtensions("intBitsToBFloat16EXT", 1, &E_GL_EXT_bfloat16); |
10221 | 1.50k | symbolTable.setFunctionExtensions("uintBitsToBFloat16EXT", 1, &E_GL_EXT_bfloat16); |
10222 | | |
10223 | 1.50k | symbolTable.setFunctionExtensions("floate5m2BitsToIntEXT", 1, &E_GL_EXT_float_e5m2); |
10224 | 1.50k | symbolTable.setFunctionExtensions("floate5m2BitsToUintEXT", 1, &E_GL_EXT_float_e5m2); |
10225 | 1.50k | symbolTable.setFunctionExtensions("intBitsToFloate5m2EXT", 1, &E_GL_EXT_float_e5m2); |
10226 | 1.50k | symbolTable.setFunctionExtensions("uintBitsToFloate5m2EXT", 1, &E_GL_EXT_float_e5m2); |
10227 | | |
10228 | 1.50k | symbolTable.setFunctionExtensions("floate4m3BitsToIntEXT", 1, &E_GL_EXT_float_e4m3); |
10229 | 1.50k | symbolTable.setFunctionExtensions("floate4m3BitsToUintEXT", 1, &E_GL_EXT_float_e4m3); |
10230 | 1.50k | symbolTable.setFunctionExtensions("intBitsToFloate4m3EXT", 1, &E_GL_EXT_float_e4m3); |
10231 | 1.50k | symbolTable.setFunctionExtensions("uintBitsToFloate4m3EXT", 1, &E_GL_EXT_float_e4m3); |
10232 | | |
10233 | 1.50k | const char *float8exts[] = {E_GL_EXT_float_e5m2, E_GL_EXT_float_e4m3}; |
10234 | 1.50k | symbolTable.setFunctionExtensions("saturatedConvertEXT", 2, float8exts); |
10235 | 1.50k | } |
10236 | | |
10237 | | // E_SPV_QCOM_tile_shading |
10238 | 1.50k | if ((profile == EEsProfile && version >= 310) || |
10239 | 1.24k | (profile != EEsProfile && version >= 460)) { |
10240 | 367 | BuiltInVariable("gl_TileOffsetQCOM", EbvTileOffsetQCOM, symbolTable); |
10241 | 367 | BuiltInVariable("gl_TileDimensionQCOM", EbvTileDimensionQCOM, symbolTable); |
10242 | 367 | BuiltInVariable("gl_TileApronSizeQCOM", EbvTileApronSizeQCOM, symbolTable); |
10243 | | |
10244 | 367 | symbolTable.setVariableExtensions("gl_TileOffsetQCOM", 1, &E_GL_QCOM_tile_shading); |
10245 | 367 | symbolTable.setVariableExtensions("gl_TileDimensionQCOM", 1, &E_GL_QCOM_tile_shading); |
10246 | 367 | symbolTable.setVariableExtensions("gl_TileApronSizeQCOM", 1, &E_GL_QCOM_tile_shading); |
10247 | 367 | } |
10248 | 1.50k | break; |
10249 | | |
10250 | 883 | case EShLangRayGen: |
10251 | 1.76k | case EShLangIntersect: |
10252 | 2.64k | case EShLangAnyHit: |
10253 | 3.53k | case EShLangClosestHit: |
10254 | 4.41k | case EShLangMiss: |
10255 | 5.29k | case EShLangCallable: |
10256 | 5.29k | if (profile != EEsProfile && version >= 460) { |
10257 | 648 | const char *rtexts[] = { E_GL_NV_ray_tracing, E_GL_EXT_ray_tracing }; |
10258 | 648 | symbolTable.setVariableExtensions("gl_LaunchIDNV", 1, &E_GL_NV_ray_tracing); |
10259 | 648 | symbolTable.setVariableExtensions("gl_LaunchIDEXT", 1, &E_GL_EXT_ray_tracing); |
10260 | 648 | symbolTable.setVariableExtensions("gl_LaunchSizeNV", 1, &E_GL_NV_ray_tracing); |
10261 | 648 | symbolTable.setVariableExtensions("gl_LaunchSizeEXT", 1, &E_GL_EXT_ray_tracing); |
10262 | 648 | symbolTable.setVariableExtensions("gl_PrimitiveID", 2, rtexts); |
10263 | 648 | symbolTable.setVariableExtensions("gl_InstanceID", 2, rtexts); |
10264 | 648 | symbolTable.setVariableExtensions("gl_InstanceCustomIndexNV", 1, &E_GL_NV_ray_tracing); |
10265 | 648 | symbolTable.setVariableExtensions("gl_InstanceCustomIndexEXT", 1, &E_GL_EXT_ray_tracing); |
10266 | 648 | symbolTable.setVariableExtensions("gl_GeometryIndexEXT", 1, &E_GL_EXT_ray_tracing); |
10267 | 648 | symbolTable.setVariableExtensions("gl_WorldRayOriginNV", 1, &E_GL_NV_ray_tracing); |
10268 | 648 | symbolTable.setVariableExtensions("gl_WorldRayOriginEXT", 1, &E_GL_EXT_ray_tracing); |
10269 | 648 | symbolTable.setVariableExtensions("gl_WorldRayDirectionNV", 1, &E_GL_NV_ray_tracing); |
10270 | 648 | symbolTable.setVariableExtensions("gl_WorldRayDirectionEXT", 1, &E_GL_EXT_ray_tracing); |
10271 | 648 | symbolTable.setVariableExtensions("gl_ObjectRayOriginNV", 1, &E_GL_NV_ray_tracing); |
10272 | 648 | symbolTable.setVariableExtensions("gl_ObjectRayOriginEXT", 1, &E_GL_EXT_ray_tracing); |
10273 | 648 | symbolTable.setVariableExtensions("gl_ObjectRayDirectionNV", 1, &E_GL_NV_ray_tracing); |
10274 | 648 | symbolTable.setVariableExtensions("gl_ObjectRayDirectionEXT", 1, &E_GL_EXT_ray_tracing); |
10275 | 648 | symbolTable.setVariableExtensions("gl_RayTminNV", 1, &E_GL_NV_ray_tracing); |
10276 | 648 | symbolTable.setVariableExtensions("gl_RayTminEXT", 1, &E_GL_EXT_ray_tracing); |
10277 | 648 | symbolTable.setVariableExtensions("gl_RayTmaxNV", 1, &E_GL_NV_ray_tracing); |
10278 | 648 | symbolTable.setVariableExtensions("gl_RayTmaxEXT", 1, &E_GL_EXT_ray_tracing); |
10279 | 648 | symbolTable.setVariableExtensions("gl_CullMaskEXT", 1, &E_GL_EXT_ray_cull_mask); |
10280 | 648 | symbolTable.setVariableExtensions("gl_HitTNV", 1, &E_GL_NV_ray_tracing); |
10281 | 648 | symbolTable.setVariableExtensions("gl_HitTEXT", 1, &E_GL_EXT_ray_tracing); |
10282 | 648 | symbolTable.setVariableExtensions("gl_HitKindNV", 1, &E_GL_NV_ray_tracing); |
10283 | 648 | symbolTable.setVariableExtensions("gl_HitKindEXT", 1, &E_GL_EXT_ray_tracing); |
10284 | 648 | symbolTable.setVariableExtensions("gl_ObjectToWorldNV", 1, &E_GL_NV_ray_tracing); |
10285 | 648 | symbolTable.setVariableExtensions("gl_ObjectToWorldEXT", 1, &E_GL_EXT_ray_tracing); |
10286 | 648 | symbolTable.setVariableExtensions("gl_ObjectToWorld3x4EXT", 1, &E_GL_EXT_ray_tracing); |
10287 | 648 | symbolTable.setVariableExtensions("gl_WorldToObjectNV", 1, &E_GL_NV_ray_tracing); |
10288 | 648 | symbolTable.setVariableExtensions("gl_WorldToObjectEXT", 1, &E_GL_EXT_ray_tracing); |
10289 | 648 | symbolTable.setVariableExtensions("gl_WorldToObject3x4EXT", 1, &E_GL_EXT_ray_tracing); |
10290 | 648 | symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing); |
10291 | 648 | symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing); |
10292 | 648 | symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur); |
10293 | 648 | symbolTable.setVariableExtensions("gl_HitTriangleVertexPositionsEXT", 1, &E_GL_EXT_ray_tracing_position_fetch); |
10294 | 648 | symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexPositionsNV", 1, &E_GL_NV_displacement_micromap); |
10295 | 648 | symbolTable.setVariableExtensions("gl_HitMicroTriangleVertexBarycentricsNV", 1, &E_GL_NV_displacement_micromap); |
10296 | 648 | symbolTable.setVariableExtensions("gl_ClusterIDNV", 1, &E_GL_NV_cluster_acceleration_structure); |
10297 | 648 | symbolTable.setVariableExtensions("gl_HitKindSphereNV", 1, &E_GL_NV_linear_swept_spheres); |
10298 | 648 | symbolTable.setVariableExtensions("gl_HitKindLSSNV", 1, &E_GL_NV_linear_swept_spheres); |
10299 | 648 | symbolTable.setVariableExtensions("gl_HitSpherePositionNV", 1, &E_GL_NV_linear_swept_spheres); |
10300 | 648 | symbolTable.setVariableExtensions("gl_HitSphereRadiusNV", 1, &E_GL_NV_linear_swept_spheres); |
10301 | 648 | symbolTable.setVariableExtensions("gl_HitLSSPositionNV", 1, &E_GL_NV_linear_swept_spheres); |
10302 | 648 | symbolTable.setVariableExtensions("gl_HitLSSRadiiNV", 1, &E_GL_NV_linear_swept_spheres); |
10303 | | |
10304 | 648 | symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); |
10305 | | |
10306 | | |
10307 | 648 | symbolTable.setFunctionExtensions("traceNV", 1, &E_GL_NV_ray_tracing); |
10308 | 648 | symbolTable.setFunctionExtensions("traceRayMotionNV", 1, &E_GL_NV_ray_tracing_motion_blur); |
10309 | 648 | symbolTable.setFunctionExtensions("traceRayEXT", 1, &E_GL_EXT_ray_tracing); |
10310 | 648 | symbolTable.setFunctionExtensions("reportIntersectionNV", 1, &E_GL_NV_ray_tracing); |
10311 | 648 | symbolTable.setFunctionExtensions("reportIntersectionEXT", 1, &E_GL_EXT_ray_tracing); |
10312 | 648 | symbolTable.setFunctionExtensions("ignoreIntersectionNV", 1, &E_GL_NV_ray_tracing); |
10313 | 648 | symbolTable.setFunctionExtensions("terminateRayNV", 1, &E_GL_NV_ray_tracing); |
10314 | 648 | symbolTable.setFunctionExtensions("executeCallableNV", 1, &E_GL_NV_ray_tracing); |
10315 | 648 | symbolTable.setFunctionExtensions("executeCallableEXT", 1, &E_GL_EXT_ray_tracing); |
10316 | | |
10317 | 648 | symbolTable.setFunctionExtensions("hitObjectTraceRayNV", 1, &E_GL_NV_shader_invocation_reorder); |
10318 | 648 | symbolTable.setFunctionExtensions("hitObjectTraceRayMotionNV", 1, &E_GL_NV_shader_invocation_reorder); |
10319 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordHitNV", 1, &E_GL_NV_shader_invocation_reorder); |
10320 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordHitMotionNV", 1, &E_GL_NV_shader_invocation_reorder); |
10321 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordHitWithIndexNV", 1, &E_GL_NV_shader_invocation_reorder); |
10322 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordHitWithIndexMotionNV", 1, &E_GL_NV_shader_invocation_reorder); |
10323 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordMissNV", 1, &E_GL_NV_shader_invocation_reorder); |
10324 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordMissMotionNV", 1, &E_GL_NV_shader_invocation_reorder); |
10325 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordEmptyNV", 1, &E_GL_NV_shader_invocation_reorder); |
10326 | 648 | symbolTable.setFunctionExtensions("hitObjectExecuteShaderNV", 1, &E_GL_NV_shader_invocation_reorder); |
10327 | 648 | symbolTable.setFunctionExtensions("hitObjectIsEmptyNV", 1, &E_GL_NV_shader_invocation_reorder); |
10328 | 648 | symbolTable.setFunctionExtensions("hitObjectIsMissNV", 1, &E_GL_NV_shader_invocation_reorder); |
10329 | 648 | symbolTable.setFunctionExtensions("hitObjectIsHitNV", 1, &E_GL_NV_shader_invocation_reorder); |
10330 | 648 | symbolTable.setFunctionExtensions("hitObjectGetRayTMinNV", 1, &E_GL_NV_shader_invocation_reorder); |
10331 | 648 | symbolTable.setFunctionExtensions("hitObjectGetRayTMaxNV", 1, &E_GL_NV_shader_invocation_reorder); |
10332 | 648 | symbolTable.setFunctionExtensions("hitObjectGetObjectRayOriginNV", 1, &E_GL_NV_shader_invocation_reorder); |
10333 | 648 | symbolTable.setFunctionExtensions("hitObjectGetObjectRayDirectionNV", 1, &E_GL_NV_shader_invocation_reorder); |
10334 | 648 | symbolTable.setFunctionExtensions("hitObjectGetWorldRayOriginNV", 1, &E_GL_NV_shader_invocation_reorder); |
10335 | 648 | symbolTable.setFunctionExtensions("hitObjectGetWorldRayDirectionNV", 1, &E_GL_NV_shader_invocation_reorder); |
10336 | 648 | symbolTable.setFunctionExtensions("hitObjectGetWorldToObjectNV", 1, &E_GL_NV_shader_invocation_reorder); |
10337 | 648 | symbolTable.setFunctionExtensions("hitObjectGetbjectToWorldNV", 1, &E_GL_NV_shader_invocation_reorder); |
10338 | 648 | symbolTable.setFunctionExtensions("hitObjectGetInstanceCustomIndexNV", 1, &E_GL_NV_shader_invocation_reorder); |
10339 | 648 | symbolTable.setFunctionExtensions("hitObjectGetInstanceIdNV", 1, &E_GL_NV_shader_invocation_reorder); |
10340 | 648 | symbolTable.setFunctionExtensions("hitObjectGetGeometryIndexNV", 1, &E_GL_NV_shader_invocation_reorder); |
10341 | 648 | symbolTable.setFunctionExtensions("hitObjectGetPrimitiveIndexNV", 1, &E_GL_NV_shader_invocation_reorder); |
10342 | 648 | symbolTable.setFunctionExtensions("hitObjectGetHitKindNV", 1, &E_GL_NV_shader_invocation_reorder); |
10343 | 648 | symbolTable.setFunctionExtensions("hitObjectGetAttributesNV", 1, &E_GL_NV_shader_invocation_reorder); |
10344 | 648 | symbolTable.setFunctionExtensions("hitObjectGetCurrentTimeNV", 1, &E_GL_NV_shader_invocation_reorder); |
10345 | 648 | symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexNV", 1, &E_GL_NV_shader_invocation_reorder); |
10346 | 648 | symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleNV", 1, &E_GL_NV_shader_invocation_reorder); |
10347 | 648 | symbolTable.setFunctionExtensions("hitObjectGetClusterIdNV", 1, &E_GL_NV_cluster_acceleration_structure); |
10348 | 648 | symbolTable.setFunctionExtensions("reorderThreadNV", 1, &E_GL_NV_shader_invocation_reorder); |
10349 | 648 | symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); |
10350 | 648 | symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); |
10351 | 648 | symbolTable.setFunctionExtensions("hitObjectGetSpherePositionNV", 1, &E_GL_NV_linear_swept_spheres); |
10352 | 648 | symbolTable.setFunctionExtensions("hitObjectGetSphereRadiusNV", 1, &E_GL_NV_linear_swept_spheres); |
10353 | 648 | symbolTable.setFunctionExtensions("hitObjectGetLSSPositionsNV", 1, &E_GL_NV_linear_swept_spheres); |
10354 | 648 | symbolTable.setFunctionExtensions("hitObjectGetLSSRadiiNV", 1, &E_GL_NV_linear_swept_spheres); |
10355 | 648 | symbolTable.setFunctionExtensions("hitObjectIsSphereHitNV", 1, &E_GL_NV_linear_swept_spheres); |
10356 | 648 | symbolTable.setFunctionExtensions("hitObjectIsLSSHitNV", 1, &E_GL_NV_linear_swept_spheres); |
10357 | 648 | symbolTable.setFunctionExtensions("hitObjectTraceRayEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10358 | 648 | symbolTable.setFunctionExtensions("hitObjectTraceRayMotionEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10359 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordMissEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10360 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordMissMotionEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10361 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordEmptyEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10362 | 648 | symbolTable.setFunctionExtensions("hitObjectExecuteShaderEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10363 | 648 | symbolTable.setFunctionExtensions("hitObjectIsEmptyEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10364 | 648 | symbolTable.setFunctionExtensions("hitObjectIsMissEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10365 | 648 | symbolTable.setFunctionExtensions("hitObjectIsHitEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10366 | 648 | symbolTable.setFunctionExtensions("hitObjectGetRayTMinEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10367 | 648 | symbolTable.setFunctionExtensions("hitObjectGetRayTMaxEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10368 | 648 | symbolTable.setFunctionExtensions("hitObjectGetRayFlagsEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10369 | 648 | symbolTable.setFunctionExtensions("hitObjectGetObjectRayOriginEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10370 | 648 | symbolTable.setFunctionExtensions("hitObjectGetObjectRayDirectionEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10371 | 648 | symbolTable.setFunctionExtensions("hitObjectGetWorldRayOriginEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10372 | 648 | symbolTable.setFunctionExtensions("hitObjectGetWorldRayDirectionEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10373 | 648 | symbolTable.setFunctionExtensions("hitObjectGetWorldToObjectEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10374 | 648 | symbolTable.setFunctionExtensions("hitObjectGetObjectToWorldEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10375 | 648 | symbolTable.setFunctionExtensions("hitObjectGetInstanceCustomIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10376 | 648 | symbolTable.setFunctionExtensions("hitObjectGetInstanceIdEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10377 | 648 | symbolTable.setFunctionExtensions("hitObjectGetGeometryIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10378 | 648 | symbolTable.setFunctionExtensions("hitObjectGetPrimitiveIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10379 | 648 | symbolTable.setFunctionExtensions("hitObjectGetHitKindEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10380 | 648 | symbolTable.setFunctionExtensions("hitObjectGetAttributesEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10381 | 648 | symbolTable.setFunctionExtensions("hitObjectGetCurrentTimeEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10382 | 648 | symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10383 | 648 | symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10384 | 648 | symbolTable.setFunctionExtensions("hitObjectSetShaderBindingTableRecordIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10385 | 648 | symbolTable.setFunctionExtensions("reorderThreadEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10386 | 648 | symbolTable.setFunctionExtensions("hitObjectReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10387 | 648 | symbolTable.setFunctionExtensions("hitObjectTraceReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10388 | 648 | symbolTable.setFunctionExtensions("hitObjectTraceMotionReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10389 | 648 | symbolTable.setFunctionExtensions("hitObjectRecordFromQueryEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10390 | 648 | symbolTable.setFunctionExtensions("hitObjectGetIntersectionTriangleVertexPositionsEXT", 1, &E_GL_EXT_shader_invocation_reorder); |
10391 | | |
10392 | | |
10393 | 648 | BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable); |
10394 | 648 | BuiltInVariable("gl_LaunchIDEXT", EbvLaunchId, symbolTable); |
10395 | 648 | BuiltInVariable("gl_LaunchSizeNV", EbvLaunchSize, symbolTable); |
10396 | 648 | BuiltInVariable("gl_LaunchSizeEXT", EbvLaunchSize, symbolTable); |
10397 | 648 | BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); |
10398 | 648 | BuiltInVariable("gl_InstanceID", EbvInstanceId, symbolTable); |
10399 | 648 | BuiltInVariable("gl_InstanceCustomIndexNV", EbvInstanceCustomIndex,symbolTable); |
10400 | 648 | BuiltInVariable("gl_InstanceCustomIndexEXT", EbvInstanceCustomIndex,symbolTable); |
10401 | 648 | BuiltInVariable("gl_GeometryIndexEXT", EbvGeometryIndex, symbolTable); |
10402 | 648 | BuiltInVariable("gl_WorldRayOriginNV", EbvWorldRayOrigin, symbolTable); |
10403 | 648 | BuiltInVariable("gl_WorldRayOriginEXT", EbvWorldRayOrigin, symbolTable); |
10404 | 648 | BuiltInVariable("gl_WorldRayDirectionNV", EbvWorldRayDirection, symbolTable); |
10405 | 648 | BuiltInVariable("gl_WorldRayDirectionEXT", EbvWorldRayDirection, symbolTable); |
10406 | 648 | BuiltInVariable("gl_ObjectRayOriginNV", EbvObjectRayOrigin, symbolTable); |
10407 | 648 | BuiltInVariable("gl_ObjectRayOriginEXT", EbvObjectRayOrigin, symbolTable); |
10408 | 648 | BuiltInVariable("gl_ObjectRayDirectionNV", EbvObjectRayDirection, symbolTable); |
10409 | 648 | BuiltInVariable("gl_ObjectRayDirectionEXT", EbvObjectRayDirection, symbolTable); |
10410 | 648 | BuiltInVariable("gl_RayTminNV", EbvRayTmin, symbolTable); |
10411 | 648 | BuiltInVariable("gl_RayTminEXT", EbvRayTmin, symbolTable); |
10412 | 648 | BuiltInVariable("gl_RayTmaxNV", EbvRayTmax, symbolTable); |
10413 | 648 | BuiltInVariable("gl_RayTmaxEXT", EbvRayTmax, symbolTable); |
10414 | 648 | BuiltInVariable("gl_CullMaskEXT", EbvCullMask, symbolTable); |
10415 | 648 | BuiltInVariable("gl_HitKindNV", EbvHitKind, symbolTable); |
10416 | 648 | BuiltInVariable("gl_HitKindEXT", EbvHitKind, symbolTable); |
10417 | 648 | BuiltInVariable("gl_ObjectToWorldNV", EbvObjectToWorld, symbolTable); |
10418 | 648 | BuiltInVariable("gl_ObjectToWorldEXT", EbvObjectToWorld, symbolTable); |
10419 | 648 | BuiltInVariable("gl_ObjectToWorld3x4EXT", EbvObjectToWorld3x4, symbolTable); |
10420 | 648 | BuiltInVariable("gl_WorldToObjectNV", EbvWorldToObject, symbolTable); |
10421 | 648 | BuiltInVariable("gl_WorldToObjectEXT", EbvWorldToObject, symbolTable); |
10422 | 648 | BuiltInVariable("gl_WorldToObject3x4EXT", EbvWorldToObject3x4, symbolTable); |
10423 | 648 | BuiltInVariable("gl_IncomingRayFlagsNV", EbvIncomingRayFlags, symbolTable); |
10424 | 648 | BuiltInVariable("gl_IncomingRayFlagsEXT", EbvIncomingRayFlags, symbolTable); |
10425 | 648 | BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); |
10426 | 648 | BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable); |
10427 | 648 | BuiltInVariable("gl_HitTriangleVertexPositionsEXT", EbvPositionFetch, symbolTable); |
10428 | 648 | BuiltInVariable("gl_HitMicroTriangleVertexPositionsNV", EbvMicroTrianglePositionNV, symbolTable); |
10429 | 648 | BuiltInVariable("gl_HitMicroTriangleVertexBarycentricsNV", EbvMicroTriangleBaryNV, symbolTable); |
10430 | 648 | BuiltInVariable("gl_HitKindFrontFacingMicroTriangleNV", EbvHitKindFrontFacingMicroTriangleNV, symbolTable); |
10431 | 648 | BuiltInVariable("gl_HitKindBackFacingMicroTriangleNV", EbvHitKindBackFacingMicroTriangleNV, symbolTable); |
10432 | 648 | BuiltInVariable("gl_ClusterIDNV", EbvClusterIDNV, symbolTable); |
10433 | 648 | BuiltInVariable("gl_HitIsSphereNV", EbvHitIsSphereNV, symbolTable); |
10434 | 648 | BuiltInVariable("gl_HitIsLSSNV", EbvHitIsLSSNV, symbolTable); |
10435 | 648 | BuiltInVariable("gl_HitSpherePositionNV", EbvHitSpherePositionNV, symbolTable); |
10436 | 648 | BuiltInVariable("gl_HitSphereRadiusNV", EbvHitSphereRadiusNV, symbolTable); |
10437 | 648 | BuiltInVariable("gl_HitLSSPositionsNV", EbvHitLSSPositionsNV, symbolTable); |
10438 | 648 | BuiltInVariable("gl_HitLSSRadiiNV", EbvHitLSSRadiiNV, symbolTable); |
10439 | | |
10440 | | // gl_HitT variables are aliases of their gl_RayTmax counterparts. |
10441 | 648 | RetargetVariable("gl_HitTNV", "gl_RayTmaxNV", symbolTable); |
10442 | 648 | RetargetVariable("gl_HitTEXT", "gl_RayTmaxEXT", symbolTable); |
10443 | | |
10444 | | // GL_ARB_shader_ballot |
10445 | 648 | symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); |
10446 | 648 | symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); |
10447 | 648 | symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); |
10448 | 648 | symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); |
10449 | 648 | symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); |
10450 | 648 | symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); |
10451 | 648 | symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); |
10452 | | |
10453 | 648 | BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); |
10454 | 648 | BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); |
10455 | 648 | BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); |
10456 | 648 | BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); |
10457 | 648 | BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); |
10458 | 648 | BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); |
10459 | | |
10460 | 648 | if (spvVersion.vulkan > 0) { |
10461 | | // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan |
10462 | 648 | SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); |
10463 | 648 | if (language == EShLangFragment) |
10464 | 0 | ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); |
10465 | 648 | } |
10466 | 0 | else |
10467 | 0 | BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); |
10468 | | |
10469 | | // GL_KHR_shader_subgroup |
10470 | 648 | symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); |
10471 | 648 | symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); |
10472 | 648 | symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); |
10473 | 648 | symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); |
10474 | 648 | symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10475 | 648 | symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10476 | 648 | symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10477 | 648 | symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10478 | 648 | symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10479 | | |
10480 | 648 | BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); |
10481 | 648 | BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); |
10482 | 648 | BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); |
10483 | 648 | BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); |
10484 | 648 | BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); |
10485 | 648 | BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); |
10486 | 648 | BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); |
10487 | 648 | BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); |
10488 | 648 | BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); |
10489 | | |
10490 | | // GL_NV_shader_sm_builtins |
10491 | 648 | symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); |
10492 | 648 | symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); |
10493 | 648 | symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); |
10494 | 648 | symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); |
10495 | 648 | BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); |
10496 | 648 | BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); |
10497 | 648 | BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); |
10498 | 648 | BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); |
10499 | | |
10500 | | // GL_ARM_shader_core_builtins |
10501 | 648 | symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); |
10502 | 648 | symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10503 | 648 | symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10504 | 648 | symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10505 | 648 | symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10506 | | |
10507 | 648 | BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); |
10508 | 648 | BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); |
10509 | 648 | BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); |
10510 | 648 | BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); |
10511 | 648 | BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); |
10512 | 648 | } |
10513 | 5.29k | if ((profile == EEsProfile && version >= 310) || |
10514 | 5.29k | (profile != EEsProfile && version >= 450)) { |
10515 | 5.29k | symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10516 | 5.29k | symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10517 | 5.29k | symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10518 | 5.29k | symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10519 | 5.29k | } |
10520 | 5.29k | break; |
10521 | | |
10522 | 924 | case EShLangMesh: |
10523 | 924 | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
10524 | | // per-vertex builtins |
10525 | 924 | symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_Position", 1, &E_GL_NV_mesh_shader); |
10526 | 924 | symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_PointSize", 1, &E_GL_NV_mesh_shader); |
10527 | 924 | symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_ClipDistance", 1, &E_GL_NV_mesh_shader); |
10528 | 924 | symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_CullDistance", 1, &E_GL_NV_mesh_shader); |
10529 | | |
10530 | 924 | BuiltInVariable("gl_MeshVerticesNV", "gl_Position", EbvPosition, symbolTable); |
10531 | 924 | BuiltInVariable("gl_MeshVerticesNV", "gl_PointSize", EbvPointSize, symbolTable); |
10532 | 924 | BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistance", EbvClipDistance, symbolTable); |
10533 | 924 | BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistance", EbvCullDistance, symbolTable); |
10534 | | |
10535 | 924 | symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_PositionPerViewNV", 1, &E_GL_NV_mesh_shader); |
10536 | 924 | symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", 1, &E_GL_NV_mesh_shader); |
10537 | 924 | symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", 1, &E_GL_NV_mesh_shader); |
10538 | | |
10539 | 924 | BuiltInVariable("gl_MeshVerticesNV", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); |
10540 | 924 | BuiltInVariable("gl_MeshVerticesNV", "gl_ClipDistancePerViewNV", EbvClipDistancePerViewNV, symbolTable); |
10541 | 924 | BuiltInVariable("gl_MeshVerticesNV", "gl_CullDistancePerViewNV", EbvCullDistancePerViewNV, symbolTable); |
10542 | | |
10543 | | // per-primitive builtins |
10544 | 924 | symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_PrimitiveID", 1, &E_GL_NV_mesh_shader); |
10545 | 924 | symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_Layer", 1, &E_GL_NV_mesh_shader); |
10546 | 924 | symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportIndex", 1, &E_GL_NV_mesh_shader); |
10547 | 924 | symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportMask", 1, &E_GL_NV_mesh_shader); |
10548 | | |
10549 | 924 | BuiltInVariable("gl_MeshPrimitivesNV", "gl_PrimitiveID", EbvPrimitiveId, symbolTable); |
10550 | 924 | BuiltInVariable("gl_MeshPrimitivesNV", "gl_Layer", EbvLayer, symbolTable); |
10551 | 924 | BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportIndex", EbvViewportIndex, symbolTable); |
10552 | 924 | BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMask", EbvViewportMaskNV, symbolTable); |
10553 | | |
10554 | | // per-view per-primitive builtins |
10555 | 924 | symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", 1, &E_GL_NV_mesh_shader); |
10556 | 924 | symbolTable.setVariableExtensions("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", 1, &E_GL_NV_mesh_shader); |
10557 | | |
10558 | 924 | BuiltInVariable("gl_MeshPrimitivesNV", "gl_LayerPerViewNV", EbvLayerPerViewNV, symbolTable); |
10559 | 924 | BuiltInVariable("gl_MeshPrimitivesNV", "gl_ViewportMaskPerViewNV", EbvViewportMaskPerViewNV, symbolTable); |
10560 | | |
10561 | | // other builtins |
10562 | 924 | symbolTable.setVariableExtensions("gl_PrimitiveCountNV", 1, &E_GL_NV_mesh_shader); |
10563 | 924 | symbolTable.setVariableExtensions("gl_PrimitiveIndicesNV", 1, &E_GL_NV_mesh_shader); |
10564 | 924 | symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader); |
10565 | 924 | symbolTable.setVariableExtensions("gl_MeshViewIndicesNV", 1, &E_GL_NV_mesh_shader); |
10566 | 924 | if (profile != EEsProfile) { |
10567 | 880 | symbolTable.setVariableExtensions("gl_WorkGroupSize", Num_AEP_mesh_shader, AEP_mesh_shader); |
10568 | 880 | symbolTable.setVariableExtensions("gl_WorkGroupID", Num_AEP_mesh_shader, AEP_mesh_shader); |
10569 | 880 | symbolTable.setVariableExtensions("gl_LocalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader); |
10570 | 880 | symbolTable.setVariableExtensions("gl_GlobalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader); |
10571 | 880 | symbolTable.setVariableExtensions("gl_LocalInvocationIndex", Num_AEP_mesh_shader, AEP_mesh_shader); |
10572 | 880 | } else { |
10573 | 44 | symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader); |
10574 | 44 | symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader); |
10575 | 44 | symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader); |
10576 | 44 | symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader); |
10577 | 44 | symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader); |
10578 | 44 | } |
10579 | 924 | BuiltInVariable("gl_PrimitiveCountNV", EbvPrimitiveCountNV, symbolTable); |
10580 | 924 | BuiltInVariable("gl_PrimitiveIndicesNV", EbvPrimitiveIndicesNV, symbolTable); |
10581 | 924 | BuiltInVariable("gl_MeshViewCountNV", EbvMeshViewCountNV, symbolTable); |
10582 | 924 | BuiltInVariable("gl_MeshViewIndicesNV", EbvMeshViewIndicesNV, symbolTable); |
10583 | 924 | BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable); |
10584 | 924 | BuiltInVariable("gl_WorkGroupID", EbvWorkGroupId, symbolTable); |
10585 | 924 | BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); |
10586 | 924 | BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); |
10587 | 924 | BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); |
10588 | | |
10589 | | // builtin constants |
10590 | 924 | symbolTable.setVariableExtensions("gl_MaxMeshOutputVerticesNV", 1, &E_GL_NV_mesh_shader); |
10591 | 924 | symbolTable.setVariableExtensions("gl_MaxMeshOutputPrimitivesNV", 1, &E_GL_NV_mesh_shader); |
10592 | 924 | symbolTable.setVariableExtensions("gl_MaxMeshWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader); |
10593 | 924 | symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader); |
10594 | | |
10595 | | // builtin functions |
10596 | 924 | if (profile != EEsProfile) { |
10597 | 880 | symbolTable.setFunctionExtensions("barrier", Num_AEP_mesh_shader, AEP_mesh_shader); |
10598 | 880 | symbolTable.setFunctionExtensions("memoryBarrierShared", Num_AEP_mesh_shader, AEP_mesh_shader); |
10599 | 880 | symbolTable.setFunctionExtensions("groupMemoryBarrier", Num_AEP_mesh_shader, AEP_mesh_shader); |
10600 | 880 | } else { |
10601 | 44 | symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader); |
10602 | 44 | symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader); |
10603 | 44 | symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader); |
10604 | 44 | } |
10605 | 924 | symbolTable.setFunctionExtensions("writePackedPrimitiveIndices4x8NV", 1, &E_GL_NV_mesh_shader); |
10606 | 924 | } |
10607 | | |
10608 | 924 | if (profile != EEsProfile && version >= 450) { |
10609 | | // GL_EXT_Mesh_shader |
10610 | 880 | symbolTable.setVariableExtensions("gl_PrimitivePointIndicesEXT", 1, &E_GL_EXT_mesh_shader); |
10611 | 880 | symbolTable.setVariableExtensions("gl_PrimitiveLineIndicesEXT", 1, &E_GL_EXT_mesh_shader); |
10612 | 880 | symbolTable.setVariableExtensions("gl_PrimitiveTriangleIndicesEXT", 1, &E_GL_EXT_mesh_shader); |
10613 | 880 | symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_EXT_mesh_shader); |
10614 | | |
10615 | 880 | BuiltInVariable("gl_PrimitivePointIndicesEXT", EbvPrimitivePointIndicesEXT, symbolTable); |
10616 | 880 | BuiltInVariable("gl_PrimitiveLineIndicesEXT", EbvPrimitiveLineIndicesEXT, symbolTable); |
10617 | 880 | BuiltInVariable("gl_PrimitiveTriangleIndicesEXT", EbvPrimitiveTriangleIndicesEXT, symbolTable); |
10618 | 880 | BuiltInVariable("gl_NumWorkGroups", EbvNumWorkGroups, symbolTable); |
10619 | | |
10620 | 880 | symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_Position", 1, &E_GL_EXT_mesh_shader); |
10621 | 880 | symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_PointSize", 1, &E_GL_EXT_mesh_shader); |
10622 | 880 | symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_ClipDistance", 1, &E_GL_EXT_mesh_shader); |
10623 | 880 | symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_CullDistance", 1, &E_GL_EXT_mesh_shader); |
10624 | | |
10625 | 880 | BuiltInVariable("gl_MeshVerticesEXT", "gl_Position", EbvPosition, symbolTable); |
10626 | 880 | BuiltInVariable("gl_MeshVerticesEXT", "gl_PointSize", EbvPointSize, symbolTable); |
10627 | 880 | BuiltInVariable("gl_MeshVerticesEXT", "gl_ClipDistance", EbvClipDistance, symbolTable); |
10628 | 880 | BuiltInVariable("gl_MeshVerticesEXT", "gl_CullDistance", EbvCullDistance, symbolTable); |
10629 | | |
10630 | 880 | symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_PrimitiveID", 1, &E_GL_EXT_mesh_shader); |
10631 | 880 | symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_Layer", 1, &E_GL_EXT_mesh_shader); |
10632 | 880 | symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_ViewportIndex", 1, &E_GL_EXT_mesh_shader); |
10633 | 880 | symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_CullPrimitiveEXT", 1, &E_GL_EXT_mesh_shader); |
10634 | | |
10635 | | // note: technically this member requires both GL_EXT_mesh_shader and GL_EXT_fragment_shading_rate |
10636 | | // since setVariableExtensions only needs *one of* the extensions to validate, it's more useful to specify EXT_fragment_shading_rate |
10637 | | // GL_EXT_mesh_shader will be required in practice by use of other fields of gl_MeshPrimitivesEXT |
10638 | 880 | symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10639 | | |
10640 | 880 | BuiltInVariable("gl_MeshPrimitivesEXT", "gl_PrimitiveID", EbvPrimitiveId, symbolTable); |
10641 | 880 | BuiltInVariable("gl_MeshPrimitivesEXT", "gl_Layer", EbvLayer, symbolTable); |
10642 | 880 | BuiltInVariable("gl_MeshPrimitivesEXT", "gl_ViewportIndex", EbvViewportIndex, symbolTable); |
10643 | 880 | BuiltInVariable("gl_MeshPrimitivesEXT", "gl_CullPrimitiveEXT", EbvCullPrimitiveEXT, symbolTable); |
10644 | 880 | BuiltInVariable("gl_MeshPrimitivesEXT", "gl_PrimitiveShadingRateEXT", EbvPrimitiveShadingRateKHR, symbolTable); |
10645 | | |
10646 | 880 | symbolTable.setFunctionExtensions("SetMeshOutputsEXT", 1, &E_GL_EXT_mesh_shader); |
10647 | | |
10648 | | // GL_EXT_device_group |
10649 | 880 | symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); |
10650 | 880 | BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); |
10651 | | |
10652 | | // GL_ARB_shader_draw_parameters |
10653 | 880 | symbolTable.setVariableExtensions("gl_DrawIDARB", 1, &E_GL_ARB_shader_draw_parameters); |
10654 | 880 | BuiltInVariable("gl_DrawIDARB", EbvDrawId, symbolTable); |
10655 | 880 | if (version >= 460) { |
10656 | 108 | BuiltInVariable("gl_DrawID", EbvDrawId, symbolTable); |
10657 | 108 | } |
10658 | | // GL_EXT_multiview |
10659 | 880 | BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable); |
10660 | 880 | symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); |
10661 | | |
10662 | | // GL_ARB_shader_ballot |
10663 | 880 | symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); |
10664 | 880 | symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); |
10665 | 880 | symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); |
10666 | 880 | symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); |
10667 | 880 | symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); |
10668 | 880 | symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); |
10669 | 880 | symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); |
10670 | | |
10671 | 880 | BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); |
10672 | 880 | BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); |
10673 | 880 | BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); |
10674 | 880 | BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); |
10675 | 880 | BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); |
10676 | 880 | BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); |
10677 | | |
10678 | 880 | if (spvVersion.vulkan > 0) { |
10679 | | // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan |
10680 | 880 | SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); |
10681 | 880 | if (language == EShLangFragment) |
10682 | 0 | ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); |
10683 | 880 | } |
10684 | 0 | else |
10685 | 0 | BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); |
10686 | 880 | } |
10687 | | |
10688 | | // GL_KHR_shader_subgroup |
10689 | 924 | if ((profile == EEsProfile && version >= 310) || |
10690 | 924 | (profile != EEsProfile && version >= 140)) { |
10691 | 924 | symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); |
10692 | 924 | symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); |
10693 | 924 | symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); |
10694 | 924 | symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); |
10695 | 924 | symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10696 | 924 | symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10697 | 924 | symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10698 | 924 | symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10699 | 924 | symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10700 | | |
10701 | 924 | BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); |
10702 | 924 | BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); |
10703 | 924 | BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); |
10704 | 924 | BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); |
10705 | 924 | BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); |
10706 | 924 | BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); |
10707 | 924 | BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); |
10708 | 924 | BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); |
10709 | 924 | BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); |
10710 | | |
10711 | 924 | symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); |
10712 | | |
10713 | | // GL_NV_shader_sm_builtins |
10714 | 924 | symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); |
10715 | 924 | symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); |
10716 | 924 | symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); |
10717 | 924 | symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); |
10718 | 924 | BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); |
10719 | 924 | BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); |
10720 | 924 | BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); |
10721 | 924 | BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); |
10722 | | |
10723 | | // GL_ARM_shader_core_builtins |
10724 | 924 | symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); |
10725 | 924 | symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10726 | 924 | symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10727 | 924 | symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10728 | 924 | symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10729 | | |
10730 | 924 | BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); |
10731 | 924 | BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); |
10732 | 924 | BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); |
10733 | 924 | BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); |
10734 | 924 | BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); |
10735 | 924 | } |
10736 | | |
10737 | 924 | if ((profile == EEsProfile && version >= 310) || |
10738 | 924 | (profile != EEsProfile && version >= 450)) { |
10739 | 924 | symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10740 | 924 | symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10741 | 924 | symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10742 | 924 | symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10743 | 924 | } |
10744 | | |
10745 | | // Builtins for GL_NV_displacment_micromap |
10746 | 924 | if ((profile != EEsProfile && version >= 460)) { |
10747 | 108 | symbolTable.setFunctionExtensions("fetchMicroTriangleVertexPositionNV", 1, &E_GL_NV_displacement_micromap); |
10748 | 108 | symbolTable.setFunctionExtensions("fetchMicroTriangleVertexBarycentricNV", 1, &E_GL_NV_displacement_micromap); |
10749 | 108 | } |
10750 | | |
10751 | 924 | break; |
10752 | | |
10753 | 927 | case EShLangTask: |
10754 | 927 | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
10755 | 927 | symbolTable.setVariableExtensions("gl_TaskCountNV", 1, &E_GL_NV_mesh_shader); |
10756 | 927 | symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader); |
10757 | 927 | symbolTable.setVariableExtensions("gl_MeshViewIndicesNV", 1, &E_GL_NV_mesh_shader); |
10758 | 927 | if (profile != EEsProfile) { |
10759 | 883 | symbolTable.setVariableExtensions("gl_WorkGroupSize", Num_AEP_mesh_shader, AEP_mesh_shader); |
10760 | 883 | symbolTable.setVariableExtensions("gl_WorkGroupID", Num_AEP_mesh_shader, AEP_mesh_shader); |
10761 | 883 | symbolTable.setVariableExtensions("gl_LocalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader); |
10762 | 883 | symbolTable.setVariableExtensions("gl_GlobalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader); |
10763 | 883 | symbolTable.setVariableExtensions("gl_LocalInvocationIndex", Num_AEP_mesh_shader, AEP_mesh_shader); |
10764 | 883 | } else { |
10765 | 44 | symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader); |
10766 | 44 | symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader); |
10767 | 44 | symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader); |
10768 | 44 | symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader); |
10769 | 44 | symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader); |
10770 | 44 | } |
10771 | | |
10772 | 927 | BuiltInVariable("gl_TaskCountNV", EbvTaskCountNV, symbolTable); |
10773 | 927 | BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable); |
10774 | 927 | BuiltInVariable("gl_WorkGroupID", EbvWorkGroupId, symbolTable); |
10775 | 927 | BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); |
10776 | 927 | BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); |
10777 | 927 | BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); |
10778 | 927 | BuiltInVariable("gl_MeshViewCountNV", EbvMeshViewCountNV, symbolTable); |
10779 | 927 | BuiltInVariable("gl_MeshViewIndicesNV", EbvMeshViewIndicesNV, symbolTable); |
10780 | | |
10781 | 927 | symbolTable.setVariableExtensions("gl_MaxTaskWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader); |
10782 | 927 | symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader); |
10783 | | |
10784 | 927 | if (profile != EEsProfile) { |
10785 | 883 | symbolTable.setFunctionExtensions("barrier", Num_AEP_mesh_shader, AEP_mesh_shader); |
10786 | 883 | symbolTable.setFunctionExtensions("memoryBarrierShared", Num_AEP_mesh_shader, AEP_mesh_shader); |
10787 | 883 | symbolTable.setFunctionExtensions("groupMemoryBarrier", Num_AEP_mesh_shader, AEP_mesh_shader); |
10788 | 883 | } else { |
10789 | 44 | symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader); |
10790 | 44 | symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader); |
10791 | 44 | symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader); |
10792 | 44 | } |
10793 | 927 | } |
10794 | | |
10795 | 927 | if (profile != EEsProfile && version >= 450) { |
10796 | | // GL_EXT_mesh_shader |
10797 | 883 | symbolTable.setFunctionExtensions("EmitMeshTasksEXT", 1, &E_GL_EXT_mesh_shader); |
10798 | 883 | symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_EXT_mesh_shader); |
10799 | 883 | BuiltInVariable("gl_NumWorkGroups", EbvNumWorkGroups, symbolTable); |
10800 | | |
10801 | | // GL_EXT_device_group |
10802 | 883 | symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); |
10803 | 883 | BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); |
10804 | | |
10805 | | // GL_ARB_shader_draw_parameters |
10806 | 883 | symbolTable.setVariableExtensions("gl_DrawIDARB", 1, &E_GL_ARB_shader_draw_parameters); |
10807 | 883 | BuiltInVariable("gl_DrawIDARB", EbvDrawId, symbolTable); |
10808 | 883 | if (version >= 460) { |
10809 | 108 | BuiltInVariable("gl_DrawID", EbvDrawId, symbolTable); |
10810 | 108 | } |
10811 | | |
10812 | | // GL_ARB_shader_ballot |
10813 | 883 | symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); |
10814 | 883 | symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); |
10815 | 883 | symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); |
10816 | 883 | symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); |
10817 | 883 | symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); |
10818 | 883 | symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); |
10819 | 883 | symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); |
10820 | | |
10821 | 883 | BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); |
10822 | 883 | BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); |
10823 | 883 | BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); |
10824 | 883 | BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); |
10825 | 883 | BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); |
10826 | 883 | BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); |
10827 | | |
10828 | 883 | if (spvVersion.vulkan > 0) { |
10829 | | // Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan |
10830 | 883 | SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable); |
10831 | 883 | if (language == EShLangFragment) |
10832 | 0 | ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable); |
10833 | 883 | } |
10834 | 0 | else |
10835 | 0 | BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); |
10836 | 883 | } |
10837 | | |
10838 | | // GL_KHR_shader_subgroup |
10839 | 927 | if ((profile == EEsProfile && version >= 310) || |
10840 | 927 | (profile != EEsProfile && version >= 140)) { |
10841 | 927 | symbolTable.setVariableExtensions("gl_NumSubgroups", 1, &E_GL_KHR_shader_subgroup_basic); |
10842 | 927 | symbolTable.setVariableExtensions("gl_SubgroupID", 1, &E_GL_KHR_shader_subgroup_basic); |
10843 | 927 | symbolTable.setVariableExtensions("gl_SubgroupSize", 1, &E_GL_KHR_shader_subgroup_basic); |
10844 | 927 | symbolTable.setVariableExtensions("gl_SubgroupInvocationID", 1, &E_GL_KHR_shader_subgroup_basic); |
10845 | 927 | symbolTable.setVariableExtensions("gl_SubgroupEqMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10846 | 927 | symbolTable.setVariableExtensions("gl_SubgroupGeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10847 | 927 | symbolTable.setVariableExtensions("gl_SubgroupGtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10848 | 927 | symbolTable.setVariableExtensions("gl_SubgroupLeMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10849 | 927 | symbolTable.setVariableExtensions("gl_SubgroupLtMask", 1, &E_GL_KHR_shader_subgroup_ballot); |
10850 | | |
10851 | 927 | BuiltInVariable("gl_NumSubgroups", EbvNumSubgroups, symbolTable); |
10852 | 927 | BuiltInVariable("gl_SubgroupID", EbvSubgroupID, symbolTable); |
10853 | 927 | BuiltInVariable("gl_SubgroupSize", EbvSubgroupSize2, symbolTable); |
10854 | 927 | BuiltInVariable("gl_SubgroupInvocationID", EbvSubgroupInvocation2, symbolTable); |
10855 | 927 | BuiltInVariable("gl_SubgroupEqMask", EbvSubgroupEqMask2, symbolTable); |
10856 | 927 | BuiltInVariable("gl_SubgroupGeMask", EbvSubgroupGeMask2, symbolTable); |
10857 | 927 | BuiltInVariable("gl_SubgroupGtMask", EbvSubgroupGtMask2, symbolTable); |
10858 | 927 | BuiltInVariable("gl_SubgroupLeMask", EbvSubgroupLeMask2, symbolTable); |
10859 | 927 | BuiltInVariable("gl_SubgroupLtMask", EbvSubgroupLtMask2, symbolTable); |
10860 | | |
10861 | 927 | symbolTable.setFunctionExtensions("subgroupMemoryBarrierShared", 1, &E_GL_KHR_shader_subgroup_basic); |
10862 | | |
10863 | | // GL_NV_shader_sm_builtins |
10864 | 927 | symbolTable.setVariableExtensions("gl_WarpsPerSMNV", 1, &E_GL_NV_shader_sm_builtins); |
10865 | 927 | symbolTable.setVariableExtensions("gl_SMCountNV", 1, &E_GL_NV_shader_sm_builtins); |
10866 | 927 | symbolTable.setVariableExtensions("gl_WarpIDNV", 1, &E_GL_NV_shader_sm_builtins); |
10867 | 927 | symbolTable.setVariableExtensions("gl_SMIDNV", 1, &E_GL_NV_shader_sm_builtins); |
10868 | 927 | BuiltInVariable("gl_WarpsPerSMNV", EbvWarpsPerSM, symbolTable); |
10869 | 927 | BuiltInVariable("gl_SMCountNV", EbvSMCount, symbolTable); |
10870 | 927 | BuiltInVariable("gl_WarpIDNV", EbvWarpID, symbolTable); |
10871 | 927 | BuiltInVariable("gl_SMIDNV", EbvSMID, symbolTable); |
10872 | | |
10873 | | // GL_ARM_shader_core_builtins |
10874 | 927 | symbolTable.setVariableExtensions("gl_CoreCountARM", 1, &E_GL_ARM_shader_core_builtins); |
10875 | 927 | symbolTable.setVariableExtensions("gl_CoreIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10876 | 927 | symbolTable.setVariableExtensions("gl_CoreMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10877 | 927 | symbolTable.setVariableExtensions("gl_WarpIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10878 | 927 | symbolTable.setVariableExtensions("gl_WarpMaxIDARM", 1, &E_GL_ARM_shader_core_builtins); |
10879 | | |
10880 | 927 | BuiltInVariable("gl_CoreCountARM", EbvCoreCountARM, symbolTable); |
10881 | 927 | BuiltInVariable("gl_CoreIDARM", EbvCoreIDARM, symbolTable); |
10882 | 927 | BuiltInVariable("gl_CoreMaxIDARM", EbvCoreMaxIDARM, symbolTable); |
10883 | 927 | BuiltInVariable("gl_WarpIDARM", EbvWarpIDARM, symbolTable); |
10884 | 927 | BuiltInVariable("gl_WarpMaxIDARM", EbvWarpMaxIDARM, symbolTable); |
10885 | 927 | } |
10886 | 927 | if ((profile == EEsProfile && version >= 310) || |
10887 | 927 | (profile != EEsProfile && version >= 450)) { |
10888 | 927 | symbolTable.setVariableExtensions("gl_ShadingRateFlag2VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10889 | 927 | symbolTable.setVariableExtensions("gl_ShadingRateFlag4VerticalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10890 | 927 | symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10891 | 927 | symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate); |
10892 | 927 | } |
10893 | 927 | break; |
10894 | | |
10895 | 0 | default: |
10896 | 0 | assert(false && "Language not supported"); |
10897 | 0 | break; |
10898 | 23.4k | } |
10899 | | |
10900 | | // |
10901 | | // Next, identify which built-ins have a mapping to an operator. |
10902 | | // If PureOperatorBuiltins is false, those that are not identified as such are |
10903 | | // expected to be resolved through a library of functions, versus as |
10904 | | // operations. |
10905 | | // |
10906 | | |
10907 | 23.4k | relateTabledBuiltins(version, profile, spvVersion, language, symbolTable); |
10908 | | |
10909 | 23.4k | symbolTable.relateToOperator("doubleBitsToInt64", EOpDoubleBitsToInt64); |
10910 | 23.4k | symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64); |
10911 | 23.4k | symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble); |
10912 | 23.4k | symbolTable.relateToOperator("uint64BitsToDouble", EOpUint64BitsToDouble); |
10913 | 23.4k | symbolTable.relateToOperator("halfBitsToInt16", EOpFloat16BitsToInt16); |
10914 | 23.4k | symbolTable.relateToOperator("halfBitsToUint16", EOpFloat16BitsToUint16); |
10915 | 23.4k | symbolTable.relateToOperator("float16BitsToInt16", EOpFloat16BitsToInt16); |
10916 | 23.4k | symbolTable.relateToOperator("float16BitsToUint16", EOpFloat16BitsToUint16); |
10917 | 23.4k | symbolTable.relateToOperator("int16BitsToFloat16", EOpInt16BitsToFloat16); |
10918 | 23.4k | symbolTable.relateToOperator("uint16BitsToFloat16", EOpUint16BitsToFloat16); |
10919 | | |
10920 | 23.4k | symbolTable.relateToOperator("int16BitsToHalf", EOpInt16BitsToFloat16); |
10921 | 23.4k | symbolTable.relateToOperator("uint16BitsToHalf", EOpUint16BitsToFloat16); |
10922 | | |
10923 | 23.4k | symbolTable.relateToOperator("packSnorm4x8", EOpPackSnorm4x8); |
10924 | 23.4k | symbolTable.relateToOperator("unpackSnorm4x8", EOpUnpackSnorm4x8); |
10925 | 23.4k | symbolTable.relateToOperator("packUnorm4x8", EOpPackUnorm4x8); |
10926 | 23.4k | symbolTable.relateToOperator("unpackUnorm4x8", EOpUnpackUnorm4x8); |
10927 | | |
10928 | 23.4k | symbolTable.relateToOperator("packDouble2x32", EOpPackDouble2x32); |
10929 | 23.4k | symbolTable.relateToOperator("unpackDouble2x32", EOpUnpackDouble2x32); |
10930 | | |
10931 | 23.4k | symbolTable.relateToOperator("packInt2x32", EOpPackInt2x32); |
10932 | 23.4k | symbolTable.relateToOperator("unpackInt2x32", EOpUnpackInt2x32); |
10933 | 23.4k | symbolTable.relateToOperator("packUint2x32", EOpPackUint2x32); |
10934 | 23.4k | symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32); |
10935 | | |
10936 | 23.4k | symbolTable.relateToOperator("packInt2x16", EOpPackInt2x16); |
10937 | 23.4k | symbolTable.relateToOperator("unpackInt2x16", EOpUnpackInt2x16); |
10938 | 23.4k | symbolTable.relateToOperator("packUint2x16", EOpPackUint2x16); |
10939 | 23.4k | symbolTable.relateToOperator("unpackUint2x16", EOpUnpackUint2x16); |
10940 | | |
10941 | 23.4k | symbolTable.relateToOperator("packInt4x16", EOpPackInt4x16); |
10942 | 23.4k | symbolTable.relateToOperator("unpackInt4x16", EOpUnpackInt4x16); |
10943 | 23.4k | symbolTable.relateToOperator("packUint4x16", EOpPackUint4x16); |
10944 | 23.4k | symbolTable.relateToOperator("unpackUint4x16", EOpUnpackUint4x16); |
10945 | 23.4k | symbolTable.relateToOperator("packFloat2x16", EOpPackFloat2x16); |
10946 | 23.4k | symbolTable.relateToOperator("unpackFloat2x16", EOpUnpackFloat2x16); |
10947 | | |
10948 | 23.4k | symbolTable.relateToOperator("pack16", EOpPack16); |
10949 | 23.4k | symbolTable.relateToOperator("pack32", EOpPack32); |
10950 | 23.4k | symbolTable.relateToOperator("pack64", EOpPack64); |
10951 | | |
10952 | 23.4k | symbolTable.relateToOperator("unpack32", EOpUnpack32); |
10953 | 23.4k | symbolTable.relateToOperator("unpack16", EOpUnpack16); |
10954 | 23.4k | symbolTable.relateToOperator("unpack8", EOpUnpack8); |
10955 | | |
10956 | 23.4k | symbolTable.relateToOperator("controlBarrier", EOpBarrier); |
10957 | 23.4k | symbolTable.relateToOperator("memoryBarrierAtomicCounter", EOpMemoryBarrierAtomicCounter); |
10958 | 23.4k | symbolTable.relateToOperator("memoryBarrierImage", EOpMemoryBarrierImage); |
10959 | | |
10960 | 23.4k | if (spvVersion.vulkanRelaxed) { |
10961 | | // |
10962 | | // functions signature have been replaced to take uint operations on buffer variables |
10963 | | // remap atomic counter functions to atomic operations |
10964 | | // |
10965 | 0 | symbolTable.relateToOperator("memoryBarrierAtomicCounter", EOpMemoryBarrierBuffer); |
10966 | 0 | } |
10967 | | |
10968 | 23.4k | symbolTable.relateToOperator("atomicLoad", EOpAtomicLoad); |
10969 | 23.4k | symbolTable.relateToOperator("atomicStore", EOpAtomicStore); |
10970 | | |
10971 | 23.4k | symbolTable.relateToOperator("atomicCounterIncrement", EOpAtomicCounterIncrement); |
10972 | 23.4k | symbolTable.relateToOperator("atomicCounterDecrement", EOpAtomicCounterDecrement); |
10973 | 23.4k | symbolTable.relateToOperator("atomicCounter", EOpAtomicCounter); |
10974 | | |
10975 | 23.4k | if (spvVersion.vulkanRelaxed) { |
10976 | | // |
10977 | | // functions signature have been replaced to take uint operations |
10978 | | // remap atomic counter functions to atomic operations |
10979 | | // |
10980 | | // these atomic counter functions do not match signatures of glsl |
10981 | | // atomic functions, so they will be remapped to semantically |
10982 | | // equivalent functions in the parser |
10983 | | // |
10984 | 0 | symbolTable.relateToOperator("atomicCounterIncrement", EOpNull); |
10985 | 0 | symbolTable.relateToOperator("atomicCounterDecrement", EOpNull); |
10986 | 0 | symbolTable.relateToOperator("atomicCounter", EOpNull); |
10987 | 0 | } |
10988 | | |
10989 | 23.4k | symbolTable.relateToOperator("clockARB", EOpReadClockSubgroupKHR); |
10990 | 23.4k | symbolTable.relateToOperator("clock2x32ARB", EOpReadClockSubgroupKHR); |
10991 | | |
10992 | 23.4k | symbolTable.relateToOperator("clockRealtimeEXT", EOpReadClockDeviceKHR); |
10993 | 23.4k | symbolTable.relateToOperator("clockRealtime2x32EXT", EOpReadClockDeviceKHR); |
10994 | | |
10995 | 23.4k | if (profile != EEsProfile && version == 450) { |
10996 | 10.8k | symbolTable.relateToOperator("atomicCounterAddARB", EOpAtomicCounterAdd); |
10997 | 10.8k | symbolTable.relateToOperator("atomicCounterSubtractARB", EOpAtomicCounterSubtract); |
10998 | 10.8k | symbolTable.relateToOperator("atomicCounterMinARB", EOpAtomicCounterMin); |
10999 | 10.8k | symbolTable.relateToOperator("atomicCounterMaxARB", EOpAtomicCounterMax); |
11000 | 10.8k | symbolTable.relateToOperator("atomicCounterAndARB", EOpAtomicCounterAnd); |
11001 | 10.8k | symbolTable.relateToOperator("atomicCounterOrARB", EOpAtomicCounterOr); |
11002 | 10.8k | symbolTable.relateToOperator("atomicCounterXorARB", EOpAtomicCounterXor); |
11003 | 10.8k | symbolTable.relateToOperator("atomicCounterExchangeARB", EOpAtomicCounterExchange); |
11004 | 10.8k | symbolTable.relateToOperator("atomicCounterCompSwapARB", EOpAtomicCounterCompSwap); |
11005 | 10.8k | } |
11006 | | |
11007 | 23.4k | if (profile != EEsProfile && version >= 460) { |
11008 | 1.51k | symbolTable.relateToOperator("atomicCounterAdd", EOpAtomicCounterAdd); |
11009 | 1.51k | symbolTable.relateToOperator("atomicCounterSubtract", EOpAtomicCounterSubtract); |
11010 | 1.51k | symbolTable.relateToOperator("atomicCounterMin", EOpAtomicCounterMin); |
11011 | 1.51k | symbolTable.relateToOperator("atomicCounterMax", EOpAtomicCounterMax); |
11012 | 1.51k | symbolTable.relateToOperator("atomicCounterAnd", EOpAtomicCounterAnd); |
11013 | 1.51k | symbolTable.relateToOperator("atomicCounterOr", EOpAtomicCounterOr); |
11014 | 1.51k | symbolTable.relateToOperator("atomicCounterXor", EOpAtomicCounterXor); |
11015 | 1.51k | symbolTable.relateToOperator("atomicCounterExchange", EOpAtomicCounterExchange); |
11016 | 1.51k | symbolTable.relateToOperator("atomicCounterCompSwap", EOpAtomicCounterCompSwap); |
11017 | 1.51k | } |
11018 | | |
11019 | 23.4k | if (spvVersion.vulkanRelaxed) { |
11020 | | // |
11021 | | // functions signature have been replaced to take 'uint' instead of 'atomic_uint' |
11022 | | // remap atomic counter functions to non-counter atomic ops so |
11023 | | // functions act as aliases to non-counter atomic ops |
11024 | | // |
11025 | 0 | symbolTable.relateToOperator("atomicCounterAdd", EOpAtomicAdd); |
11026 | 0 | symbolTable.relateToOperator("atomicCounterSubtract", EOpAtomicSubtract); |
11027 | 0 | symbolTable.relateToOperator("atomicCounterMin", EOpAtomicMin); |
11028 | 0 | symbolTable.relateToOperator("atomicCounterMax", EOpAtomicMax); |
11029 | 0 | symbolTable.relateToOperator("atomicCounterAnd", EOpAtomicAnd); |
11030 | 0 | symbolTable.relateToOperator("atomicCounterOr", EOpAtomicOr); |
11031 | 0 | symbolTable.relateToOperator("atomicCounterXor", EOpAtomicXor); |
11032 | 0 | symbolTable.relateToOperator("atomicCounterExchange", EOpAtomicExchange); |
11033 | 0 | symbolTable.relateToOperator("atomicCounterCompSwap", EOpAtomicCompSwap); |
11034 | 0 | } |
11035 | | |
11036 | 23.4k | symbolTable.relateToOperator("fma", EOpFma); |
11037 | 23.4k | symbolTable.relateToOperator("frexp", EOpFrexp); |
11038 | 23.4k | symbolTable.relateToOperator("ldexp", EOpLdexp); |
11039 | 23.4k | symbolTable.relateToOperator("uaddCarry", EOpAddCarry); |
11040 | 23.4k | symbolTable.relateToOperator("usubBorrow", EOpSubBorrow); |
11041 | 23.4k | symbolTable.relateToOperator("umulExtended", EOpUMulExtended); |
11042 | 23.4k | symbolTable.relateToOperator("imulExtended", EOpIMulExtended); |
11043 | 23.4k | symbolTable.relateToOperator("bitfieldExtract", EOpBitfieldExtract); |
11044 | 23.4k | symbolTable.relateToOperator("bitfieldInsert", EOpBitfieldInsert); |
11045 | 23.4k | symbolTable.relateToOperator("bitfieldReverse", EOpBitFieldReverse); |
11046 | 23.4k | symbolTable.relateToOperator("bitCount", EOpBitCount); |
11047 | 23.4k | symbolTable.relateToOperator("findLSB", EOpFindLSB); |
11048 | 23.4k | symbolTable.relateToOperator("findMSB", EOpFindMSB); |
11049 | | |
11050 | 23.4k | symbolTable.relateToOperator("helperInvocationEXT", EOpIsHelperInvocation); |
11051 | | |
11052 | 23.4k | symbolTable.relateToOperator("countLeadingZeros", EOpCountLeadingZeros); |
11053 | 23.4k | symbolTable.relateToOperator("countTrailingZeros", EOpCountTrailingZeros); |
11054 | 23.4k | symbolTable.relateToOperator("absoluteDifference", EOpAbsDifference); |
11055 | 23.4k | symbolTable.relateToOperator("addSaturate", EOpAddSaturate); |
11056 | 23.4k | symbolTable.relateToOperator("subtractSaturate", EOpSubSaturate); |
11057 | 23.4k | symbolTable.relateToOperator("average", EOpAverage); |
11058 | 23.4k | symbolTable.relateToOperator("averageRounded", EOpAverageRounded); |
11059 | 23.4k | symbolTable.relateToOperator("multiply32x16", EOpMul32x16); |
11060 | 23.4k | symbolTable.relateToOperator("debugPrintfEXT", EOpDebugPrintf); |
11061 | 23.4k | symbolTable.relateToOperator("assumeEXT", EOpAssumeEXT); |
11062 | 23.4k | symbolTable.relateToOperator("expectEXT", EOpExpectEXT); |
11063 | | |
11064 | | |
11065 | 23.4k | if (PureOperatorBuiltins) { |
11066 | 23.4k | symbolTable.relateToOperator("imageSize", EOpImageQuerySize); |
11067 | 23.4k | symbolTable.relateToOperator("imageSamples", EOpImageQuerySamples); |
11068 | 23.4k | symbolTable.relateToOperator("imageLoad", EOpImageLoad); |
11069 | 23.4k | symbolTable.relateToOperator("imageStore", EOpImageStore); |
11070 | 23.4k | symbolTable.relateToOperator("imageAtomicAdd", EOpImageAtomicAdd); |
11071 | 23.4k | symbolTable.relateToOperator("imageAtomicMin", EOpImageAtomicMin); |
11072 | 23.4k | symbolTable.relateToOperator("imageAtomicMax", EOpImageAtomicMax); |
11073 | 23.4k | symbolTable.relateToOperator("imageAtomicAnd", EOpImageAtomicAnd); |
11074 | 23.4k | symbolTable.relateToOperator("imageAtomicOr", EOpImageAtomicOr); |
11075 | 23.4k | symbolTable.relateToOperator("imageAtomicXor", EOpImageAtomicXor); |
11076 | 23.4k | symbolTable.relateToOperator("imageAtomicExchange", EOpImageAtomicExchange); |
11077 | 23.4k | symbolTable.relateToOperator("imageAtomicCompSwap", EOpImageAtomicCompSwap); |
11078 | 23.4k | symbolTable.relateToOperator("imageAtomicLoad", EOpImageAtomicLoad); |
11079 | 23.4k | symbolTable.relateToOperator("imageAtomicStore", EOpImageAtomicStore); |
11080 | | |
11081 | 23.4k | symbolTable.relateToOperator("subpassLoad", EOpSubpassLoad); |
11082 | 23.4k | symbolTable.relateToOperator("subpassLoadMS", EOpSubpassLoadMS); |
11083 | | |
11084 | 23.4k | symbolTable.relateToOperator("textureGather", EOpTextureGather); |
11085 | 23.4k | symbolTable.relateToOperator("textureGatherOffset", EOpTextureGatherOffset); |
11086 | 23.4k | symbolTable.relateToOperator("textureGatherOffsets", EOpTextureGatherOffsets); |
11087 | | |
11088 | 23.4k | symbolTable.relateToOperator("noise1", EOpNoise); |
11089 | 23.4k | symbolTable.relateToOperator("noise2", EOpNoise); |
11090 | 23.4k | symbolTable.relateToOperator("noise3", EOpNoise); |
11091 | 23.4k | symbolTable.relateToOperator("noise4", EOpNoise); |
11092 | | |
11093 | 23.4k | symbolTable.relateToOperator("textureFootprintNV", EOpImageSampleFootprintNV); |
11094 | 23.4k | symbolTable.relateToOperator("textureFootprintClampNV", EOpImageSampleFootprintClampNV); |
11095 | 23.4k | symbolTable.relateToOperator("textureFootprintLodNV", EOpImageSampleFootprintLodNV); |
11096 | 23.4k | symbolTable.relateToOperator("textureFootprintGradNV", EOpImageSampleFootprintGradNV); |
11097 | 23.4k | symbolTable.relateToOperator("textureFootprintGradClampNV", EOpImageSampleFootprintGradClampNV); |
11098 | | |
11099 | 23.4k | if (spvVersion.spv == 0 && IncludeLegacy(version, profile, spvVersion)) |
11100 | 0 | symbolTable.relateToOperator("ftransform", EOpFtransform); |
11101 | | |
11102 | 23.4k | if (spvVersion.spv == 0 && (IncludeLegacy(version, profile, spvVersion) || |
11103 | 0 | (profile == EEsProfile && version == 100))) { |
11104 | |
|
11105 | 0 | symbolTable.relateToOperator("texture1D", EOpTexture); |
11106 | 0 | symbolTable.relateToOperator("texture1DGradARB", EOpTextureGrad); |
11107 | 0 | symbolTable.relateToOperator("texture1DProj", EOpTextureProj); |
11108 | 0 | symbolTable.relateToOperator("texture1DProjGradARB", EOpTextureProjGrad); |
11109 | 0 | symbolTable.relateToOperator("texture1DLod", EOpTextureLod); |
11110 | 0 | symbolTable.relateToOperator("texture1DProjLod", EOpTextureProjLod); |
11111 | |
|
11112 | 0 | symbolTable.relateToOperator("texture2DRect", EOpTexture); |
11113 | 0 | symbolTable.relateToOperator("texture2DRectProj", EOpTextureProj); |
11114 | 0 | symbolTable.relateToOperator("texture2DRectGradARB", EOpTextureGrad); |
11115 | 0 | symbolTable.relateToOperator("texture2DRectProjGradARB", EOpTextureProjGrad); |
11116 | 0 | symbolTable.relateToOperator("shadow2DRect", EOpTexture); |
11117 | 0 | symbolTable.relateToOperator("shadow2DRectProj", EOpTextureProj); |
11118 | 0 | symbolTable.relateToOperator("shadow2DRectGradARB", EOpTextureGrad); |
11119 | 0 | symbolTable.relateToOperator("shadow2DRectProjGradARB", EOpTextureProjGrad); |
11120 | |
|
11121 | 0 | symbolTable.relateToOperator("texture2D", EOpTexture); |
11122 | 0 | symbolTable.relateToOperator("texture2DProj", EOpTextureProj); |
11123 | 0 | symbolTable.relateToOperator("texture2DGradEXT", EOpTextureGrad); |
11124 | 0 | symbolTable.relateToOperator("texture2DGradARB", EOpTextureGrad); |
11125 | 0 | symbolTable.relateToOperator("texture2DProjGradEXT", EOpTextureProjGrad); |
11126 | 0 | symbolTable.relateToOperator("texture2DProjGradARB", EOpTextureProjGrad); |
11127 | 0 | symbolTable.relateToOperator("texture2DLod", EOpTextureLod); |
11128 | 0 | symbolTable.relateToOperator("texture2DLodEXT", EOpTextureLod); |
11129 | 0 | symbolTable.relateToOperator("texture2DProjLod", EOpTextureProjLod); |
11130 | 0 | symbolTable.relateToOperator("texture2DProjLodEXT", EOpTextureProjLod); |
11131 | |
|
11132 | 0 | symbolTable.relateToOperator("texture3D", EOpTexture); |
11133 | 0 | symbolTable.relateToOperator("texture3DGradARB", EOpTextureGrad); |
11134 | 0 | symbolTable.relateToOperator("texture3DProj", EOpTextureProj); |
11135 | 0 | symbolTable.relateToOperator("texture3DProjGradARB", EOpTextureProjGrad); |
11136 | 0 | symbolTable.relateToOperator("texture3DLod", EOpTextureLod); |
11137 | 0 | symbolTable.relateToOperator("texture3DProjLod", EOpTextureProjLod); |
11138 | 0 | symbolTable.relateToOperator("textureCube", EOpTexture); |
11139 | 0 | symbolTable.relateToOperator("textureCubeGradEXT", EOpTextureGrad); |
11140 | 0 | symbolTable.relateToOperator("textureCubeGradARB", EOpTextureGrad); |
11141 | 0 | symbolTable.relateToOperator("textureCubeLod", EOpTextureLod); |
11142 | 0 | symbolTable.relateToOperator("textureCubeLodEXT", EOpTextureLod); |
11143 | 0 | symbolTable.relateToOperator("shadow1D", EOpTexture); |
11144 | 0 | symbolTable.relateToOperator("shadow1DGradARB", EOpTextureGrad); |
11145 | 0 | symbolTable.relateToOperator("shadow2D", EOpTexture); |
11146 | 0 | symbolTable.relateToOperator("shadow2DGradARB", EOpTextureGrad); |
11147 | 0 | symbolTable.relateToOperator("shadow1DProj", EOpTextureProj); |
11148 | 0 | symbolTable.relateToOperator("shadow2DProj", EOpTextureProj); |
11149 | 0 | symbolTable.relateToOperator("shadow1DProjGradARB", EOpTextureProjGrad); |
11150 | 0 | symbolTable.relateToOperator("shadow2DProjGradARB", EOpTextureProjGrad); |
11151 | 0 | symbolTable.relateToOperator("shadow1DLod", EOpTextureLod); |
11152 | 0 | symbolTable.relateToOperator("shadow2DLod", EOpTextureLod); |
11153 | 0 | symbolTable.relateToOperator("shadow1DProjLod", EOpTextureProjLod); |
11154 | 0 | symbolTable.relateToOperator("shadow2DProjLod", EOpTextureProjLod); |
11155 | 0 | } |
11156 | | |
11157 | 23.4k | if (profile != EEsProfile) { |
11158 | 21.7k | symbolTable.relateToOperator("sparseTextureARB", EOpSparseTexture); |
11159 | 21.7k | symbolTable.relateToOperator("sparseTextureLodARB", EOpSparseTextureLod); |
11160 | 21.7k | symbolTable.relateToOperator("sparseTextureOffsetARB", EOpSparseTextureOffset); |
11161 | 21.7k | symbolTable.relateToOperator("sparseTexelFetchARB", EOpSparseTextureFetch); |
11162 | 21.7k | symbolTable.relateToOperator("sparseTexelFetchOffsetARB", EOpSparseTextureFetchOffset); |
11163 | 21.7k | symbolTable.relateToOperator("sparseTextureLodOffsetARB", EOpSparseTextureLodOffset); |
11164 | 21.7k | symbolTable.relateToOperator("sparseTextureGradARB", EOpSparseTextureGrad); |
11165 | 21.7k | symbolTable.relateToOperator("sparseTextureGradOffsetARB", EOpSparseTextureGradOffset); |
11166 | 21.7k | symbolTable.relateToOperator("sparseTextureGatherARB", EOpSparseTextureGather); |
11167 | 21.7k | symbolTable.relateToOperator("sparseTextureGatherOffsetARB", EOpSparseTextureGatherOffset); |
11168 | 21.7k | symbolTable.relateToOperator("sparseTextureGatherOffsetsARB", EOpSparseTextureGatherOffsets); |
11169 | 21.7k | symbolTable.relateToOperator("sparseImageLoadARB", EOpSparseImageLoad); |
11170 | 21.7k | symbolTable.relateToOperator("sparseTexelsResidentARB", EOpSparseTexelsResident); |
11171 | | |
11172 | 21.7k | symbolTable.relateToOperator("sparseTextureClampARB", EOpSparseTextureClamp); |
11173 | 21.7k | symbolTable.relateToOperator("sparseTextureOffsetClampARB", EOpSparseTextureOffsetClamp); |
11174 | 21.7k | symbolTable.relateToOperator("sparseTextureGradClampARB", EOpSparseTextureGradClamp); |
11175 | 21.7k | symbolTable.relateToOperator("sparseTextureGradOffsetClampARB", EOpSparseTextureGradOffsetClamp); |
11176 | 21.7k | symbolTable.relateToOperator("textureClampARB", EOpTextureClamp); |
11177 | 21.7k | symbolTable.relateToOperator("textureOffsetClampARB", EOpTextureOffsetClamp); |
11178 | 21.7k | symbolTable.relateToOperator("textureGradClampARB", EOpTextureGradClamp); |
11179 | 21.7k | symbolTable.relateToOperator("textureGradOffsetClampARB", EOpTextureGradOffsetClamp); |
11180 | | |
11181 | 21.7k | symbolTable.relateToOperator("ballotARB", EOpBallot); |
11182 | 21.7k | symbolTable.relateToOperator("readInvocationARB", EOpReadInvocation); |
11183 | 21.7k | symbolTable.relateToOperator("readFirstInvocationARB", EOpReadFirstInvocation); |
11184 | | |
11185 | 21.7k | if (version >= 430) { |
11186 | 14.3k | symbolTable.relateToOperator("anyInvocationARB", EOpAnyInvocation); |
11187 | 14.3k | symbolTable.relateToOperator("allInvocationsARB", EOpAllInvocations); |
11188 | 14.3k | symbolTable.relateToOperator("allInvocationsEqualARB", EOpAllInvocationsEqual); |
11189 | 14.3k | } |
11190 | 21.7k | if (version >= 460) { |
11191 | 1.51k | symbolTable.relateToOperator("anyInvocation", EOpAnyInvocation); |
11192 | 1.51k | symbolTable.relateToOperator("allInvocations", EOpAllInvocations); |
11193 | 1.51k | symbolTable.relateToOperator("allInvocationsEqual", EOpAllInvocationsEqual); |
11194 | 1.51k | } |
11195 | | // As per dependency between NV_gpu_shader5 and ARB_shader_group_vote |
11196 | | // anyInvocationARB = anyThreadNV |
11197 | | // allInvocationsARB = allThreadsNV |
11198 | | // allInvocationsEqualARB = allThreadsEqualNV |
11199 | | // Thus we reuse the Op's |
11200 | 21.7k | if (version >= 150) { |
11201 | 17.1k | symbolTable.relateToOperator("anyThreadNV", EOpAnyInvocation); |
11202 | 17.1k | symbolTable.relateToOperator("allThreadsNV", EOpAllInvocations); |
11203 | 17.1k | symbolTable.relateToOperator("allThreadsEqualNV", EOpAllInvocationsEqual); |
11204 | 17.1k | } |
11205 | 21.7k | symbolTable.relateToOperator("minInvocationsAMD", EOpMinInvocations); |
11206 | 21.7k | symbolTable.relateToOperator("maxInvocationsAMD", EOpMaxInvocations); |
11207 | 21.7k | symbolTable.relateToOperator("addInvocationsAMD", EOpAddInvocations); |
11208 | 21.7k | symbolTable.relateToOperator("minInvocationsNonUniformAMD", EOpMinInvocationsNonUniform); |
11209 | 21.7k | symbolTable.relateToOperator("maxInvocationsNonUniformAMD", EOpMaxInvocationsNonUniform); |
11210 | 21.7k | symbolTable.relateToOperator("addInvocationsNonUniformAMD", EOpAddInvocationsNonUniform); |
11211 | 21.7k | symbolTable.relateToOperator("minInvocationsInclusiveScanAMD", EOpMinInvocationsInclusiveScan); |
11212 | 21.7k | symbolTable.relateToOperator("maxInvocationsInclusiveScanAMD", EOpMaxInvocationsInclusiveScan); |
11213 | 21.7k | symbolTable.relateToOperator("addInvocationsInclusiveScanAMD", EOpAddInvocationsInclusiveScan); |
11214 | 21.7k | symbolTable.relateToOperator("minInvocationsInclusiveScanNonUniformAMD", EOpMinInvocationsInclusiveScanNonUniform); |
11215 | 21.7k | symbolTable.relateToOperator("maxInvocationsInclusiveScanNonUniformAMD", EOpMaxInvocationsInclusiveScanNonUniform); |
11216 | 21.7k | symbolTable.relateToOperator("addInvocationsInclusiveScanNonUniformAMD", EOpAddInvocationsInclusiveScanNonUniform); |
11217 | 21.7k | symbolTable.relateToOperator("minInvocationsExclusiveScanAMD", EOpMinInvocationsExclusiveScan); |
11218 | 21.7k | symbolTable.relateToOperator("maxInvocationsExclusiveScanAMD", EOpMaxInvocationsExclusiveScan); |
11219 | 21.7k | symbolTable.relateToOperator("addInvocationsExclusiveScanAMD", EOpAddInvocationsExclusiveScan); |
11220 | 21.7k | symbolTable.relateToOperator("minInvocationsExclusiveScanNonUniformAMD", EOpMinInvocationsExclusiveScanNonUniform); |
11221 | 21.7k | symbolTable.relateToOperator("maxInvocationsExclusiveScanNonUniformAMD", EOpMaxInvocationsExclusiveScanNonUniform); |
11222 | 21.7k | symbolTable.relateToOperator("addInvocationsExclusiveScanNonUniformAMD", EOpAddInvocationsExclusiveScanNonUniform); |
11223 | 21.7k | symbolTable.relateToOperator("swizzleInvocationsAMD", EOpSwizzleInvocations); |
11224 | 21.7k | symbolTable.relateToOperator("swizzleInvocationsMaskedAMD", EOpSwizzleInvocationsMasked); |
11225 | 21.7k | symbolTable.relateToOperator("writeInvocationAMD", EOpWriteInvocation); |
11226 | 21.7k | symbolTable.relateToOperator("mbcntAMD", EOpMbcnt); |
11227 | | |
11228 | 21.7k | symbolTable.relateToOperator("min3", EOpMin3); |
11229 | 21.7k | symbolTable.relateToOperator("max3", EOpMax3); |
11230 | 21.7k | symbolTable.relateToOperator("mid3", EOpMid3); |
11231 | | |
11232 | 21.7k | symbolTable.relateToOperator("cubeFaceIndexAMD", EOpCubeFaceIndex); |
11233 | 21.7k | symbolTable.relateToOperator("cubeFaceCoordAMD", EOpCubeFaceCoord); |
11234 | 21.7k | symbolTable.relateToOperator("timeAMD", EOpTime); |
11235 | | |
11236 | 21.7k | symbolTable.relateToOperator("textureGatherLodAMD", EOpTextureGatherLod); |
11237 | 21.7k | symbolTable.relateToOperator("textureGatherLodOffsetAMD", EOpTextureGatherLodOffset); |
11238 | 21.7k | symbolTable.relateToOperator("textureGatherLodOffsetsAMD", EOpTextureGatherLodOffsets); |
11239 | 21.7k | symbolTable.relateToOperator("sparseTextureGatherLodAMD", EOpSparseTextureGatherLod); |
11240 | 21.7k | symbolTable.relateToOperator("sparseTextureGatherLodOffsetAMD", EOpSparseTextureGatherLodOffset); |
11241 | 21.7k | symbolTable.relateToOperator("sparseTextureGatherLodOffsetsAMD", EOpSparseTextureGatherLodOffsets); |
11242 | | |
11243 | 21.7k | symbolTable.relateToOperator("imageLoadLodAMD", EOpImageLoadLod); |
11244 | 21.7k | symbolTable.relateToOperator("imageStoreLodAMD", EOpImageStoreLod); |
11245 | 21.7k | symbolTable.relateToOperator("sparseImageLoadLodAMD", EOpSparseImageLoadLod); |
11246 | | |
11247 | 21.7k | symbolTable.relateToOperator("fragmentMaskFetchAMD", EOpFragmentMaskFetch); |
11248 | 21.7k | symbolTable.relateToOperator("fragmentFetchAMD", EOpFragmentFetch); |
11249 | 21.7k | } |
11250 | | |
11251 | | // GL_EXT_integer_dot_product |
11252 | 23.4k | if ((profile == EEsProfile && version >= 300) || |
11253 | 21.7k | (profile != EEsProfile && version >= 450)) { |
11254 | 14.0k | symbolTable.relateToOperator("dotEXT", EOpDot); |
11255 | 14.0k | symbolTable.relateToOperator("dotPacked4x8EXT", EOpDotPackedEXT); |
11256 | 14.0k | symbolTable.relateToOperator("dotAccSatEXT", EOpDotAccSatEXT); |
11257 | 14.0k | symbolTable.relateToOperator("dotPacked4x8AccSatEXT", EOpDotPackedAccSatEXT); |
11258 | 14.0k | } |
11259 | | |
11260 | | // GL_EXT_bfloat16 |
11261 | 23.4k | if ((profile == EEsProfile && version >= 320) || |
11262 | 23.0k | (profile != EEsProfile && version >= 450)) { |
11263 | 12.7k | symbolTable.relateToOperator("bfloat16BitsToIntEXT", EOpFloatBitsToInt); |
11264 | 12.7k | symbolTable.relateToOperator("bfloat16BitsToUintEXT", EOpFloatBitsToUint); |
11265 | 12.7k | symbolTable.relateToOperator("intBitsToBFloat16EXT", EOpIntBitsToFloat); |
11266 | 12.7k | symbolTable.relateToOperator("uintBitsToBFloat16EXT", EOpUintBitsToFloat); |
11267 | | |
11268 | 12.7k | symbolTable.relateToOperator("floate5m2BitsToIntEXT", EOpFloatBitsToInt); |
11269 | 12.7k | symbolTable.relateToOperator("floate5m2BitsToUintEXT", EOpFloatBitsToUint); |
11270 | 12.7k | symbolTable.relateToOperator("intBitsToFloate5m2EXT", EOpIntBitsToFloat); |
11271 | 12.7k | symbolTable.relateToOperator("uintBitsToFloate5m2EXT", EOpUintBitsToFloat); |
11272 | | |
11273 | 12.7k | symbolTable.relateToOperator("floate4m3BitsToIntEXT", EOpFloatBitsToInt); |
11274 | 12.7k | symbolTable.relateToOperator("floate4m3BitsToUintEXT", EOpFloatBitsToUint); |
11275 | 12.7k | symbolTable.relateToOperator("intBitsToFloate4m3EXT", EOpIntBitsToFloat); |
11276 | 12.7k | symbolTable.relateToOperator("uintBitsToFloate4m3EXT", EOpUintBitsToFloat); |
11277 | | |
11278 | 12.7k | symbolTable.relateToOperator("saturatedConvertEXT", EOpConstructSaturated); |
11279 | 12.7k | } |
11280 | | |
11281 | | // GL_KHR_shader_subgroup |
11282 | 23.4k | if ((profile == EEsProfile && version >= 310) || |
11283 | 23.4k | (profile != EEsProfile && version >= 140)) { |
11284 | 23.4k | symbolTable.relateToOperator("subgroupBarrier", EOpSubgroupBarrier); |
11285 | 23.4k | symbolTable.relateToOperator("subgroupMemoryBarrier", EOpSubgroupMemoryBarrier); |
11286 | 23.4k | symbolTable.relateToOperator("subgroupMemoryBarrierBuffer", EOpSubgroupMemoryBarrierBuffer); |
11287 | 23.4k | symbolTable.relateToOperator("subgroupMemoryBarrierImage", EOpSubgroupMemoryBarrierImage); |
11288 | 23.4k | symbolTable.relateToOperator("subgroupElect", EOpSubgroupElect); |
11289 | 23.4k | symbolTable.relateToOperator("subgroupAll", EOpSubgroupAll); |
11290 | 23.4k | symbolTable.relateToOperator("subgroupAny", EOpSubgroupAny); |
11291 | 23.4k | symbolTable.relateToOperator("subgroupAllEqual", EOpSubgroupAllEqual); |
11292 | 23.4k | symbolTable.relateToOperator("subgroupBroadcast", EOpSubgroupBroadcast); |
11293 | 23.4k | symbolTable.relateToOperator("subgroupBroadcastFirst", EOpSubgroupBroadcastFirst); |
11294 | 23.4k | symbolTable.relateToOperator("subgroupBallot", EOpSubgroupBallot); |
11295 | 23.4k | symbolTable.relateToOperator("subgroupInverseBallot", EOpSubgroupInverseBallot); |
11296 | 23.4k | symbolTable.relateToOperator("subgroupBallotBitExtract", EOpSubgroupBallotBitExtract); |
11297 | 23.4k | symbolTable.relateToOperator("subgroupBallotBitCount", EOpSubgroupBallotBitCount); |
11298 | 23.4k | symbolTable.relateToOperator("subgroupBallotInclusiveBitCount", EOpSubgroupBallotInclusiveBitCount); |
11299 | 23.4k | symbolTable.relateToOperator("subgroupBallotExclusiveBitCount", EOpSubgroupBallotExclusiveBitCount); |
11300 | 23.4k | symbolTable.relateToOperator("subgroupBallotFindLSB", EOpSubgroupBallotFindLSB); |
11301 | 23.4k | symbolTable.relateToOperator("subgroupBallotFindMSB", EOpSubgroupBallotFindMSB); |
11302 | 23.4k | symbolTable.relateToOperator("subgroupShuffle", EOpSubgroupShuffle); |
11303 | 23.4k | symbolTable.relateToOperator("subgroupShuffleXor", EOpSubgroupShuffleXor); |
11304 | 23.4k | symbolTable.relateToOperator("subgroupShuffleUp", EOpSubgroupShuffleUp); |
11305 | 23.4k | symbolTable.relateToOperator("subgroupShuffleDown", EOpSubgroupShuffleDown); |
11306 | 23.4k | symbolTable.relateToOperator("subgroupRotate", EOpSubgroupRotate); |
11307 | 23.4k | symbolTable.relateToOperator("subgroupClusteredRotate", EOpSubgroupClusteredRotate); |
11308 | 23.4k | symbolTable.relateToOperator("subgroupAdd", EOpSubgroupAdd); |
11309 | 23.4k | symbolTable.relateToOperator("subgroupMul", EOpSubgroupMul); |
11310 | 23.4k | symbolTable.relateToOperator("subgroupMin", EOpSubgroupMin); |
11311 | 23.4k | symbolTable.relateToOperator("subgroupMax", EOpSubgroupMax); |
11312 | 23.4k | symbolTable.relateToOperator("subgroupAnd", EOpSubgroupAnd); |
11313 | 23.4k | symbolTable.relateToOperator("subgroupOr", EOpSubgroupOr); |
11314 | 23.4k | symbolTable.relateToOperator("subgroupXor", EOpSubgroupXor); |
11315 | 23.4k | symbolTable.relateToOperator("subgroupInclusiveAdd", EOpSubgroupInclusiveAdd); |
11316 | 23.4k | symbolTable.relateToOperator("subgroupInclusiveMul", EOpSubgroupInclusiveMul); |
11317 | 23.4k | symbolTable.relateToOperator("subgroupInclusiveMin", EOpSubgroupInclusiveMin); |
11318 | 23.4k | symbolTable.relateToOperator("subgroupInclusiveMax", EOpSubgroupInclusiveMax); |
11319 | 23.4k | symbolTable.relateToOperator("subgroupInclusiveAnd", EOpSubgroupInclusiveAnd); |
11320 | 23.4k | symbolTable.relateToOperator("subgroupInclusiveOr", EOpSubgroupInclusiveOr); |
11321 | 23.4k | symbolTable.relateToOperator("subgroupInclusiveXor", EOpSubgroupInclusiveXor); |
11322 | 23.4k | symbolTable.relateToOperator("subgroupExclusiveAdd", EOpSubgroupExclusiveAdd); |
11323 | 23.4k | symbolTable.relateToOperator("subgroupExclusiveMul", EOpSubgroupExclusiveMul); |
11324 | 23.4k | symbolTable.relateToOperator("subgroupExclusiveMin", EOpSubgroupExclusiveMin); |
11325 | 23.4k | symbolTable.relateToOperator("subgroupExclusiveMax", EOpSubgroupExclusiveMax); |
11326 | 23.4k | symbolTable.relateToOperator("subgroupExclusiveAnd", EOpSubgroupExclusiveAnd); |
11327 | 23.4k | symbolTable.relateToOperator("subgroupExclusiveOr", EOpSubgroupExclusiveOr); |
11328 | 23.4k | symbolTable.relateToOperator("subgroupExclusiveXor", EOpSubgroupExclusiveXor); |
11329 | 23.4k | symbolTable.relateToOperator("subgroupClusteredAdd", EOpSubgroupClusteredAdd); |
11330 | 23.4k | symbolTable.relateToOperator("subgroupClusteredMul", EOpSubgroupClusteredMul); |
11331 | 23.4k | symbolTable.relateToOperator("subgroupClusteredMin", EOpSubgroupClusteredMin); |
11332 | 23.4k | symbolTable.relateToOperator("subgroupClusteredMax", EOpSubgroupClusteredMax); |
11333 | 23.4k | symbolTable.relateToOperator("subgroupClusteredAnd", EOpSubgroupClusteredAnd); |
11334 | 23.4k | symbolTable.relateToOperator("subgroupClusteredOr", EOpSubgroupClusteredOr); |
11335 | 23.4k | symbolTable.relateToOperator("subgroupClusteredXor", EOpSubgroupClusteredXor); |
11336 | 23.4k | symbolTable.relateToOperator("subgroupQuadBroadcast", EOpSubgroupQuadBroadcast); |
11337 | 23.4k | symbolTable.relateToOperator("subgroupQuadSwapHorizontal", EOpSubgroupQuadSwapHorizontal); |
11338 | 23.4k | symbolTable.relateToOperator("subgroupQuadSwapVertical", EOpSubgroupQuadSwapVertical); |
11339 | 23.4k | symbolTable.relateToOperator("subgroupQuadSwapDiagonal", EOpSubgroupQuadSwapDiagonal); |
11340 | | |
11341 | 23.4k | symbolTable.relateToOperator("subgroupPartitionNV", EOpSubgroupPartition); |
11342 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedAddNV", EOpSubgroupPartitionedAdd); |
11343 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedMulNV", EOpSubgroupPartitionedMul); |
11344 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedMinNV", EOpSubgroupPartitionedMin); |
11345 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedMaxNV", EOpSubgroupPartitionedMax); |
11346 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedAndNV", EOpSubgroupPartitionedAnd); |
11347 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedOrNV", EOpSubgroupPartitionedOr); |
11348 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedXorNV", EOpSubgroupPartitionedXor); |
11349 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedInclusiveAddNV", EOpSubgroupPartitionedInclusiveAdd); |
11350 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedInclusiveMulNV", EOpSubgroupPartitionedInclusiveMul); |
11351 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedInclusiveMinNV", EOpSubgroupPartitionedInclusiveMin); |
11352 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedInclusiveMaxNV", EOpSubgroupPartitionedInclusiveMax); |
11353 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedInclusiveAndNV", EOpSubgroupPartitionedInclusiveAnd); |
11354 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedInclusiveOrNV", EOpSubgroupPartitionedInclusiveOr); |
11355 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedInclusiveXorNV", EOpSubgroupPartitionedInclusiveXor); |
11356 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedExclusiveAddNV", EOpSubgroupPartitionedExclusiveAdd); |
11357 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedExclusiveMulNV", EOpSubgroupPartitionedExclusiveMul); |
11358 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedExclusiveMinNV", EOpSubgroupPartitionedExclusiveMin); |
11359 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedExclusiveMaxNV", EOpSubgroupPartitionedExclusiveMax); |
11360 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedExclusiveAndNV", EOpSubgroupPartitionedExclusiveAnd); |
11361 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedExclusiveOrNV", EOpSubgroupPartitionedExclusiveOr); |
11362 | 23.4k | symbolTable.relateToOperator("subgroupPartitionedExclusiveXorNV", EOpSubgroupPartitionedExclusiveXor); |
11363 | 23.4k | } |
11364 | | |
11365 | 23.4k | if (profile == EEsProfile) { |
11366 | 1.64k | symbolTable.relateToOperator("shadow2DEXT", EOpTexture); |
11367 | 1.64k | symbolTable.relateToOperator("shadow2DProjEXT", EOpTextureProj); |
11368 | 1.64k | } |
11369 | | |
11370 | | // GL_EXT_shader_quad_control |
11371 | 23.4k | if ((profile == EEsProfile && version >= 310) || |
11372 | 23.4k | (profile != EEsProfile && version >= 140)) { |
11373 | 23.4k | symbolTable.relateToOperator("subgroupQuadAll", EOpSubgroupQuadAll); |
11374 | 23.4k | symbolTable.relateToOperator("subgroupQuadAny", EOpSubgroupQuadAny); |
11375 | 23.4k | } |
11376 | | |
11377 | 23.4k | if ((profile == EEsProfile && version >= 310) || |
11378 | 23.4k | (profile != EEsProfile && version >= 140)) { |
11379 | 23.4k | symbolTable.relateToOperator("textureWeightedQCOM", EOpImageSampleWeightedQCOM); |
11380 | 23.4k | symbolTable.relateToOperator("textureBoxFilterQCOM", EOpImageBoxFilterQCOM); |
11381 | 23.4k | symbolTable.relateToOperator("textureBlockMatchSADQCOM", EOpImageBlockMatchSADQCOM); |
11382 | 23.4k | symbolTable.relateToOperator("textureBlockMatchSSDQCOM", EOpImageBlockMatchSSDQCOM); |
11383 | | |
11384 | 23.4k | symbolTable.relateToOperator("textureBlockMatchWindowSSDQCOM", EOpImageBlockMatchWindowSSDQCOM); |
11385 | 23.4k | symbolTable.relateToOperator("textureBlockMatchWindowSADQCOM", EOpImageBlockMatchWindowSADQCOM); |
11386 | 23.4k | symbolTable.relateToOperator("textureBlockMatchGatherSSDQCOM", EOpImageBlockMatchGatherSSDQCOM); |
11387 | 23.4k | symbolTable.relateToOperator("textureBlockMatchGatherSADQCOM", EOpImageBlockMatchGatherSADQCOM); |
11388 | 23.4k | } |
11389 | | |
11390 | 23.4k | if (profile != EEsProfile && spvVersion.spv == 0) { |
11391 | 0 | symbolTable.relateToOperator("texture1DArray", EOpTexture); |
11392 | 0 | symbolTable.relateToOperator("texture2DArray", EOpTexture); |
11393 | 0 | symbolTable.relateToOperator("shadow1DArray", EOpTexture); |
11394 | 0 | symbolTable.relateToOperator("shadow2DArray", EOpTexture); |
11395 | |
|
11396 | 0 | symbolTable.relateToOperator("texture1DArrayLod", EOpTextureLod); |
11397 | 0 | symbolTable.relateToOperator("texture2DArrayLod", EOpTextureLod); |
11398 | 0 | symbolTable.relateToOperator("shadow1DArrayLod", EOpTextureLod); |
11399 | 0 | } |
11400 | | |
11401 | 23.4k | symbolTable.relateToOperator("coopVecMatMulNV", EOpCooperativeVectorMatMulNV); |
11402 | 23.4k | symbolTable.relateToOperator("coopVecMatMulAddNV", EOpCooperativeVectorMatMulAddNV); |
11403 | 23.4k | symbolTable.relateToOperator("coopVecLoadNV", EOpCooperativeVectorLoadNV); |
11404 | 23.4k | symbolTable.relateToOperator("coopVecStoreNV", EOpCooperativeVectorStoreNV); |
11405 | 23.4k | symbolTable.relateToOperator("coopVecOuterProductAccumulateNV", EOpCooperativeVectorOuterProductAccumulateNV); |
11406 | 23.4k | symbolTable.relateToOperator("coopVecReduceSumAccumulateNV", EOpCooperativeVectorReduceSumAccumulateNV); |
11407 | 23.4k | } |
11408 | | |
11409 | 23.4k | switch(language) { |
11410 | 4.34k | case EShLangVertex: |
11411 | 4.34k | break; |
11412 | | |
11413 | 2.02k | case EShLangTessControl: |
11414 | 4.05k | case EShLangTessEvaluation: |
11415 | 4.05k | break; |
11416 | | |
11417 | 2.02k | case EShLangGeometry: |
11418 | 2.02k | symbolTable.relateToOperator("EmitStreamVertex", EOpEmitStreamVertex); |
11419 | 2.02k | symbolTable.relateToOperator("EndStreamPrimitive", EOpEndStreamPrimitive); |
11420 | 2.02k | symbolTable.relateToOperator("EmitVertex", EOpEmitVertex); |
11421 | 2.02k | symbolTable.relateToOperator("EndPrimitive", EOpEndPrimitive); |
11422 | 2.02k | break; |
11423 | | |
11424 | 4.34k | case EShLangFragment: |
11425 | 4.34k | if (profile != EEsProfile && version >= 400) { |
11426 | 1.43k | symbolTable.relateToOperator("dFdxFine", EOpDPdxFine); |
11427 | 1.43k | symbolTable.relateToOperator("dFdyFine", EOpDPdyFine); |
11428 | 1.43k | symbolTable.relateToOperator("fwidthFine", EOpFwidthFine); |
11429 | 1.43k | symbolTable.relateToOperator("dFdxCoarse", EOpDPdxCoarse); |
11430 | 1.43k | symbolTable.relateToOperator("dFdyCoarse", EOpDPdyCoarse); |
11431 | 1.43k | symbolTable.relateToOperator("fwidthCoarse", EOpFwidthCoarse); |
11432 | 1.43k | } |
11433 | | |
11434 | 4.34k | if (profile != EEsProfile && version >= 460) { |
11435 | 108 | symbolTable.relateToOperator("rayQueryInitializeEXT", EOpRayQueryInitialize); |
11436 | 108 | symbolTable.relateToOperator("rayQueryTerminateEXT", EOpRayQueryTerminate); |
11437 | 108 | symbolTable.relateToOperator("rayQueryGenerateIntersectionEXT", EOpRayQueryGenerateIntersection); |
11438 | 108 | symbolTable.relateToOperator("rayQueryConfirmIntersectionEXT", EOpRayQueryConfirmIntersection); |
11439 | 108 | symbolTable.relateToOperator("rayQueryProceedEXT", EOpRayQueryProceed); |
11440 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionTypeEXT", EOpRayQueryGetIntersectionType); |
11441 | 108 | symbolTable.relateToOperator("rayQueryGetRayTMinEXT", EOpRayQueryGetRayTMin); |
11442 | 108 | symbolTable.relateToOperator("rayQueryGetRayFlagsEXT", EOpRayQueryGetRayFlags); |
11443 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionTEXT", EOpRayQueryGetIntersectionT); |
11444 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionInstanceCustomIndexEXT", EOpRayQueryGetIntersectionInstanceCustomIndex); |
11445 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionInstanceIdEXT", EOpRayQueryGetIntersectionInstanceId); |
11446 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT", EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset); |
11447 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionGeometryIndexEXT", EOpRayQueryGetIntersectionGeometryIndex); |
11448 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionPrimitiveIndexEXT", EOpRayQueryGetIntersectionPrimitiveIndex); |
11449 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionBarycentricsEXT", EOpRayQueryGetIntersectionBarycentrics); |
11450 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionFrontFaceEXT", EOpRayQueryGetIntersectionFrontFace); |
11451 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionCandidateAABBOpaqueEXT", EOpRayQueryGetIntersectionCandidateAABBOpaque); |
11452 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionObjectRayDirectionEXT", EOpRayQueryGetIntersectionObjectRayDirection); |
11453 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionObjectRayOriginEXT", EOpRayQueryGetIntersectionObjectRayOrigin); |
11454 | 108 | symbolTable.relateToOperator("rayQueryGetWorldRayDirectionEXT", EOpRayQueryGetWorldRayDirection); |
11455 | 108 | symbolTable.relateToOperator("rayQueryGetWorldRayOriginEXT", EOpRayQueryGetWorldRayOrigin); |
11456 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionObjectToWorldEXT", EOpRayQueryGetIntersectionObjectToWorld); |
11457 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionWorldToObjectEXT", EOpRayQueryGetIntersectionWorldToObject); |
11458 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionTriangleVertexPositionsEXT", EOpRayQueryGetIntersectionTriangleVertexPositionsEXT); |
11459 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionClusterIdNV", EOpRayQueryGetIntersectionClusterIdNV); |
11460 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionSpherePositionNV", EOpRayQueryGetIntersectionSpherePositionNV); |
11461 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionSphereRadiusNV", EOpRayQueryGetIntersectionSphereRadiusNV); |
11462 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionLSSHitValueNV", EOpRayQueryGetIntersectionLSSHitValueNV); |
11463 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionLSSPositionsNV", EOpRayQueryGetIntersectionLSSPositionsNV); |
11464 | 108 | symbolTable.relateToOperator("rayQueryGetIntersectionLSSRadiiNV", EOpRayQueryGetIntersectionLSSRadiiNV); |
11465 | 108 | symbolTable.relateToOperator("rayQueryIsSphereHitNV", EOpRayQueryIsSphereHitNV); |
11466 | 108 | symbolTable.relateToOperator("rayQueryIsLSSHitNV", EOpRayQueryIsLSSHitNV); |
11467 | 108 | } |
11468 | | |
11469 | 4.34k | symbolTable.relateToOperator("interpolateAtCentroid", EOpInterpolateAtCentroid); |
11470 | 4.34k | symbolTable.relateToOperator("interpolateAtSample", EOpInterpolateAtSample); |
11471 | 4.34k | symbolTable.relateToOperator("interpolateAtOffset", EOpInterpolateAtOffset); |
11472 | | |
11473 | 4.34k | if (profile != EEsProfile) |
11474 | 4.08k | symbolTable.relateToOperator("interpolateAtVertexAMD", EOpInterpolateAtVertex); |
11475 | | |
11476 | 4.34k | symbolTable.relateToOperator("beginInvocationInterlockARB", EOpBeginInvocationInterlock); |
11477 | 4.34k | symbolTable.relateToOperator("endInvocationInterlockARB", EOpEndInvocationInterlock); |
11478 | | |
11479 | 4.34k | symbolTable.relateToOperator("stencilAttachmentReadEXT", EOpStencilAttachmentReadEXT); |
11480 | 4.34k | symbolTable.relateToOperator("depthAttachmentReadEXT", EOpDepthAttachmentReadEXT); |
11481 | 4.34k | symbolTable.relateToOperator("colorAttachmentReadEXT", EOpColorAttachmentReadEXT); |
11482 | | |
11483 | 4.34k | break; |
11484 | | |
11485 | 1.50k | case EShLangCompute: |
11486 | 1.50k | symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared); |
11487 | 1.50k | if ((profile != EEsProfile && version >= 450) || |
11488 | 927 | (profile == EEsProfile && version >= 320)) { |
11489 | 927 | symbolTable.relateToOperator("dFdx", EOpDPdx); |
11490 | 927 | symbolTable.relateToOperator("dFdy", EOpDPdy); |
11491 | 927 | symbolTable.relateToOperator("fwidth", EOpFwidth); |
11492 | 927 | symbolTable.relateToOperator("dFdxFine", EOpDPdxFine); |
11493 | 927 | symbolTable.relateToOperator("dFdyFine", EOpDPdyFine); |
11494 | 927 | symbolTable.relateToOperator("fwidthFine", EOpFwidthFine); |
11495 | 927 | symbolTable.relateToOperator("dFdxCoarse", EOpDPdxCoarse); |
11496 | 927 | symbolTable.relateToOperator("dFdyCoarse", EOpDPdyCoarse); |
11497 | 927 | symbolTable.relateToOperator("fwidthCoarse",EOpFwidthCoarse); |
11498 | 927 | } |
11499 | 1.50k | symbolTable.relateToOperator("coopMatLoadNV", EOpCooperativeMatrixLoadNV); |
11500 | 1.50k | symbolTable.relateToOperator("coopMatStoreNV", EOpCooperativeMatrixStoreNV); |
11501 | 1.50k | symbolTable.relateToOperator("coopMatMulAddNV", EOpCooperativeMatrixMulAddNV); |
11502 | | |
11503 | 1.50k | symbolTable.relateToOperator("coopMatLoad", EOpCooperativeMatrixLoad); |
11504 | 1.50k | symbolTable.relateToOperator("coopMatStore", EOpCooperativeMatrixStore); |
11505 | 1.50k | symbolTable.relateToOperator("coopMatMulAdd", EOpCooperativeMatrixMulAdd); |
11506 | | |
11507 | 1.50k | symbolTable.relateToOperator("coopMatLoadTensorNV", EOpCooperativeMatrixLoadTensorNV); |
11508 | 1.50k | symbolTable.relateToOperator("coopMatStoreTensorNV", EOpCooperativeMatrixStoreTensorNV); |
11509 | | |
11510 | 1.50k | symbolTable.relateToOperator("coopMatReduceNV", EOpCooperativeMatrixReduceNV); |
11511 | 1.50k | symbolTable.relateToOperator("coopMatPerElementNV", EOpCooperativeMatrixPerElementOpNV); |
11512 | 1.50k | symbolTable.relateToOperator("coopMatTransposeNV", EOpCooperativeMatrixTransposeNV); |
11513 | | |
11514 | 1.50k | symbolTable.relateToOperator("createTensorLayoutNV", EOpCreateTensorLayoutNV); |
11515 | 1.50k | symbolTable.relateToOperator("setTensorLayoutBlockSizeNV", EOpTensorLayoutSetBlockSizeNV); |
11516 | 1.50k | symbolTable.relateToOperator("setTensorLayoutDimensionNV", EOpTensorLayoutSetDimensionNV); |
11517 | 1.50k | symbolTable.relateToOperator("setTensorLayoutStrideNV", EOpTensorLayoutSetStrideNV); |
11518 | 1.50k | symbolTable.relateToOperator("sliceTensorLayoutNV", EOpTensorLayoutSliceNV); |
11519 | 1.50k | symbolTable.relateToOperator("setTensorLayoutClampValueNV", EOpTensorLayoutSetClampValueNV); |
11520 | | |
11521 | 1.50k | symbolTable.relateToOperator("createTensorViewNV", EOpCreateTensorViewNV); |
11522 | 1.50k | symbolTable.relateToOperator("setTensorViewDimensionsNV", EOpTensorViewSetDimensionNV); |
11523 | 1.50k | symbolTable.relateToOperator("setTensorViewStrideNV", EOpTensorViewSetStrideNV); |
11524 | 1.50k | symbolTable.relateToOperator("setTensorViewClipNV", EOpTensorViewSetClipNV); |
11525 | | |
11526 | 1.50k | symbolTable.relateToOperator("tensorReadARM", EOpTensorReadARM); |
11527 | 1.50k | symbolTable.relateToOperator("tensorWriteARM", EOpTensorWriteARM); |
11528 | 1.50k | symbolTable.relateToOperator("tensorSizeARM", EOpTensorSizeARM); |
11529 | | |
11530 | 1.50k | symbolTable.relateToOperator("bitcastQCOM", EOpBitCastArrayQCOM); |
11531 | 1.50k | symbolTable.relateToOperator("extractSubArrayQCOM", EOpExtractSubArrayQCOM); |
11532 | 1.50k | symbolTable.relateToOperator("vectorToCoopmatQCOM", EOpCompositeConstructCoopMatQCOM); |
11533 | 1.50k | symbolTable.relateToOperator("coopmatToVectorQCOM", EOpCompositeExtractCoopMatQCOM); |
11534 | | |
11535 | 1.50k | if (profile != EEsProfile && version >= 460) { |
11536 | 108 | symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); |
11537 | 108 | symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); |
11538 | 108 | } |
11539 | 1.50k | break; |
11540 | | |
11541 | 883 | case EShLangRayGen: |
11542 | 883 | if (profile != EEsProfile && version >= 460) { |
11543 | 108 | symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); |
11544 | 108 | symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); |
11545 | 108 | } |
11546 | 883 | [[fallthrough]]; |
11547 | 1.76k | case EShLangClosestHit: |
11548 | 2.64k | case EShLangMiss: |
11549 | 2.64k | if (profile != EEsProfile && version >= 460) { |
11550 | 324 | symbolTable.relateToOperator("traceNV", EOpTraceNV); |
11551 | 324 | symbolTable.relateToOperator("traceRayMotionNV", EOpTraceRayMotionNV); |
11552 | 324 | symbolTable.relateToOperator("traceRayEXT", EOpTraceKHR); |
11553 | 324 | symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); |
11554 | 324 | symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR); |
11555 | | |
11556 | 324 | symbolTable.relateToOperator("hitObjectTraceRayNV", EOpHitObjectTraceRayNV); |
11557 | 324 | symbolTable.relateToOperator("hitObjectTraceRayMotionNV", EOpHitObjectTraceRayMotionNV); |
11558 | 324 | symbolTable.relateToOperator("hitObjectRecordHitNV", EOpHitObjectRecordHitNV); |
11559 | 324 | symbolTable.relateToOperator("hitObjectRecordHitMotionNV", EOpHitObjectRecordHitMotionNV); |
11560 | 324 | symbolTable.relateToOperator("hitObjectRecordHitWithIndexNV", EOpHitObjectRecordHitWithIndexNV); |
11561 | 324 | symbolTable.relateToOperator("hitObjectRecordHitWithIndexMotionNV", EOpHitObjectRecordHitWithIndexMotionNV); |
11562 | 324 | symbolTable.relateToOperator("hitObjectRecordMissNV", EOpHitObjectRecordMissNV); |
11563 | 324 | symbolTable.relateToOperator("hitObjectRecordMissMotionNV", EOpHitObjectRecordMissMotionNV); |
11564 | 324 | symbolTable.relateToOperator("hitObjectRecordEmptyNV", EOpHitObjectRecordEmptyNV); |
11565 | 324 | symbolTable.relateToOperator("hitObjectExecuteShaderNV", EOpHitObjectExecuteShaderNV); |
11566 | 324 | symbolTable.relateToOperator("hitObjectIsEmptyNV", EOpHitObjectIsEmptyNV); |
11567 | 324 | symbolTable.relateToOperator("hitObjectIsMissNV", EOpHitObjectIsMissNV); |
11568 | 324 | symbolTable.relateToOperator("hitObjectIsHitNV", EOpHitObjectIsHitNV); |
11569 | 324 | symbolTable.relateToOperator("hitObjectGetRayTMinNV", EOpHitObjectGetRayTMinNV); |
11570 | 324 | symbolTable.relateToOperator("hitObjectGetRayTMaxNV", EOpHitObjectGetRayTMaxNV); |
11571 | 324 | symbolTable.relateToOperator("hitObjectGetObjectRayOriginNV", EOpHitObjectGetObjectRayOriginNV); |
11572 | 324 | symbolTable.relateToOperator("hitObjectGetObjectRayDirectionNV", EOpHitObjectGetObjectRayDirectionNV); |
11573 | 324 | symbolTable.relateToOperator("hitObjectGetWorldRayOriginNV", EOpHitObjectGetWorldRayOriginNV); |
11574 | 324 | symbolTable.relateToOperator("hitObjectGetWorldRayDirectionNV", EOpHitObjectGetWorldRayDirectionNV); |
11575 | 324 | symbolTable.relateToOperator("hitObjectGetWorldToObjectNV", EOpHitObjectGetWorldToObjectNV); |
11576 | 324 | symbolTable.relateToOperator("hitObjectGetObjectToWorldNV", EOpHitObjectGetObjectToWorldNV); |
11577 | 324 | symbolTable.relateToOperator("hitObjectGetInstanceCustomIndexNV", EOpHitObjectGetInstanceCustomIndexNV); |
11578 | 324 | symbolTable.relateToOperator("hitObjectGetInstanceIdNV", EOpHitObjectGetInstanceIdNV); |
11579 | 324 | symbolTable.relateToOperator("hitObjectGetGeometryIndexNV", EOpHitObjectGetGeometryIndexNV); |
11580 | 324 | symbolTable.relateToOperator("hitObjectGetPrimitiveIndexNV", EOpHitObjectGetPrimitiveIndexNV); |
11581 | 324 | symbolTable.relateToOperator("hitObjectGetHitKindNV", EOpHitObjectGetHitKindNV); |
11582 | 324 | symbolTable.relateToOperator("hitObjectGetAttributesNV", EOpHitObjectGetAttributesNV); |
11583 | 324 | symbolTable.relateToOperator("hitObjectGetCurrentTimeNV", EOpHitObjectGetCurrentTimeNV); |
11584 | 324 | symbolTable.relateToOperator("hitObjectGetShaderBindingTableRecordIndexNV", EOpHitObjectGetShaderBindingTableRecordIndexNV); |
11585 | 324 | symbolTable.relateToOperator("hitObjectGetShaderRecordBufferHandleNV", EOpHitObjectGetShaderRecordBufferHandleNV); |
11586 | 324 | symbolTable.relateToOperator("hitObjectGetClusterIdNV", EOpHitObjectGetClusterIdNV); |
11587 | 324 | symbolTable.relateToOperator("reorderThreadNV", EOpReorderThreadNV); |
11588 | 324 | symbolTable.relateToOperator("hitObjectGetSpherePositionNV", EOpHitObjectGetSpherePositionNV); |
11589 | 324 | symbolTable.relateToOperator("hitObjectGetSphereRadiusNV", EOpHitObjectGetSphereRadiusNV); |
11590 | 324 | symbolTable.relateToOperator("hitObjectGetLSSPositionsNV", EOpHitObjectGetLSSPositionsNV); |
11591 | 324 | symbolTable.relateToOperator("hitObjectGetLSSRadiiNV", EOpHitObjectGetLSSRadiiNV); |
11592 | 324 | symbolTable.relateToOperator("hitObjectIsSphereHitNV", EOpHitObjectIsSphereHitNV); |
11593 | 324 | symbolTable.relateToOperator("hitObjectIsLSSHitNV", EOpHitObjectIsLSSHitNV); |
11594 | 324 | symbolTable.relateToOperator("hitObjectTraceRayEXT", EOpHitObjectTraceRayEXT); |
11595 | 324 | symbolTable.relateToOperator("hitObjectTraceRayMotionEXT", EOpHitObjectTraceRayMotionEXT); |
11596 | 324 | symbolTable.relateToOperator("hitObjectRecordMissEXT", EOpHitObjectRecordMissEXT); |
11597 | 324 | symbolTable.relateToOperator("hitObjectRecordMissMotionEXT", EOpHitObjectRecordMissMotionEXT); |
11598 | 324 | symbolTable.relateToOperator("hitObjectRecordEmptyEXT", EOpHitObjectRecordEmptyEXT); |
11599 | 324 | symbolTable.relateToOperator("hitObjectExecuteShaderEXT", EOpHitObjectExecuteShaderEXT); |
11600 | 324 | symbolTable.relateToOperator("hitObjectIsEmptyEXT", EOpHitObjectIsEmptyEXT); |
11601 | 324 | symbolTable.relateToOperator("hitObjectIsMissEXT", EOpHitObjectIsMissEXT); |
11602 | 324 | symbolTable.relateToOperator("hitObjectIsHitEXT", EOpHitObjectIsHitEXT); |
11603 | 324 | symbolTable.relateToOperator("hitObjectGetRayTMinEXT", EOpHitObjectGetRayTMinEXT); |
11604 | 324 | symbolTable.relateToOperator("hitObjectGetRayTMaxEXT", EOpHitObjectGetRayTMaxEXT); |
11605 | 324 | symbolTable.relateToOperator("hitObjectGetRayFlagsEXT", EOpHitObjectGetRayFlagsEXT); |
11606 | 324 | symbolTable.relateToOperator("hitObjectGetObjectRayOriginEXT", EOpHitObjectGetObjectRayOriginEXT); |
11607 | 324 | symbolTable.relateToOperator("hitObjectGetObjectRayDirectionEXT", EOpHitObjectGetObjectRayDirectionEXT); |
11608 | 324 | symbolTable.relateToOperator("hitObjectGetWorldRayOriginEXT", EOpHitObjectGetWorldRayOriginEXT); |
11609 | 324 | symbolTable.relateToOperator("hitObjectGetWorldRayDirectionEXT", EOpHitObjectGetWorldRayDirectionEXT); |
11610 | 324 | symbolTable.relateToOperator("hitObjectGetWorldToObjectEXT", EOpHitObjectGetWorldToObjectEXT); |
11611 | 324 | symbolTable.relateToOperator("hitObjectGetObjectToWorldEXT", EOpHitObjectGetObjectToWorldEXT); |
11612 | 324 | symbolTable.relateToOperator("hitObjectGetInstanceCustomIndexEXT", EOpHitObjectGetInstanceCustomIndexEXT); |
11613 | 324 | symbolTable.relateToOperator("hitObjectGetInstanceIdEXT", EOpHitObjectGetInstanceIdEXT); |
11614 | 324 | symbolTable.relateToOperator("hitObjectGetGeometryIndexEXT", EOpHitObjectGetGeometryIndexEXT); |
11615 | 324 | symbolTable.relateToOperator("hitObjectGetPrimitiveIndexEXT", EOpHitObjectGetPrimitiveIndexEXT); |
11616 | 324 | symbolTable.relateToOperator("hitObjectGetHitKindEXT", EOpHitObjectGetHitKindEXT); |
11617 | 324 | symbolTable.relateToOperator("hitObjectGetAttributesEXT", EOpHitObjectGetAttributesEXT); |
11618 | 324 | symbolTable.relateToOperator("hitObjectGetCurrentTimeEXT", EOpHitObjectGetCurrentTimeEXT); |
11619 | 324 | symbolTable.relateToOperator("hitObjectGetShaderBindingTableRecordIndexEXT", EOpHitObjectGetShaderBindingTableRecordIndexEXT); |
11620 | 324 | symbolTable.relateToOperator("hitObjectGetShaderRecordBufferHandleEXT", EOpHitObjectGetShaderRecordBufferHandleEXT); |
11621 | 324 | symbolTable.relateToOperator("hitObjectSetShaderBindingTableRecordIndexEXT", EOpHitObjectSetShaderBindingTableRecordIndexEXT); |
11622 | 324 | symbolTable.relateToOperator("reorderThreadEXT", EOpReorderThreadEXT); |
11623 | 324 | symbolTable.relateToOperator("hitObjectReorderExecuteEXT", EOpHitObjectReorderExecuteEXT); |
11624 | 324 | symbolTable.relateToOperator("hitObjectTraceReorderExecuteEXT", EOpHitObjectTraceReorderExecuteEXT); |
11625 | 324 | symbolTable.relateToOperator("hitObjectTraceMotionReorderExecuteEXT", EOpHitObjectTraceMotionReorderExecuteEXT); |
11626 | 324 | symbolTable.relateToOperator("hitObjectRecordFromQueryEXT", EOpHitObjectRecordFromQueryEXT); |
11627 | 324 | symbolTable.relateToOperator("hitObjectGetIntersectionTriangleVertexPositionsEXT", EOpHitObjectGetIntersectionTriangleVertexPositionsEXT); |
11628 | 324 | } |
11629 | 2.64k | break; |
11630 | 883 | case EShLangIntersect: |
11631 | 883 | if (profile != EEsProfile && version >= 460) { |
11632 | 108 | symbolTable.relateToOperator("reportIntersectionNV", EOpReportIntersection); |
11633 | 108 | symbolTable.relateToOperator("reportIntersectionEXT", EOpReportIntersection); |
11634 | 108 | } |
11635 | 883 | break; |
11636 | 883 | case EShLangAnyHit: |
11637 | 883 | if (profile != EEsProfile && version >= 460) { |
11638 | 108 | symbolTable.relateToOperator("ignoreIntersectionNV", EOpIgnoreIntersectionNV); |
11639 | 108 | symbolTable.relateToOperator("terminateRayNV", EOpTerminateRayNV); |
11640 | 108 | } |
11641 | 883 | break; |
11642 | 883 | case EShLangCallable: |
11643 | 883 | if (profile != EEsProfile && version >= 460) { |
11644 | 108 | symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); |
11645 | 108 | symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR); |
11646 | 108 | } |
11647 | 883 | break; |
11648 | 924 | case EShLangMesh: |
11649 | 924 | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
11650 | 924 | symbolTable.relateToOperator("writePackedPrimitiveIndices4x8NV", EOpWritePackedPrimitiveIndices4x8NV); |
11651 | 924 | symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); |
11652 | 924 | symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); |
11653 | 924 | symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared); |
11654 | 924 | } |
11655 | | |
11656 | 924 | if (profile != EEsProfile && version >= 450) { |
11657 | 880 | symbolTable.relateToOperator("SetMeshOutputsEXT", EOpSetMeshOutputsEXT); |
11658 | 880 | } |
11659 | | |
11660 | 924 | if (profile != EEsProfile && version >= 460) { |
11661 | | // Builtins for GL_NV_displacement_micromap. |
11662 | 108 | symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); |
11663 | 108 | symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); |
11664 | 108 | } |
11665 | 924 | break; |
11666 | 927 | case EShLangTask: |
11667 | 927 | if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { |
11668 | 927 | symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); |
11669 | 927 | symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); |
11670 | 927 | symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared); |
11671 | 927 | } |
11672 | 927 | if (profile != EEsProfile && version >= 450) { |
11673 | 883 | symbolTable.relateToOperator("EmitMeshTasksEXT", EOpEmitMeshTasksEXT); |
11674 | 883 | } |
11675 | 927 | break; |
11676 | | |
11677 | 0 | default: |
11678 | 0 | assert(false && "Language not supported"); |
11679 | 23.4k | } |
11680 | 23.4k | } |
11681 | | |
11682 | | // |
11683 | | // Add context-dependent (resource-specific) built-ins not handled by the above. These |
11684 | | // would be ones that need to be programmatically added because they cannot |
11685 | | // be added by simple text strings. For these, also |
11686 | | // 1) Map built-in functions to operators, for those that will turn into an operation node |
11687 | | // instead of remaining a function call. |
11688 | | // 2) Tag extension-related symbols added to their base version with their extensions, so |
11689 | | // that if an early version has the extension turned off, there is an error reported on use. |
11690 | | // |
11691 | | void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) |
11692 | 10.4k | { |
11693 | 10.4k | if (profile != EEsProfile && version >= 430 && version < 440) { |
11694 | 1.03k | symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &E_GL_ARB_enhanced_layouts); |
11695 | 1.03k | symbolTable.setVariableExtensions("gl_MaxTransformFeedbackInterleavedComponents", 1, &E_GL_ARB_enhanced_layouts); |
11696 | 1.03k | } |
11697 | 10.4k | if (profile != EEsProfile && version >= 130 && version < 420) { |
11698 | 5.04k | symbolTable.setVariableExtensions("gl_MinProgramTexelOffset", 1, &E_GL_ARB_shading_language_420pack); |
11699 | 5.04k | symbolTable.setVariableExtensions("gl_MaxProgramTexelOffset", 1, &E_GL_ARB_shading_language_420pack); |
11700 | 5.04k | } |
11701 | 10.4k | if (profile != EEsProfile && version >= 150 && version < 410) |
11702 | 1.95k | symbolTable.setVariableExtensions("gl_MaxViewports", 1, &E_GL_ARB_viewport_array); |
11703 | | |
11704 | 10.4k | switch(language) { |
11705 | 756 | case EShLangFragment: |
11706 | | // Set up gl_FragData based on current array size. |
11707 | 756 | if (version == 100 || IncludeLegacy(version, profile, spvVersion) || (! ForwardCompatibility && profile != EEsProfile && version < 420)) { |
11708 | 395 | TPrecisionQualifier pq = profile == EEsProfile ? EpqMedium : EpqNone; |
11709 | 395 | TType fragData(EbtFloat, EvqFragColor, pq, 4); |
11710 | 395 | TArraySizes* arraySizes = new TArraySizes; |
11711 | 395 | arraySizes->addInnerSize(resources.maxDrawBuffers); |
11712 | 395 | fragData.transferArraySizes(arraySizes); |
11713 | 395 | symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData)); |
11714 | 395 | SpecialQualifier("gl_FragData", EvqFragColor, EbvFragData, symbolTable); |
11715 | 395 | } |
11716 | | |
11717 | | // GL_EXT_blend_func_extended |
11718 | 756 | if (profile == EEsProfile && version >= 100) { |
11719 | 72 | symbolTable.setVariableExtensions("gl_MaxDualSourceDrawBuffersEXT", 1, &E_GL_EXT_blend_func_extended); |
11720 | 72 | symbolTable.setVariableExtensions("gl_SecondaryFragColorEXT", 1, &E_GL_EXT_blend_func_extended); |
11721 | 72 | symbolTable.setVariableExtensions("gl_SecondaryFragDataEXT", 1, &E_GL_EXT_blend_func_extended); |
11722 | 72 | SpecialQualifier("gl_SecondaryFragColorEXT", EvqVaryingOut, EbvSecondaryFragColorEXT, symbolTable); |
11723 | 72 | SpecialQualifier("gl_SecondaryFragDataEXT", EvqVaryingOut, EbvSecondaryFragDataEXT, symbolTable); |
11724 | 72 | } |
11725 | | |
11726 | 756 | break; |
11727 | | |
11728 | 6 | case EShLangTessControl: |
11729 | 7 | case EShLangTessEvaluation: |
11730 | | // Because of the context-dependent array size (gl_MaxPatchVertices), |
11731 | | // these variables were added later than the others and need to be mapped now. |
11732 | | |
11733 | | // standard members |
11734 | 7 | BuiltInVariable("gl_in", "gl_Position", EbvPosition, symbolTable); |
11735 | 7 | BuiltInVariable("gl_in", "gl_PointSize", EbvPointSize, symbolTable); |
11736 | 7 | BuiltInVariable("gl_in", "gl_ClipDistance", EbvClipDistance, symbolTable); |
11737 | 7 | BuiltInVariable("gl_in", "gl_CullDistance", EbvCullDistance, symbolTable); |
11738 | | |
11739 | | // compatibility members |
11740 | 7 | BuiltInVariable("gl_in", "gl_ClipVertex", EbvClipVertex, symbolTable); |
11741 | 7 | BuiltInVariable("gl_in", "gl_FrontColor", EbvFrontColor, symbolTable); |
11742 | 7 | BuiltInVariable("gl_in", "gl_BackColor", EbvBackColor, symbolTable); |
11743 | 7 | BuiltInVariable("gl_in", "gl_FrontSecondaryColor", EbvFrontSecondaryColor, symbolTable); |
11744 | 7 | BuiltInVariable("gl_in", "gl_BackSecondaryColor", EbvBackSecondaryColor, symbolTable); |
11745 | 7 | BuiltInVariable("gl_in", "gl_TexCoord", EbvTexCoord, symbolTable); |
11746 | 7 | BuiltInVariable("gl_in", "gl_FogFragCoord", EbvFogFragCoord, symbolTable); |
11747 | | |
11748 | 7 | symbolTable.setVariableExtensions("gl_in", "gl_SecondaryPositionNV", 1, &E_GL_NV_stereo_view_rendering); |
11749 | 7 | symbolTable.setVariableExtensions("gl_in", "gl_PositionPerViewNV", 1, &E_GL_NVX_multiview_per_view_attributes); |
11750 | | |
11751 | 7 | BuiltInVariable("gl_in", "gl_SecondaryPositionNV", EbvSecondaryPositionNV, symbolTable); |
11752 | 7 | BuiltInVariable("gl_in", "gl_PositionPerViewNV", EbvPositionPerViewNV, symbolTable); |
11753 | | |
11754 | | // extension requirements |
11755 | 7 | if (profile == EEsProfile) { |
11756 | 0 | symbolTable.setVariableExtensions("gl_in", "gl_PointSize", Num_AEP_tessellation_point_size, AEP_tessellation_point_size); |
11757 | 0 | } |
11758 | | |
11759 | 7 | break; |
11760 | | |
11761 | 9.70k | default: |
11762 | 9.70k | break; |
11763 | 10.4k | } |
11764 | 10.4k | } |
11765 | | |
11766 | | // Determine whether this fnCandidate overload is supported for these arguments. |
11767 | | // Some of this is based on the BaseFunctions table, but for functions not in that |
11768 | | // table there's some handcoded logic. |
11769 | | // If the overload is supported, then this sets the specific parameter/result |
11770 | | // types and returns true. |
11771 | | bool IsSupportedLongVectorBuiltin(const TFunction* fnCandidate, TType* resultType, TIntermNode* arguments) |
11772 | 0 | { |
11773 | 0 | TOperator op = fnCandidate->getBuiltInOp(); |
11774 | |
|
11775 | 0 | const auto &getArg = [&](uint32_t i) { |
11776 | 0 | TIntermAggregate* aggregate = arguments->getAsAggregate(); |
11777 | 0 | return fnCandidate->getParamCount() == 1 ? arguments->getAsTyped() : (aggregate ? aggregate->getSequence()[i]->getAsTyped() : arguments->getAsTyped()); |
11778 | 0 | }; |
11779 | |
|
11780 | 0 | bool valid = true; |
11781 | |
|
11782 | 0 | const auto &checkFnTypes = [&](TIntermTyped *t, uint32_t types) { |
11783 | 0 | if (t->getType().isFloatingDomain() && !(types & TypeF)) { |
11784 | 0 | valid = false; |
11785 | 0 | } |
11786 | 0 | if (isTypeSignedInt(t->getType().getBasicType()) && !(types & TypeI)) { |
11787 | 0 | valid = false; |
11788 | 0 | } |
11789 | 0 | if (isTypeUnsignedInt(t->getType().getBasicType()) && !(types & TypeU)) { |
11790 | 0 | valid = false; |
11791 | 0 | } |
11792 | 0 | if (t->getType().getBasicType() == EbtBool && !(types & TypeB)) { |
11793 | 0 | valid = false; |
11794 | 0 | } |
11795 | 0 | }; |
11796 | |
|
11797 | 0 | const auto &checkShape = [&](TIntermTyped *t0, TIntermTyped *t1) { |
11798 | 0 | if (!t0->getType().sameLongVectorShape(t1->getType())) { |
11799 | 0 | valid = false; |
11800 | 0 | } |
11801 | 0 | }; |
11802 | |
|
11803 | 0 | const auto &checkSameType = [&](TIntermTyped *t0, TIntermTyped *t1) { |
11804 | 0 | if (t0->getType() != t1->getType()) { |
11805 | 0 | valid = false; |
11806 | 0 | } |
11807 | 0 | }; |
11808 | |
|
11809 | 0 | const auto &checkArgsMatch = [&](uint32_t argStart, uint32_t argEnd, uint32_t types) { |
11810 | 0 | for (uint32_t i = argStart; i < argEnd; ++i) { |
11811 | 0 | checkFnTypes(getArg(i), types); |
11812 | 0 | if (i != argStart) { |
11813 | 0 | checkSameType(getArg(argStart), getArg(i)); |
11814 | 0 | } |
11815 | 0 | } |
11816 | 0 | }; |
11817 | |
|
11818 | 0 | uint32_t paramCount = fnCandidate->getParamCount(); |
11819 | |
|
11820 | 0 | bool foundInBase = false; |
11821 | 0 | for (const auto &fn : BaseFunctions) { |
11822 | 0 | if (fn.op != op) { |
11823 | 0 | continue; |
11824 | 0 | } |
11825 | 0 | valid = true; |
11826 | 0 | foundInBase = true; |
11827 | |
|
11828 | 0 | TIntermTyped *firstLongVector = nullptr; |
11829 | 0 | for (uint32_t i = 0; i < paramCount; ++i) { |
11830 | 0 | TIntermTyped* arg = getArg(i); |
11831 | |
|
11832 | 0 | ArgType argType = fn.types; |
11833 | 0 | if (i == paramCount - 1 && (fn.classes & ClassLB)) { |
11834 | 0 | argType = TypeB; |
11835 | 0 | } |
11836 | |
|
11837 | 0 | checkFnTypes(arg, argType); |
11838 | |
|
11839 | 0 | if ((fn.classes & ClassLS) && getArg(paramCount-1)->getType().isScalar()) { |
11840 | 0 | if (getArg(paramCount-1)->getType().getBasicType() != arg->getBasicType()) { |
11841 | 0 | valid = false; |
11842 | 0 | } |
11843 | 0 | } |
11844 | |
|
11845 | 0 | if (arg->getType().isLongVector()) { |
11846 | 0 | if (firstLongVector != nullptr) { |
11847 | 0 | checkShape(firstLongVector, arg); |
11848 | 0 | } |
11849 | 0 | if (firstLongVector == nullptr) { |
11850 | 0 | firstLongVector = arg; |
11851 | 0 | } |
11852 | 0 | } |
11853 | 0 | } |
11854 | |
|
11855 | 0 | uint32_t argsToMatchStart = 0; |
11856 | 0 | uint32_t argsToMatchEnd = paramCount; |
11857 | 0 | if (fn.classes & ClassFS) |
11858 | 0 | argsToMatchStart++; |
11859 | 0 | if (fn.classes & ClassFS2) |
11860 | 0 | argsToMatchStart += 2; |
11861 | 0 | if ((fn.classes & ClassLS) && getArg(paramCount-1)->getType().isScalar()) |
11862 | 0 | argsToMatchEnd--; |
11863 | 0 | if (fn.classes & ClassXLS) |
11864 | 0 | argsToMatchEnd--; |
11865 | 0 | if (fn.classes & ClassLS2) |
11866 | 0 | argsToMatchEnd -= 2; |
11867 | 0 | if (fn.classes & ClassLB) |
11868 | 0 | argsToMatchEnd--; |
11869 | | |
11870 | 0 | checkArgsMatch(argsToMatchStart, argsToMatchEnd, fn.types); |
11871 | | |
11872 | | // These ops (arbitrarily) don't support double precision |
11873 | 0 | switch (op) { |
11874 | 0 | case EOpRadians: |
11875 | 0 | case EOpDegrees: |
11876 | 0 | case EOpSin: |
11877 | 0 | case EOpCos: |
11878 | 0 | case EOpTan: |
11879 | 0 | case EOpAcos: |
11880 | 0 | case EOpAsin: |
11881 | 0 | case EOpAtan: |
11882 | 0 | case EOpAcosh: |
11883 | 0 | case EOpAsinh: |
11884 | 0 | case EOpAtanh: |
11885 | 0 | case EOpTanh: |
11886 | 0 | case EOpCosh: |
11887 | 0 | case EOpSinh: |
11888 | 0 | case EOpPow: |
11889 | 0 | case EOpExp: |
11890 | 0 | case EOpLog: |
11891 | 0 | case EOpExp2: |
11892 | 0 | case EOpLog2: |
11893 | 0 | if (getArg(0)->getType().getBasicType() == EbtDouble) { |
11894 | 0 | return false; |
11895 | 0 | } |
11896 | 0 | break; |
11897 | 0 | default: |
11898 | 0 | break; |
11899 | 0 | } |
11900 | | |
11901 | 0 | if (valid) { |
11902 | | // It's valid, so override the types and return true |
11903 | 0 | assert(firstLongVector); |
11904 | 0 | resultType->deepCopy(firstLongVector->getType()); |
11905 | 0 | if (fn.classes & ClassB) { |
11906 | 0 | resultType->setBasicType(EbtBool); |
11907 | 0 | } |
11908 | 0 | if (fn.classes & ClassRS) { |
11909 | 0 | resultType->deepCopy(TType(firstLongVector->getType().getBasicType())); |
11910 | 0 | } |
11911 | 0 | if (fn.classes & ClassLO) { |
11912 | 0 | getArg(fnCandidate->getParamCount() - 1)->setType(getArg(0)->getType()); |
11913 | 0 | } |
11914 | 0 | return true; |
11915 | 0 | } |
11916 | 0 | } |
11917 | | // If it was in the base table but not supported, fail. The rest of the logic |
11918 | | // is for ops not in the base table. |
11919 | 0 | if (foundInBase) { |
11920 | 0 | return false; |
11921 | 0 | } |
11922 | | |
11923 | | // Check the arg0 type and if this and other checks have passed, then set |
11924 | | // the result type to the bitcasted result |
11925 | 0 | const auto &checkBitCast = [&](TBasicType fromBasicType, TBasicType newBasicType) { |
11926 | 0 | if (getArg(0)->getType().getBasicType() != fromBasicType) { |
11927 | 0 | valid = false; |
11928 | 0 | } |
11929 | 0 | if (valid) { |
11930 | 0 | resultType->deepCopy(getArg(0)->getType()); |
11931 | 0 | resultType->setBasicType(newBasicType); |
11932 | 0 | } |
11933 | 0 | }; |
11934 | |
|
11935 | 0 | valid = true; |
11936 | 0 | switch (op) { |
11937 | 0 | case EOpFrexp: |
11938 | 0 | case EOpLdexp: |
11939 | 0 | checkFnTypes(getArg(0), TypeF); |
11940 | 0 | checkFnTypes(getArg(1), TypeI); |
11941 | 0 | checkShape(getArg(0), getArg(1)); |
11942 | 0 | if (valid) { |
11943 | 0 | resultType->deepCopy(getArg(0)->getType()); |
11944 | 0 | } |
11945 | 0 | return valid; |
11946 | 0 | case EOpFloatBitsToInt: |
11947 | 0 | if (fnCandidate->getName() == "bfloat16BitsToIntEXT") { |
11948 | 0 | checkBitCast(EbtBFloat16, EbtInt16); |
11949 | 0 | } else if (fnCandidate->getName() == "floate5m2BitsToIntEXT") { |
11950 | 0 | checkBitCast(EbtFloatE5M2, EbtInt8); |
11951 | 0 | } else if (fnCandidate->getName() == "floate4m3BitsToIntEXT") { |
11952 | 0 | checkBitCast(EbtFloatE4M3, EbtInt8); |
11953 | 0 | } else { |
11954 | 0 | checkBitCast(EbtFloat, EbtInt); |
11955 | 0 | } |
11956 | 0 | return valid; |
11957 | 0 | case EOpFloatBitsToUint: |
11958 | 0 | if (fnCandidate->getName() == "bfloat16BitsToUintEXT") { |
11959 | 0 | checkBitCast(EbtBFloat16, EbtUint16); |
11960 | 0 | } else if (fnCandidate->getName() == "floate5m2BitsToUintEXT") { |
11961 | 0 | checkBitCast(EbtFloatE5M2, EbtUint8); |
11962 | 0 | } else if (fnCandidate->getName() == "floate4m3BitsToUintEXT") { |
11963 | 0 | checkBitCast(EbtFloatE4M3, EbtUint8); |
11964 | 0 | } else { |
11965 | 0 | checkBitCast(EbtFloat, EbtUint); |
11966 | 0 | } |
11967 | 0 | return valid; |
11968 | 0 | case EOpIntBitsToFloat: |
11969 | 0 | if (fnCandidate->getName() == "intBitsToBFloat16EXT") { |
11970 | 0 | checkBitCast(EbtInt16, EbtBFloat16); |
11971 | 0 | } else if (fnCandidate->getName() == "intBitsToFloate5m2EXT") { |
11972 | 0 | checkBitCast(EbtInt8, EbtFloatE5M2); |
11973 | 0 | } else if (fnCandidate->getName() == "intBitsToFloate4m3EXT") { |
11974 | 0 | checkBitCast(EbtInt8, EbtFloatE4M3); |
11975 | 0 | } else { |
11976 | 0 | checkBitCast(EbtInt, EbtFloat); |
11977 | 0 | } |
11978 | 0 | return valid; |
11979 | 0 | case EOpUintBitsToFloat: |
11980 | 0 | if (fnCandidate->getName() == "uintBitsToBFloat16EXT") { |
11981 | 0 | checkBitCast(EbtUint16, EbtBFloat16); |
11982 | 0 | } else if (fnCandidate->getName() == "uintBitsToFloate5m2EXT") { |
11983 | 0 | checkBitCast(EbtUint8, EbtFloatE5M2); |
11984 | 0 | } else if (fnCandidate->getName() == "uintBitsToFloate4m3EXT") { |
11985 | 0 | checkBitCast(EbtUint8, EbtFloatE4M3); |
11986 | 0 | } else { |
11987 | 0 | checkBitCast(EbtUint, EbtFloat); |
11988 | 0 | } |
11989 | 0 | return valid; |
11990 | 0 | case EOpDoubleBitsToInt64: |
11991 | 0 | checkBitCast(EbtDouble, EbtInt64); |
11992 | 0 | return valid; |
11993 | 0 | case EOpDoubleBitsToUint64: |
11994 | 0 | checkBitCast(EbtDouble, EbtUint64); |
11995 | 0 | return valid; |
11996 | 0 | case EOpInt64BitsToDouble: |
11997 | 0 | checkBitCast(EbtInt64, EbtDouble); |
11998 | 0 | return valid; |
11999 | 0 | case EOpUint64BitsToDouble: |
12000 | 0 | checkBitCast(EbtUint64, EbtDouble); |
12001 | 0 | return valid; |
12002 | 0 | case EOpFloat16BitsToInt16: |
12003 | 0 | checkBitCast(EbtFloat16, EbtInt16); |
12004 | 0 | return valid; |
12005 | 0 | case EOpFloat16BitsToUint16: |
12006 | 0 | checkBitCast(EbtFloat16, EbtUint16); |
12007 | 0 | return valid; |
12008 | 0 | case EOpInt16BitsToFloat16: |
12009 | 0 | checkBitCast(EbtInt16, EbtFloat16); |
12010 | 0 | return valid; |
12011 | 0 | case EOpUint16BitsToFloat16: |
12012 | 0 | checkBitCast(EbtUint16, EbtFloat16); |
12013 | 0 | return valid; |
12014 | | |
12015 | 0 | case EOpFma: |
12016 | 0 | checkArgsMatch(0, paramCount, TypeF); |
12017 | 0 | if (valid) { |
12018 | 0 | resultType->deepCopy(getArg(0)->getType()); |
12019 | 0 | } |
12020 | 0 | return valid; |
12021 | 0 | case EOpAddCarry: |
12022 | 0 | case EOpSubBorrow: |
12023 | 0 | checkArgsMatch(0, paramCount, TypeU); |
12024 | 0 | if (valid) { |
12025 | 0 | resultType->deepCopy(getArg(0)->getType()); |
12026 | 0 | } |
12027 | 0 | return valid; |
12028 | 0 | case EOpUMulExtended: |
12029 | 0 | checkArgsMatch(0, paramCount, TypeU); |
12030 | 0 | return valid; |
12031 | 0 | case EOpIMulExtended: |
12032 | 0 | checkArgsMatch(0, paramCount, TypeI); |
12033 | 0 | return valid; |
12034 | 0 | case EOpBitfieldExtract: |
12035 | 0 | case EOpBitFieldReverse: |
12036 | 0 | checkFnTypes(getArg(0), TypeIU); |
12037 | 0 | if (valid) { |
12038 | 0 | resultType->deepCopy(getArg(0)->getType()); |
12039 | 0 | } |
12040 | 0 | return valid; |
12041 | 0 | case EOpBitfieldInsert: |
12042 | 0 | checkArgsMatch(0, 2, TypeIU); |
12043 | 0 | checkSameType(getArg(0), getArg(1)); |
12044 | 0 | if (valid) { |
12045 | 0 | resultType->deepCopy(getArg(0)->getType()); |
12046 | 0 | } |
12047 | 0 | return valid; |
12048 | 0 | case EOpFindLSB: |
12049 | 0 | case EOpFindMSB: |
12050 | 0 | case EOpBitCount: |
12051 | 0 | checkFnTypes(getArg(0), TypeIU); |
12052 | 0 | if (valid) { |
12053 | 0 | TType newType; |
12054 | 0 | newType.deepCopy(getArg(0)->getType()); |
12055 | 0 | newType.setBasicType(unsignedTypeToSigned(newType.getBasicType())); |
12056 | 0 | resultType->deepCopy(newType); |
12057 | 0 | } |
12058 | 0 | return valid; |
12059 | 0 | case EOpDPdx: |
12060 | 0 | case EOpDPdxFine: |
12061 | 0 | case EOpDPdxCoarse: |
12062 | 0 | case EOpDPdy: |
12063 | 0 | case EOpDPdyFine: |
12064 | 0 | case EOpDPdyCoarse: |
12065 | 0 | case EOpFwidth: |
12066 | 0 | case EOpFwidthFine: |
12067 | 0 | case EOpFwidthCoarse: |
12068 | 0 | checkFnTypes(getArg(0), TypeF); |
12069 | 0 | if (valid) { |
12070 | 0 | resultType->deepCopy(getArg(0)->getType()); |
12071 | 0 | } |
12072 | 0 | return valid; |
12073 | 0 | case EOpExpectEXT: |
12074 | 0 | checkArgsMatch(0, paramCount, TypeIU | TypeB); |
12075 | 0 | if (valid) { |
12076 | 0 | resultType->deepCopy(getArg(0)->getType()); |
12077 | 0 | } |
12078 | 0 | return valid; |
12079 | | |
12080 | 0 | case EOpSubgroupPartition: |
12081 | 0 | resultType->deepCopy(TType(EbtUint, EvqTemporary, 4)); |
12082 | 0 | return valid; |
12083 | 0 | case EOpSubgroupAllEqual: |
12084 | 0 | resultType->deepCopy(TType(EbtBool)); |
12085 | 0 | return valid; |
12086 | | |
12087 | 0 | case EOpSubgroupAnd: |
12088 | 0 | case EOpSubgroupOr: |
12089 | 0 | case EOpSubgroupXor: |
12090 | 0 | case EOpSubgroupInclusiveAnd: |
12091 | 0 | case EOpSubgroupInclusiveOr: |
12092 | 0 | case EOpSubgroupInclusiveXor: |
12093 | 0 | case EOpSubgroupExclusiveAnd: |
12094 | 0 | case EOpSubgroupExclusiveOr: |
12095 | 0 | case EOpSubgroupExclusiveXor: |
12096 | 0 | case EOpSubgroupClusteredAnd: |
12097 | 0 | case EOpSubgroupClusteredOr: |
12098 | 0 | case EOpSubgroupClusteredXor: |
12099 | 0 | case EOpSubgroupPartitionedAnd: |
12100 | 0 | case EOpSubgroupPartitionedOr: |
12101 | 0 | case EOpSubgroupPartitionedXor: |
12102 | 0 | case EOpSubgroupPartitionedInclusiveAnd: |
12103 | 0 | case EOpSubgroupPartitionedInclusiveOr: |
12104 | 0 | case EOpSubgroupPartitionedInclusiveXor: |
12105 | 0 | case EOpSubgroupPartitionedExclusiveAnd: |
12106 | 0 | case EOpSubgroupPartitionedExclusiveOr: |
12107 | 0 | case EOpSubgroupPartitionedExclusiveXor: |
12108 | 0 | checkFnTypes(getArg(0), TypeIU | TypeB); |
12109 | 0 | if (valid) { |
12110 | 0 | resultType->deepCopy(getArg(0)->getType()); |
12111 | 0 | } |
12112 | 0 | return valid; |
12113 | 0 | case EOpSubgroupBroadcast: |
12114 | 0 | case EOpSubgroupBroadcastFirst: |
12115 | 0 | case EOpSubgroupShuffle: |
12116 | 0 | case EOpSubgroupShuffleXor: |
12117 | 0 | case EOpSubgroupShuffleUp: |
12118 | 0 | case EOpSubgroupShuffleDown: |
12119 | 0 | case EOpSubgroupRotate: |
12120 | 0 | case EOpSubgroupClusteredRotate: |
12121 | 0 | case EOpSubgroupQuadBroadcast: |
12122 | 0 | case EOpSubgroupQuadSwapHorizontal: |
12123 | 0 | case EOpSubgroupQuadSwapVertical: |
12124 | 0 | case EOpSubgroupQuadSwapDiagonal: |
12125 | 0 | checkFnTypes(getArg(0), TypeIU | TypeB | TypeF); |
12126 | 0 | if (valid) { |
12127 | 0 | resultType->deepCopy(getArg(0)->getType()); |
12128 | 0 | } |
12129 | 0 | return valid; |
12130 | 0 | case EOpSubgroupAdd: |
12131 | 0 | case EOpSubgroupMul: |
12132 | 0 | case EOpSubgroupMin: |
12133 | 0 | case EOpSubgroupMax: |
12134 | 0 | case EOpSubgroupInclusiveAdd: |
12135 | 0 | case EOpSubgroupInclusiveMul: |
12136 | 0 | case EOpSubgroupInclusiveMin: |
12137 | 0 | case EOpSubgroupInclusiveMax: |
12138 | 0 | case EOpSubgroupExclusiveAdd: |
12139 | 0 | case EOpSubgroupExclusiveMul: |
12140 | 0 | case EOpSubgroupExclusiveMin: |
12141 | 0 | case EOpSubgroupExclusiveMax: |
12142 | 0 | case EOpSubgroupClusteredAdd: |
12143 | 0 | case EOpSubgroupClusteredMul: |
12144 | 0 | case EOpSubgroupClusteredMin: |
12145 | 0 | case EOpSubgroupClusteredMax: |
12146 | 0 | case EOpSubgroupPartitionedAdd: |
12147 | 0 | case EOpSubgroupPartitionedMul: |
12148 | 0 | case EOpSubgroupPartitionedMin: |
12149 | 0 | case EOpSubgroupPartitionedMax: |
12150 | 0 | case EOpSubgroupPartitionedInclusiveAdd: |
12151 | 0 | case EOpSubgroupPartitionedInclusiveMul: |
12152 | 0 | case EOpSubgroupPartitionedInclusiveMin: |
12153 | 0 | case EOpSubgroupPartitionedInclusiveMax: |
12154 | 0 | case EOpSubgroupPartitionedExclusiveAdd: |
12155 | 0 | case EOpSubgroupPartitionedExclusiveMul: |
12156 | 0 | case EOpSubgroupPartitionedExclusiveMin: |
12157 | 0 | case EOpSubgroupPartitionedExclusiveMax: |
12158 | 0 | checkFnTypes(getArg(0), TypeIU | TypeF); |
12159 | 0 | if (valid) { |
12160 | 0 | resultType->deepCopy(getArg(0)->getType()); |
12161 | 0 | } |
12162 | 0 | return valid; |
12163 | 0 | default: |
12164 | 0 | break; |
12165 | 0 | } |
12166 | 0 | return false; |
12167 | 0 | } |
12168 | | |
12169 | | } // end namespace glslang |