2 // Copyright (C) 2016 Google, Inc.
4 // All rights reserved.
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions
10 // Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
13 // Redistributions in binary form must reproduce the above
14 // copyright notice, this list of conditions and the following
15 // disclaimer in the documentation and/or other materials provided
16 // with the distribution.
18 // Neither the name of Google Inc. nor the names of its
19 // contributors may be used to endorse or promote products derived
20 // from this software without specific prior written permission.
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 // POSSIBILITY OF SUCH DAMAGE.
39 #include "ResourceLimits.h"
43 const TBuiltInResource DefaultTBuiltInResource = {
44 /* .MaxLights = */ 32,
45 /* .MaxClipPlanes = */ 6,
46 /* .MaxTextureUnits = */ 32,
47 /* .MaxTextureCoords = */ 32,
48 /* .MaxVertexAttribs = */ 64,
49 /* .MaxVertexUniformComponents = */ 4096,
50 /* .MaxVaryingFloats = */ 64,
51 /* .MaxVertexTextureImageUnits = */ 32,
52 /* .MaxCombinedTextureImageUnits = */ 80,
53 /* .MaxTextureImageUnits = */ 32,
54 /* .MaxFragmentUniformComponents = */ 4096,
55 /* .MaxDrawBuffers = */ 32,
56 /* .MaxVertexUniformVectors = */ 128,
57 /* .MaxVaryingVectors = */ 8,
58 /* .MaxFragmentUniformVectors = */ 16,
59 /* .MaxVertexOutputVectors = */ 16,
60 /* .MaxFragmentInputVectors = */ 15,
61 /* .MinProgramTexelOffset = */ -8,
62 /* .MaxProgramTexelOffset = */ 7,
63 /* .MaxClipDistances = */ 8,
64 /* .MaxComputeWorkGroupCountX = */ 65535,
65 /* .MaxComputeWorkGroupCountY = */ 65535,
66 /* .MaxComputeWorkGroupCountZ = */ 65535,
67 /* .MaxComputeWorkGroupSizeX = */ 1024,
68 /* .MaxComputeWorkGroupSizeY = */ 1024,
69 /* .MaxComputeWorkGroupSizeZ = */ 64,
70 /* .MaxComputeUniformComponents = */ 1024,
71 /* .MaxComputeTextureImageUnits = */ 16,
72 /* .MaxComputeImageUniforms = */ 8,
73 /* .MaxComputeAtomicCounters = */ 8,
74 /* .MaxComputeAtomicCounterBuffers = */ 1,
75 /* .MaxVaryingComponents = */ 60,
76 /* .MaxVertexOutputComponents = */ 64,
77 /* .MaxGeometryInputComponents = */ 64,
78 /* .MaxGeometryOutputComponents = */ 128,
79 /* .MaxFragmentInputComponents = */ 128,
80 /* .MaxImageUnits = */ 8,
81 /* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8,
82 /* .MaxCombinedShaderOutputResources = */ 8,
83 /* .MaxImageSamples = */ 0,
84 /* .MaxVertexImageUniforms = */ 0,
85 /* .MaxTessControlImageUniforms = */ 0,
86 /* .MaxTessEvaluationImageUniforms = */ 0,
87 /* .MaxGeometryImageUniforms = */ 0,
88 /* .MaxFragmentImageUniforms = */ 8,
89 /* .MaxCombinedImageUniforms = */ 8,
90 /* .MaxGeometryTextureImageUnits = */ 16,
91 /* .MaxGeometryOutputVertices = */ 256,
92 /* .MaxGeometryTotalOutputComponents = */ 1024,
93 /* .MaxGeometryUniformComponents = */ 1024,
94 /* .MaxGeometryVaryingComponents = */ 64,
95 /* .MaxTessControlInputComponents = */ 128,
96 /* .MaxTessControlOutputComponents = */ 128,
97 /* .MaxTessControlTextureImageUnits = */ 16,
98 /* .MaxTessControlUniformComponents = */ 1024,
99 /* .MaxTessControlTotalOutputComponents = */ 4096,
100 /* .MaxTessEvaluationInputComponents = */ 128,
101 /* .MaxTessEvaluationOutputComponents = */ 128,
102 /* .MaxTessEvaluationTextureImageUnits = */ 16,
103 /* .MaxTessEvaluationUniformComponents = */ 1024,
104 /* .MaxTessPatchComponents = */ 120,
105 /* .MaxPatchVertices = */ 32,
106 /* .MaxTessGenLevel = */ 64,
107 /* .MaxViewports = */ 16,
108 /* .MaxVertexAtomicCounters = */ 0,
109 /* .MaxTessControlAtomicCounters = */ 0,
110 /* .MaxTessEvaluationAtomicCounters = */ 0,
111 /* .MaxGeometryAtomicCounters = */ 0,
112 /* .MaxFragmentAtomicCounters = */ 8,
113 /* .MaxCombinedAtomicCounters = */ 8,
114 /* .MaxAtomicCounterBindings = */ 1,
115 /* .MaxVertexAtomicCounterBuffers = */ 0,
116 /* .MaxTessControlAtomicCounterBuffers = */ 0,
117 /* .MaxTessEvaluationAtomicCounterBuffers = */ 0,
118 /* .MaxGeometryAtomicCounterBuffers = */ 0,
119 /* .MaxFragmentAtomicCounterBuffers = */ 1,
120 /* .MaxCombinedAtomicCounterBuffers = */ 1,
121 /* .MaxAtomicCounterBufferSize = */ 16384,
122 /* .MaxTransformFeedbackBuffers = */ 4,
123 /* .MaxTransformFeedbackInterleavedComponents = */ 64,
124 /* .MaxCullDistances = */ 8,
125 /* .MaxCombinedClipAndCullDistances = */ 8,
126 /* .MaxSamples = */ 4,
128 /* .nonInductiveForLoops = */ 1,
129 /* .whileLoops = */ 1,
130 /* .doWhileLoops = */ 1,
131 /* .generalUniformIndexing = */ 1,
132 /* .generalAttributeMatrixVectorIndexing = */ 1,
133 /* .generalVaryingIndexing = */ 1,
134 /* .generalSamplerIndexing = */ 1,
135 /* .generalVariableIndexing = */ 1,
136 /* .generalConstantMatrixVectorIndexing = */ 1,
139 std::string GetDefaultTBuiltInResourceString()
141 std::ostringstream ostream;
143 ostream << "MaxLights " << DefaultTBuiltInResource.maxLights << "\n"
144 << "MaxClipPlanes " << DefaultTBuiltInResource.maxClipPlanes << "\n"
145 << "MaxTextureUnits " << DefaultTBuiltInResource.maxTextureUnits << "\n"
146 << "MaxTextureCoords " << DefaultTBuiltInResource.maxTextureCoords << "\n"
147 << "MaxVertexAttribs " << DefaultTBuiltInResource.maxVertexAttribs << "\n"
148 << "MaxVertexUniformComponents " << DefaultTBuiltInResource.maxVertexUniformComponents << "\n"
149 << "MaxVaryingFloats " << DefaultTBuiltInResource.maxVaryingFloats << "\n"
150 << "MaxVertexTextureImageUnits " << DefaultTBuiltInResource.maxVertexTextureImageUnits << "\n"
151 << "MaxCombinedTextureImageUnits " << DefaultTBuiltInResource.maxCombinedTextureImageUnits << "\n"
152 << "MaxTextureImageUnits " << DefaultTBuiltInResource.maxTextureImageUnits << "\n"
153 << "MaxFragmentUniformComponents " << DefaultTBuiltInResource.maxFragmentUniformComponents << "\n"
154 << "MaxDrawBuffers " << DefaultTBuiltInResource.maxDrawBuffers << "\n"
155 << "MaxVertexUniformVectors " << DefaultTBuiltInResource.maxVertexUniformVectors << "\n"
156 << "MaxVaryingVectors " << DefaultTBuiltInResource.maxVaryingVectors << "\n"
157 << "MaxFragmentUniformVectors " << DefaultTBuiltInResource.maxFragmentUniformVectors << "\n"
158 << "MaxVertexOutputVectors " << DefaultTBuiltInResource.maxVertexOutputVectors << "\n"
159 << "MaxFragmentInputVectors " << DefaultTBuiltInResource.maxFragmentInputVectors << "\n"
160 << "MinProgramTexelOffset " << DefaultTBuiltInResource.minProgramTexelOffset << "\n"
161 << "MaxProgramTexelOffset " << DefaultTBuiltInResource.maxProgramTexelOffset << "\n"
162 << "MaxClipDistances " << DefaultTBuiltInResource.maxClipDistances << "\n"
163 << "MaxComputeWorkGroupCountX " << DefaultTBuiltInResource.maxComputeWorkGroupCountX << "\n"
164 << "MaxComputeWorkGroupCountY " << DefaultTBuiltInResource.maxComputeWorkGroupCountY << "\n"
165 << "MaxComputeWorkGroupCountZ " << DefaultTBuiltInResource.maxComputeWorkGroupCountZ << "\n"
166 << "MaxComputeWorkGroupSizeX " << DefaultTBuiltInResource.maxComputeWorkGroupSizeX << "\n"
167 << "MaxComputeWorkGroupSizeY " << DefaultTBuiltInResource.maxComputeWorkGroupSizeY << "\n"
168 << "MaxComputeWorkGroupSizeZ " << DefaultTBuiltInResource.maxComputeWorkGroupSizeZ << "\n"
169 << "MaxComputeUniformComponents " << DefaultTBuiltInResource.maxComputeUniformComponents << "\n"
170 << "MaxComputeTextureImageUnits " << DefaultTBuiltInResource.maxComputeTextureImageUnits << "\n"
171 << "MaxComputeImageUniforms " << DefaultTBuiltInResource.maxComputeImageUniforms << "\n"
172 << "MaxComputeAtomicCounters " << DefaultTBuiltInResource.maxComputeAtomicCounters << "\n"
173 << "MaxComputeAtomicCounterBuffers " << DefaultTBuiltInResource.maxComputeAtomicCounterBuffers << "\n"
174 << "MaxVaryingComponents " << DefaultTBuiltInResource.maxVaryingComponents << "\n"
175 << "MaxVertexOutputComponents " << DefaultTBuiltInResource.maxVertexOutputComponents << "\n"
176 << "MaxGeometryInputComponents " << DefaultTBuiltInResource.maxGeometryInputComponents << "\n"
177 << "MaxGeometryOutputComponents " << DefaultTBuiltInResource.maxGeometryOutputComponents << "\n"
178 << "MaxFragmentInputComponents " << DefaultTBuiltInResource.maxFragmentInputComponents << "\n"
179 << "MaxImageUnits " << DefaultTBuiltInResource.maxImageUnits << "\n"
180 << "MaxCombinedImageUnitsAndFragmentOutputs " << DefaultTBuiltInResource.maxCombinedImageUnitsAndFragmentOutputs << "\n"
181 << "MaxCombinedShaderOutputResources " << DefaultTBuiltInResource.maxCombinedShaderOutputResources << "\n"
182 << "MaxImageSamples " << DefaultTBuiltInResource.maxImageSamples << "\n"
183 << "MaxVertexImageUniforms " << DefaultTBuiltInResource.maxVertexImageUniforms << "\n"
184 << "MaxTessControlImageUniforms " << DefaultTBuiltInResource.maxTessControlImageUniforms << "\n"
185 << "MaxTessEvaluationImageUniforms " << DefaultTBuiltInResource.maxTessEvaluationImageUniforms << "\n"
186 << "MaxGeometryImageUniforms " << DefaultTBuiltInResource.maxGeometryImageUniforms << "\n"
187 << "MaxFragmentImageUniforms " << DefaultTBuiltInResource.maxFragmentImageUniforms << "\n"
188 << "MaxCombinedImageUniforms " << DefaultTBuiltInResource.maxCombinedImageUniforms << "\n"
189 << "MaxGeometryTextureImageUnits " << DefaultTBuiltInResource.maxGeometryTextureImageUnits << "\n"
190 << "MaxGeometryOutputVertices " << DefaultTBuiltInResource.maxGeometryOutputVertices << "\n"
191 << "MaxGeometryTotalOutputComponents " << DefaultTBuiltInResource.maxGeometryTotalOutputComponents << "\n"
192 << "MaxGeometryUniformComponents " << DefaultTBuiltInResource.maxGeometryUniformComponents << "\n"
193 << "MaxGeometryVaryingComponents " << DefaultTBuiltInResource.maxGeometryVaryingComponents << "\n"
194 << "MaxTessControlInputComponents " << DefaultTBuiltInResource.maxTessControlInputComponents << "\n"
195 << "MaxTessControlOutputComponents " << DefaultTBuiltInResource.maxTessControlOutputComponents << "\n"
196 << "MaxTessControlTextureImageUnits " << DefaultTBuiltInResource.maxTessControlTextureImageUnits << "\n"
197 << "MaxTessControlUniformComponents " << DefaultTBuiltInResource.maxTessControlUniformComponents << "\n"
198 << "MaxTessControlTotalOutputComponents " << DefaultTBuiltInResource.maxTessControlTotalOutputComponents << "\n"
199 << "MaxTessEvaluationInputComponents " << DefaultTBuiltInResource.maxTessEvaluationInputComponents << "\n"
200 << "MaxTessEvaluationOutputComponents " << DefaultTBuiltInResource.maxTessEvaluationOutputComponents << "\n"
201 << "MaxTessEvaluationTextureImageUnits " << DefaultTBuiltInResource.maxTessEvaluationTextureImageUnits << "\n"
202 << "MaxTessEvaluationUniformComponents " << DefaultTBuiltInResource.maxTessEvaluationUniformComponents << "\n"
203 << "MaxTessPatchComponents " << DefaultTBuiltInResource.maxTessPatchComponents << "\n"
204 << "MaxPatchVertices " << DefaultTBuiltInResource.maxPatchVertices << "\n"
205 << "MaxTessGenLevel " << DefaultTBuiltInResource.maxTessGenLevel << "\n"
206 << "MaxViewports " << DefaultTBuiltInResource.maxViewports << "\n"
207 << "MaxVertexAtomicCounters " << DefaultTBuiltInResource.maxVertexAtomicCounters << "\n"
208 << "MaxTessControlAtomicCounters " << DefaultTBuiltInResource.maxTessControlAtomicCounters << "\n"
209 << "MaxTessEvaluationAtomicCounters " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounters << "\n"
210 << "MaxGeometryAtomicCounters " << DefaultTBuiltInResource.maxGeometryAtomicCounters << "\n"
211 << "MaxFragmentAtomicCounters " << DefaultTBuiltInResource.maxFragmentAtomicCounters << "\n"
212 << "MaxCombinedAtomicCounters " << DefaultTBuiltInResource.maxCombinedAtomicCounters << "\n"
213 << "MaxAtomicCounterBindings " << DefaultTBuiltInResource.maxAtomicCounterBindings << "\n"
214 << "MaxVertexAtomicCounterBuffers " << DefaultTBuiltInResource.maxVertexAtomicCounterBuffers << "\n"
215 << "MaxTessControlAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessControlAtomicCounterBuffers << "\n"
216 << "MaxTessEvaluationAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounterBuffers << "\n"
217 << "MaxGeometryAtomicCounterBuffers " << DefaultTBuiltInResource.maxGeometryAtomicCounterBuffers << "\n"
218 << "MaxFragmentAtomicCounterBuffers " << DefaultTBuiltInResource.maxFragmentAtomicCounterBuffers << "\n"
219 << "MaxCombinedAtomicCounterBuffers " << DefaultTBuiltInResource.maxCombinedAtomicCounterBuffers << "\n"
220 << "MaxAtomicCounterBufferSize " << DefaultTBuiltInResource.maxAtomicCounterBufferSize << "\n"
221 << "MaxTransformFeedbackBuffers " << DefaultTBuiltInResource.maxTransformFeedbackBuffers << "\n"
222 << "MaxTransformFeedbackInterleavedComponents " << DefaultTBuiltInResource.maxTransformFeedbackInterleavedComponents << "\n"
223 << "MaxCullDistances " << DefaultTBuiltInResource.maxCullDistances << "\n"
224 << "MaxCombinedClipAndCullDistances " << DefaultTBuiltInResource.maxCombinedClipAndCullDistances << "\n"
225 << "MaxSamples " << DefaultTBuiltInResource.maxSamples << "\n"
227 << "nonInductiveForLoops " << DefaultTBuiltInResource.limits.nonInductiveForLoops << "\n"
228 << "whileLoops " << DefaultTBuiltInResource.limits.whileLoops << "\n"
229 << "doWhileLoops " << DefaultTBuiltInResource.limits.doWhileLoops << "\n"
230 << "generalUniformIndexing " << DefaultTBuiltInResource.limits.generalUniformIndexing << "\n"
231 << "generalAttributeMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalAttributeMatrixVectorIndexing << "\n"
232 << "generalVaryingIndexing " << DefaultTBuiltInResource.limits.generalVaryingIndexing << "\n"
233 << "generalSamplerIndexing " << DefaultTBuiltInResource.limits.generalSamplerIndexing << "\n"
234 << "generalVariableIndexing " << DefaultTBuiltInResource.limits.generalVariableIndexing << "\n"
235 << "generalConstantMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalConstantMatrixVectorIndexing << "\n"
238 return ostream.str();
241 void DecodeResourceLimits(TBuiltInResource* resources, char* config)
243 const char* delims = " \t\n\r";
244 #pragma warning(suppress: 4996)
245 const char* token = strtok(config, delims);
247 #pragma warning(suppress: 4996)
248 const char* valueStr = strtok(0, delims);
249 if (valueStr == 0 || ! (valueStr[0] == '-' || (valueStr[0] >= '0' && valueStr[0] <= '9'))) {
250 printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n", valueStr ? valueStr : "");
253 int value = atoi(valueStr);
255 if (strcmp(token, "MaxLights") == 0)
256 resources->maxLights = value;
257 else if (strcmp(token, "MaxClipPlanes") == 0)
258 resources->maxClipPlanes = value;
259 else if (strcmp(token, "MaxTextureUnits") == 0)
260 resources->maxTextureUnits = value;
261 else if (strcmp(token, "MaxTextureCoords") == 0)
262 resources->maxTextureCoords = value;
263 else if (strcmp(token, "MaxVertexAttribs") == 0)
264 resources->maxVertexAttribs = value;
265 else if (strcmp(token, "MaxVertexUniformComponents") == 0)
266 resources->maxVertexUniformComponents = value;
267 else if (strcmp(token, "MaxVaryingFloats") == 0)
268 resources->maxVaryingFloats = value;
269 else if (strcmp(token, "MaxVertexTextureImageUnits") == 0)
270 resources->maxVertexTextureImageUnits = value;
271 else if (strcmp(token, "MaxCombinedTextureImageUnits") == 0)
272 resources->maxCombinedTextureImageUnits = value;
273 else if (strcmp(token, "MaxTextureImageUnits") == 0)
274 resources->maxTextureImageUnits = value;
275 else if (strcmp(token, "MaxFragmentUniformComponents") == 0)
276 resources->maxFragmentUniformComponents = value;
277 else if (strcmp(token, "MaxDrawBuffers") == 0)
278 resources->maxDrawBuffers = value;
279 else if (strcmp(token, "MaxVertexUniformVectors") == 0)
280 resources->maxVertexUniformVectors = value;
281 else if (strcmp(token, "MaxVaryingVectors") == 0)
282 resources->maxVaryingVectors = value;
283 else if (strcmp(token, "MaxFragmentUniformVectors") == 0)
284 resources->maxFragmentUniformVectors = value;
285 else if (strcmp(token, "MaxVertexOutputVectors") == 0)
286 resources->maxVertexOutputVectors = value;
287 else if (strcmp(token, "MaxFragmentInputVectors") == 0)
288 resources->maxFragmentInputVectors = value;
289 else if (strcmp(token, "MinProgramTexelOffset") == 0)
290 resources->minProgramTexelOffset = value;
291 else if (strcmp(token, "MaxProgramTexelOffset") == 0)
292 resources->maxProgramTexelOffset = value;
293 else if (strcmp(token, "MaxClipDistances") == 0)
294 resources->maxClipDistances = value;
295 else if (strcmp(token, "MaxComputeWorkGroupCountX") == 0)
296 resources->maxComputeWorkGroupCountX = value;
297 else if (strcmp(token, "MaxComputeWorkGroupCountY") == 0)
298 resources->maxComputeWorkGroupCountY = value;
299 else if (strcmp(token, "MaxComputeWorkGroupCountZ") == 0)
300 resources->maxComputeWorkGroupCountZ = value;
301 else if (strcmp(token, "MaxComputeWorkGroupSizeX") == 0)
302 resources->maxComputeWorkGroupSizeX = value;
303 else if (strcmp(token, "MaxComputeWorkGroupSizeY") == 0)
304 resources->maxComputeWorkGroupSizeY = value;
305 else if (strcmp(token, "MaxComputeWorkGroupSizeZ") == 0)
306 resources->maxComputeWorkGroupSizeZ = value;
307 else if (strcmp(token, "MaxComputeUniformComponents") == 0)
308 resources->maxComputeUniformComponents = value;
309 else if (strcmp(token, "MaxComputeTextureImageUnits") == 0)
310 resources->maxComputeTextureImageUnits = value;
311 else if (strcmp(token, "MaxComputeImageUniforms") == 0)
312 resources->maxComputeImageUniforms = value;
313 else if (strcmp(token, "MaxComputeAtomicCounters") == 0)
314 resources->maxComputeAtomicCounters = value;
315 else if (strcmp(token, "MaxComputeAtomicCounterBuffers") == 0)
316 resources->maxComputeAtomicCounterBuffers = value;
317 else if (strcmp(token, "MaxVaryingComponents") == 0)
318 resources->maxVaryingComponents = value;
319 else if (strcmp(token, "MaxVertexOutputComponents") == 0)
320 resources->maxVertexOutputComponents = value;
321 else if (strcmp(token, "MaxGeometryInputComponents") == 0)
322 resources->maxGeometryInputComponents = value;
323 else if (strcmp(token, "MaxGeometryOutputComponents") == 0)
324 resources->maxGeometryOutputComponents = value;
325 else if (strcmp(token, "MaxFragmentInputComponents") == 0)
326 resources->maxFragmentInputComponents = value;
327 else if (strcmp(token, "MaxImageUnits") == 0)
328 resources->maxImageUnits = value;
329 else if (strcmp(token, "MaxCombinedImageUnitsAndFragmentOutputs") == 0)
330 resources->maxCombinedImageUnitsAndFragmentOutputs = value;
331 else if (strcmp(token, "MaxCombinedShaderOutputResources") == 0)
332 resources->maxCombinedShaderOutputResources = value;
333 else if (strcmp(token, "MaxImageSamples") == 0)
334 resources->maxImageSamples = value;
335 else if (strcmp(token, "MaxVertexImageUniforms") == 0)
336 resources->maxVertexImageUniforms = value;
337 else if (strcmp(token, "MaxTessControlImageUniforms") == 0)
338 resources->maxTessControlImageUniforms = value;
339 else if (strcmp(token, "MaxTessEvaluationImageUniforms") == 0)
340 resources->maxTessEvaluationImageUniforms = value;
341 else if (strcmp(token, "MaxGeometryImageUniforms") == 0)
342 resources->maxGeometryImageUniforms = value;
343 else if (strcmp(token, "MaxFragmentImageUniforms") == 0)
344 resources->maxFragmentImageUniforms = value;
345 else if (strcmp(token, "MaxCombinedImageUniforms") == 0)
346 resources->maxCombinedImageUniforms = value;
347 else if (strcmp(token, "MaxGeometryTextureImageUnits") == 0)
348 resources->maxGeometryTextureImageUnits = value;
349 else if (strcmp(token, "MaxGeometryOutputVertices") == 0)
350 resources->maxGeometryOutputVertices = value;
351 else if (strcmp(token, "MaxGeometryTotalOutputComponents") == 0)
352 resources->maxGeometryTotalOutputComponents = value;
353 else if (strcmp(token, "MaxGeometryUniformComponents") == 0)
354 resources->maxGeometryUniformComponents = value;
355 else if (strcmp(token, "MaxGeometryVaryingComponents") == 0)
356 resources->maxGeometryVaryingComponents = value;
357 else if (strcmp(token, "MaxTessControlInputComponents") == 0)
358 resources->maxTessControlInputComponents = value;
359 else if (strcmp(token, "MaxTessControlOutputComponents") == 0)
360 resources->maxTessControlOutputComponents = value;
361 else if (strcmp(token, "MaxTessControlTextureImageUnits") == 0)
362 resources->maxTessControlTextureImageUnits = value;
363 else if (strcmp(token, "MaxTessControlUniformComponents") == 0)
364 resources->maxTessControlUniformComponents = value;
365 else if (strcmp(token, "MaxTessControlTotalOutputComponents") == 0)
366 resources->maxTessControlTotalOutputComponents = value;
367 else if (strcmp(token, "MaxTessEvaluationInputComponents") == 0)
368 resources->maxTessEvaluationInputComponents = value;
369 else if (strcmp(token, "MaxTessEvaluationOutputComponents") == 0)
370 resources->maxTessEvaluationOutputComponents = value;
371 else if (strcmp(token, "MaxTessEvaluationTextureImageUnits") == 0)
372 resources->maxTessEvaluationTextureImageUnits = value;
373 else if (strcmp(token, "MaxTessEvaluationUniformComponents") == 0)
374 resources->maxTessEvaluationUniformComponents = value;
375 else if (strcmp(token, "MaxTessPatchComponents") == 0)
376 resources->maxTessPatchComponents = value;
377 else if (strcmp(token, "MaxPatchVertices") == 0)
378 resources->maxPatchVertices = value;
379 else if (strcmp(token, "MaxTessGenLevel") == 0)
380 resources->maxTessGenLevel = value;
381 else if (strcmp(token, "MaxViewports") == 0)
382 resources->maxViewports = value;
383 else if (strcmp(token, "MaxVertexAtomicCounters") == 0)
384 resources->maxVertexAtomicCounters = value;
385 else if (strcmp(token, "MaxTessControlAtomicCounters") == 0)
386 resources->maxTessControlAtomicCounters = value;
387 else if (strcmp(token, "MaxTessEvaluationAtomicCounters") == 0)
388 resources->maxTessEvaluationAtomicCounters = value;
389 else if (strcmp(token, "MaxGeometryAtomicCounters") == 0)
390 resources->maxGeometryAtomicCounters = value;
391 else if (strcmp(token, "MaxFragmentAtomicCounters") == 0)
392 resources->maxFragmentAtomicCounters = value;
393 else if (strcmp(token, "MaxCombinedAtomicCounters") == 0)
394 resources->maxCombinedAtomicCounters = value;
395 else if (strcmp(token, "MaxAtomicCounterBindings") == 0)
396 resources->maxAtomicCounterBindings = value;
397 else if (strcmp(token, "MaxVertexAtomicCounterBuffers") == 0)
398 resources->maxVertexAtomicCounterBuffers = value;
399 else if (strcmp(token, "MaxTessControlAtomicCounterBuffers") == 0)
400 resources->maxTessControlAtomicCounterBuffers = value;
401 else if (strcmp(token, "MaxTessEvaluationAtomicCounterBuffers") == 0)
402 resources->maxTessEvaluationAtomicCounterBuffers = value;
403 else if (strcmp(token, "MaxGeometryAtomicCounterBuffers") == 0)
404 resources->maxGeometryAtomicCounterBuffers = value;
405 else if (strcmp(token, "MaxFragmentAtomicCounterBuffers") == 0)
406 resources->maxFragmentAtomicCounterBuffers = value;
407 else if (strcmp(token, "MaxCombinedAtomicCounterBuffers") == 0)
408 resources->maxCombinedAtomicCounterBuffers = value;
409 else if (strcmp(token, "MaxAtomicCounterBufferSize") == 0)
410 resources->maxAtomicCounterBufferSize = value;
411 else if (strcmp(token, "MaxTransformFeedbackBuffers") == 0)
412 resources->maxTransformFeedbackBuffers = value;
413 else if (strcmp(token, "MaxTransformFeedbackInterleavedComponents") == 0)
414 resources->maxTransformFeedbackInterleavedComponents = value;
415 else if (strcmp(token, "MaxCullDistances") == 0)
416 resources->maxCullDistances = value;
417 else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0)
418 resources->maxCombinedClipAndCullDistances = value;
419 else if (strcmp(token, "MaxSamples") == 0)
420 resources->maxSamples = value;
422 else if (strcmp(token, "nonInductiveForLoops") == 0)
423 resources->limits.nonInductiveForLoops = (value != 0);
424 else if (strcmp(token, "whileLoops") == 0)
425 resources->limits.whileLoops = (value != 0);
426 else if (strcmp(token, "doWhileLoops") == 0)
427 resources->limits.doWhileLoops = (value != 0);
428 else if (strcmp(token, "generalUniformIndexing") == 0)
429 resources->limits.generalUniformIndexing = (value != 0);
430 else if (strcmp(token, "generalAttributeMatrixVectorIndexing") == 0)
431 resources->limits.generalAttributeMatrixVectorIndexing = (value != 0);
432 else if (strcmp(token, "generalVaryingIndexing") == 0)
433 resources->limits.generalVaryingIndexing = (value != 0);
434 else if (strcmp(token, "generalSamplerIndexing") == 0)
435 resources->limits.generalSamplerIndexing = (value != 0);
436 else if (strcmp(token, "generalVariableIndexing") == 0)
437 resources->limits.generalVariableIndexing = (value != 0);
438 else if (strcmp(token, "generalConstantMatrixVectorIndexing") == 0)
439 resources->limits.generalConstantMatrixVectorIndexing = (value != 0);
441 printf("Warning: unrecognized limit (%s) in configuration file.\n", token);
443 #pragma warning(suppress: 4996)
444 token = strtok(0, delims);
448 } // end namespace glslang