Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2016 Google, Inc. |
| 3 | // |
| 4 | // All rights reserved. |
| 5 | // |
| 6 | // Redistribution and use in source and binary forms, with or without |
| 7 | // modification, are permitted provided that the following conditions |
| 8 | // are met: |
| 9 | // |
| 10 | // Redistributions of source code must retain the above copyright |
| 11 | // notice, this list of conditions and the following disclaimer. |
| 12 | // |
| 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. |
| 17 | // |
| 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. |
| 21 | // |
| 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. |
| 34 | |
David Neto | 2ed1d9b | 2016-05-20 16:05:21 -0400 | [diff] [blame] | 35 | #include <cstdlib> |
| 36 | #include <cstring> |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 37 | #include <sstream> |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 38 | #include <cctype> |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 39 | |
Lei Zhang | 8a9b1ee | 2016-05-19 13:31:43 -0400 | [diff] [blame] | 40 | #include "ResourceLimits.h" |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 41 | |
| 42 | namespace glslang { |
| 43 | |
| 44 | const TBuiltInResource DefaultTBuiltInResource = { |
| 45 | /* .MaxLights = */ 32, |
| 46 | /* .MaxClipPlanes = */ 6, |
| 47 | /* .MaxTextureUnits = */ 32, |
| 48 | /* .MaxTextureCoords = */ 32, |
| 49 | /* .MaxVertexAttribs = */ 64, |
| 50 | /* .MaxVertexUniformComponents = */ 4096, |
| 51 | /* .MaxVaryingFloats = */ 64, |
| 52 | /* .MaxVertexTextureImageUnits = */ 32, |
| 53 | /* .MaxCombinedTextureImageUnits = */ 80, |
| 54 | /* .MaxTextureImageUnits = */ 32, |
| 55 | /* .MaxFragmentUniformComponents = */ 4096, |
| 56 | /* .MaxDrawBuffers = */ 32, |
| 57 | /* .MaxVertexUniformVectors = */ 128, |
| 58 | /* .MaxVaryingVectors = */ 8, |
| 59 | /* .MaxFragmentUniformVectors = */ 16, |
| 60 | /* .MaxVertexOutputVectors = */ 16, |
| 61 | /* .MaxFragmentInputVectors = */ 15, |
| 62 | /* .MinProgramTexelOffset = */ -8, |
| 63 | /* .MaxProgramTexelOffset = */ 7, |
| 64 | /* .MaxClipDistances = */ 8, |
| 65 | /* .MaxComputeWorkGroupCountX = */ 65535, |
| 66 | /* .MaxComputeWorkGroupCountY = */ 65535, |
| 67 | /* .MaxComputeWorkGroupCountZ = */ 65535, |
| 68 | /* .MaxComputeWorkGroupSizeX = */ 1024, |
| 69 | /* .MaxComputeWorkGroupSizeY = */ 1024, |
| 70 | /* .MaxComputeWorkGroupSizeZ = */ 64, |
| 71 | /* .MaxComputeUniformComponents = */ 1024, |
| 72 | /* .MaxComputeTextureImageUnits = */ 16, |
| 73 | /* .MaxComputeImageUniforms = */ 8, |
| 74 | /* .MaxComputeAtomicCounters = */ 8, |
| 75 | /* .MaxComputeAtomicCounterBuffers = */ 1, |
| 76 | /* .MaxVaryingComponents = */ 60, |
| 77 | /* .MaxVertexOutputComponents = */ 64, |
| 78 | /* .MaxGeometryInputComponents = */ 64, |
| 79 | /* .MaxGeometryOutputComponents = */ 128, |
| 80 | /* .MaxFragmentInputComponents = */ 128, |
| 81 | /* .MaxImageUnits = */ 8, |
| 82 | /* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8, |
| 83 | /* .MaxCombinedShaderOutputResources = */ 8, |
| 84 | /* .MaxImageSamples = */ 0, |
| 85 | /* .MaxVertexImageUniforms = */ 0, |
| 86 | /* .MaxTessControlImageUniforms = */ 0, |
| 87 | /* .MaxTessEvaluationImageUniforms = */ 0, |
| 88 | /* .MaxGeometryImageUniforms = */ 0, |
| 89 | /* .MaxFragmentImageUniforms = */ 8, |
| 90 | /* .MaxCombinedImageUniforms = */ 8, |
| 91 | /* .MaxGeometryTextureImageUnits = */ 16, |
| 92 | /* .MaxGeometryOutputVertices = */ 256, |
| 93 | /* .MaxGeometryTotalOutputComponents = */ 1024, |
| 94 | /* .MaxGeometryUniformComponents = */ 1024, |
| 95 | /* .MaxGeometryVaryingComponents = */ 64, |
| 96 | /* .MaxTessControlInputComponents = */ 128, |
| 97 | /* .MaxTessControlOutputComponents = */ 128, |
| 98 | /* .MaxTessControlTextureImageUnits = */ 16, |
| 99 | /* .MaxTessControlUniformComponents = */ 1024, |
| 100 | /* .MaxTessControlTotalOutputComponents = */ 4096, |
| 101 | /* .MaxTessEvaluationInputComponents = */ 128, |
| 102 | /* .MaxTessEvaluationOutputComponents = */ 128, |
| 103 | /* .MaxTessEvaluationTextureImageUnits = */ 16, |
| 104 | /* .MaxTessEvaluationUniformComponents = */ 1024, |
| 105 | /* .MaxTessPatchComponents = */ 120, |
| 106 | /* .MaxPatchVertices = */ 32, |
| 107 | /* .MaxTessGenLevel = */ 64, |
| 108 | /* .MaxViewports = */ 16, |
| 109 | /* .MaxVertexAtomicCounters = */ 0, |
| 110 | /* .MaxTessControlAtomicCounters = */ 0, |
| 111 | /* .MaxTessEvaluationAtomicCounters = */ 0, |
| 112 | /* .MaxGeometryAtomicCounters = */ 0, |
| 113 | /* .MaxFragmentAtomicCounters = */ 8, |
| 114 | /* .MaxCombinedAtomicCounters = */ 8, |
| 115 | /* .MaxAtomicCounterBindings = */ 1, |
| 116 | /* .MaxVertexAtomicCounterBuffers = */ 0, |
| 117 | /* .MaxTessControlAtomicCounterBuffers = */ 0, |
| 118 | /* .MaxTessEvaluationAtomicCounterBuffers = */ 0, |
| 119 | /* .MaxGeometryAtomicCounterBuffers = */ 0, |
| 120 | /* .MaxFragmentAtomicCounterBuffers = */ 1, |
| 121 | /* .MaxCombinedAtomicCounterBuffers = */ 1, |
| 122 | /* .MaxAtomicCounterBufferSize = */ 16384, |
| 123 | /* .MaxTransformFeedbackBuffers = */ 4, |
| 124 | /* .MaxTransformFeedbackInterleavedComponents = */ 64, |
| 125 | /* .MaxCullDistances = */ 8, |
| 126 | /* .MaxCombinedClipAndCullDistances = */ 8, |
| 127 | /* .MaxSamples = */ 4, |
Chao Chen | 3c36699 | 2018-09-19 11:41:59 -0700 | [diff] [blame] | 128 | /* .maxMeshOutputVerticesNV = */ 256, |
| 129 | /* .maxMeshOutputPrimitivesNV = */ 512, |
| 130 | /* .maxMeshWorkGroupSizeX_NV = */ 32, |
| 131 | /* .maxMeshWorkGroupSizeY_NV = */ 1, |
| 132 | /* .maxMeshWorkGroupSizeZ_NV = */ 1, |
| 133 | /* .maxTaskWorkGroupSizeX_NV = */ 32, |
| 134 | /* .maxTaskWorkGroupSizeY_NV = */ 1, |
| 135 | /* .maxTaskWorkGroupSizeZ_NV = */ 1, |
| 136 | /* .maxMeshViewCountNV = */ 4, |
Pankaj Mistry | e05cc20 | 2020-04-21 11:33:57 -0700 | [diff] [blame] | 137 | /* .maxDualSourceDrawBuffersEXT = */ 1, |
Chao Chen | 3c36699 | 2018-09-19 11:41:59 -0700 | [diff] [blame] | 138 | |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 139 | /* .limits = */ { |
| 140 | /* .nonInductiveForLoops = */ 1, |
| 141 | /* .whileLoops = */ 1, |
| 142 | /* .doWhileLoops = */ 1, |
| 143 | /* .generalUniformIndexing = */ 1, |
| 144 | /* .generalAttributeMatrixVectorIndexing = */ 1, |
| 145 | /* .generalVaryingIndexing = */ 1, |
| 146 | /* .generalSamplerIndexing = */ 1, |
| 147 | /* .generalVariableIndexing = */ 1, |
| 148 | /* .generalConstantMatrixVectorIndexing = */ 1, |
| 149 | }}; |
| 150 | |
| 151 | std::string GetDefaultTBuiltInResourceString() |
| 152 | { |
| 153 | std::ostringstream ostream; |
| 154 | |
| 155 | ostream << "MaxLights " << DefaultTBuiltInResource.maxLights << "\n" |
| 156 | << "MaxClipPlanes " << DefaultTBuiltInResource.maxClipPlanes << "\n" |
| 157 | << "MaxTextureUnits " << DefaultTBuiltInResource.maxTextureUnits << "\n" |
| 158 | << "MaxTextureCoords " << DefaultTBuiltInResource.maxTextureCoords << "\n" |
| 159 | << "MaxVertexAttribs " << DefaultTBuiltInResource.maxVertexAttribs << "\n" |
| 160 | << "MaxVertexUniformComponents " << DefaultTBuiltInResource.maxVertexUniformComponents << "\n" |
| 161 | << "MaxVaryingFloats " << DefaultTBuiltInResource.maxVaryingFloats << "\n" |
| 162 | << "MaxVertexTextureImageUnits " << DefaultTBuiltInResource.maxVertexTextureImageUnits << "\n" |
| 163 | << "MaxCombinedTextureImageUnits " << DefaultTBuiltInResource.maxCombinedTextureImageUnits << "\n" |
| 164 | << "MaxTextureImageUnits " << DefaultTBuiltInResource.maxTextureImageUnits << "\n" |
| 165 | << "MaxFragmentUniformComponents " << DefaultTBuiltInResource.maxFragmentUniformComponents << "\n" |
| 166 | << "MaxDrawBuffers " << DefaultTBuiltInResource.maxDrawBuffers << "\n" |
| 167 | << "MaxVertexUniformVectors " << DefaultTBuiltInResource.maxVertexUniformVectors << "\n" |
| 168 | << "MaxVaryingVectors " << DefaultTBuiltInResource.maxVaryingVectors << "\n" |
| 169 | << "MaxFragmentUniformVectors " << DefaultTBuiltInResource.maxFragmentUniformVectors << "\n" |
| 170 | << "MaxVertexOutputVectors " << DefaultTBuiltInResource.maxVertexOutputVectors << "\n" |
| 171 | << "MaxFragmentInputVectors " << DefaultTBuiltInResource.maxFragmentInputVectors << "\n" |
| 172 | << "MinProgramTexelOffset " << DefaultTBuiltInResource.minProgramTexelOffset << "\n" |
| 173 | << "MaxProgramTexelOffset " << DefaultTBuiltInResource.maxProgramTexelOffset << "\n" |
| 174 | << "MaxClipDistances " << DefaultTBuiltInResource.maxClipDistances << "\n" |
| 175 | << "MaxComputeWorkGroupCountX " << DefaultTBuiltInResource.maxComputeWorkGroupCountX << "\n" |
| 176 | << "MaxComputeWorkGroupCountY " << DefaultTBuiltInResource.maxComputeWorkGroupCountY << "\n" |
| 177 | << "MaxComputeWorkGroupCountZ " << DefaultTBuiltInResource.maxComputeWorkGroupCountZ << "\n" |
| 178 | << "MaxComputeWorkGroupSizeX " << DefaultTBuiltInResource.maxComputeWorkGroupSizeX << "\n" |
| 179 | << "MaxComputeWorkGroupSizeY " << DefaultTBuiltInResource.maxComputeWorkGroupSizeY << "\n" |
| 180 | << "MaxComputeWorkGroupSizeZ " << DefaultTBuiltInResource.maxComputeWorkGroupSizeZ << "\n" |
| 181 | << "MaxComputeUniformComponents " << DefaultTBuiltInResource.maxComputeUniformComponents << "\n" |
| 182 | << "MaxComputeTextureImageUnits " << DefaultTBuiltInResource.maxComputeTextureImageUnits << "\n" |
| 183 | << "MaxComputeImageUniforms " << DefaultTBuiltInResource.maxComputeImageUniforms << "\n" |
| 184 | << "MaxComputeAtomicCounters " << DefaultTBuiltInResource.maxComputeAtomicCounters << "\n" |
| 185 | << "MaxComputeAtomicCounterBuffers " << DefaultTBuiltInResource.maxComputeAtomicCounterBuffers << "\n" |
| 186 | << "MaxVaryingComponents " << DefaultTBuiltInResource.maxVaryingComponents << "\n" |
| 187 | << "MaxVertexOutputComponents " << DefaultTBuiltInResource.maxVertexOutputComponents << "\n" |
| 188 | << "MaxGeometryInputComponents " << DefaultTBuiltInResource.maxGeometryInputComponents << "\n" |
| 189 | << "MaxGeometryOutputComponents " << DefaultTBuiltInResource.maxGeometryOutputComponents << "\n" |
| 190 | << "MaxFragmentInputComponents " << DefaultTBuiltInResource.maxFragmentInputComponents << "\n" |
| 191 | << "MaxImageUnits " << DefaultTBuiltInResource.maxImageUnits << "\n" |
| 192 | << "MaxCombinedImageUnitsAndFragmentOutputs " << DefaultTBuiltInResource.maxCombinedImageUnitsAndFragmentOutputs << "\n" |
| 193 | << "MaxCombinedShaderOutputResources " << DefaultTBuiltInResource.maxCombinedShaderOutputResources << "\n" |
| 194 | << "MaxImageSamples " << DefaultTBuiltInResource.maxImageSamples << "\n" |
| 195 | << "MaxVertexImageUniforms " << DefaultTBuiltInResource.maxVertexImageUniforms << "\n" |
| 196 | << "MaxTessControlImageUniforms " << DefaultTBuiltInResource.maxTessControlImageUniforms << "\n" |
| 197 | << "MaxTessEvaluationImageUniforms " << DefaultTBuiltInResource.maxTessEvaluationImageUniforms << "\n" |
| 198 | << "MaxGeometryImageUniforms " << DefaultTBuiltInResource.maxGeometryImageUniforms << "\n" |
| 199 | << "MaxFragmentImageUniforms " << DefaultTBuiltInResource.maxFragmentImageUniforms << "\n" |
| 200 | << "MaxCombinedImageUniforms " << DefaultTBuiltInResource.maxCombinedImageUniforms << "\n" |
| 201 | << "MaxGeometryTextureImageUnits " << DefaultTBuiltInResource.maxGeometryTextureImageUnits << "\n" |
| 202 | << "MaxGeometryOutputVertices " << DefaultTBuiltInResource.maxGeometryOutputVertices << "\n" |
| 203 | << "MaxGeometryTotalOutputComponents " << DefaultTBuiltInResource.maxGeometryTotalOutputComponents << "\n" |
| 204 | << "MaxGeometryUniformComponents " << DefaultTBuiltInResource.maxGeometryUniformComponents << "\n" |
| 205 | << "MaxGeometryVaryingComponents " << DefaultTBuiltInResource.maxGeometryVaryingComponents << "\n" |
| 206 | << "MaxTessControlInputComponents " << DefaultTBuiltInResource.maxTessControlInputComponents << "\n" |
| 207 | << "MaxTessControlOutputComponents " << DefaultTBuiltInResource.maxTessControlOutputComponents << "\n" |
| 208 | << "MaxTessControlTextureImageUnits " << DefaultTBuiltInResource.maxTessControlTextureImageUnits << "\n" |
| 209 | << "MaxTessControlUniformComponents " << DefaultTBuiltInResource.maxTessControlUniformComponents << "\n" |
| 210 | << "MaxTessControlTotalOutputComponents " << DefaultTBuiltInResource.maxTessControlTotalOutputComponents << "\n" |
| 211 | << "MaxTessEvaluationInputComponents " << DefaultTBuiltInResource.maxTessEvaluationInputComponents << "\n" |
| 212 | << "MaxTessEvaluationOutputComponents " << DefaultTBuiltInResource.maxTessEvaluationOutputComponents << "\n" |
| 213 | << "MaxTessEvaluationTextureImageUnits " << DefaultTBuiltInResource.maxTessEvaluationTextureImageUnits << "\n" |
| 214 | << "MaxTessEvaluationUniformComponents " << DefaultTBuiltInResource.maxTessEvaluationUniformComponents << "\n" |
| 215 | << "MaxTessPatchComponents " << DefaultTBuiltInResource.maxTessPatchComponents << "\n" |
| 216 | << "MaxPatchVertices " << DefaultTBuiltInResource.maxPatchVertices << "\n" |
| 217 | << "MaxTessGenLevel " << DefaultTBuiltInResource.maxTessGenLevel << "\n" |
| 218 | << "MaxViewports " << DefaultTBuiltInResource.maxViewports << "\n" |
| 219 | << "MaxVertexAtomicCounters " << DefaultTBuiltInResource.maxVertexAtomicCounters << "\n" |
| 220 | << "MaxTessControlAtomicCounters " << DefaultTBuiltInResource.maxTessControlAtomicCounters << "\n" |
| 221 | << "MaxTessEvaluationAtomicCounters " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounters << "\n" |
| 222 | << "MaxGeometryAtomicCounters " << DefaultTBuiltInResource.maxGeometryAtomicCounters << "\n" |
| 223 | << "MaxFragmentAtomicCounters " << DefaultTBuiltInResource.maxFragmentAtomicCounters << "\n" |
| 224 | << "MaxCombinedAtomicCounters " << DefaultTBuiltInResource.maxCombinedAtomicCounters << "\n" |
| 225 | << "MaxAtomicCounterBindings " << DefaultTBuiltInResource.maxAtomicCounterBindings << "\n" |
| 226 | << "MaxVertexAtomicCounterBuffers " << DefaultTBuiltInResource.maxVertexAtomicCounterBuffers << "\n" |
| 227 | << "MaxTessControlAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessControlAtomicCounterBuffers << "\n" |
| 228 | << "MaxTessEvaluationAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounterBuffers << "\n" |
| 229 | << "MaxGeometryAtomicCounterBuffers " << DefaultTBuiltInResource.maxGeometryAtomicCounterBuffers << "\n" |
| 230 | << "MaxFragmentAtomicCounterBuffers " << DefaultTBuiltInResource.maxFragmentAtomicCounterBuffers << "\n" |
| 231 | << "MaxCombinedAtomicCounterBuffers " << DefaultTBuiltInResource.maxCombinedAtomicCounterBuffers << "\n" |
| 232 | << "MaxAtomicCounterBufferSize " << DefaultTBuiltInResource.maxAtomicCounterBufferSize << "\n" |
| 233 | << "MaxTransformFeedbackBuffers " << DefaultTBuiltInResource.maxTransformFeedbackBuffers << "\n" |
| 234 | << "MaxTransformFeedbackInterleavedComponents " << DefaultTBuiltInResource.maxTransformFeedbackInterleavedComponents << "\n" |
| 235 | << "MaxCullDistances " << DefaultTBuiltInResource.maxCullDistances << "\n" |
| 236 | << "MaxCombinedClipAndCullDistances " << DefaultTBuiltInResource.maxCombinedClipAndCullDistances << "\n" |
| 237 | << "MaxSamples " << DefaultTBuiltInResource.maxSamples << "\n" |
Chao Chen | 3c36699 | 2018-09-19 11:41:59 -0700 | [diff] [blame] | 238 | << "MaxMeshOutputVerticesNV " << DefaultTBuiltInResource.maxMeshOutputVerticesNV << "\n" |
| 239 | << "MaxMeshOutputPrimitivesNV " << DefaultTBuiltInResource.maxMeshOutputPrimitivesNV << "\n" |
| 240 | << "MaxMeshWorkGroupSizeX_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeX_NV << "\n" |
| 241 | << "MaxMeshWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeY_NV << "\n" |
| 242 | << "MaxMeshWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxMeshWorkGroupSizeZ_NV << "\n" |
| 243 | << "MaxTaskWorkGroupSizeX_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeX_NV << "\n" |
| 244 | << "MaxTaskWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeY_NV << "\n" |
| 245 | << "MaxTaskWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeZ_NV << "\n" |
| 246 | << "MaxMeshViewCountNV " << DefaultTBuiltInResource.maxMeshViewCountNV << "\n" |
Pankaj Mistry | e05cc20 | 2020-04-21 11:33:57 -0700 | [diff] [blame] | 247 | << "MaxDualSourceDrawBuffersEXT " << DefaultTBuiltInResource.maxDualSourceDrawBuffersEXT << "\n" |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 248 | << "nonInductiveForLoops " << DefaultTBuiltInResource.limits.nonInductiveForLoops << "\n" |
| 249 | << "whileLoops " << DefaultTBuiltInResource.limits.whileLoops << "\n" |
| 250 | << "doWhileLoops " << DefaultTBuiltInResource.limits.doWhileLoops << "\n" |
| 251 | << "generalUniformIndexing " << DefaultTBuiltInResource.limits.generalUniformIndexing << "\n" |
| 252 | << "generalAttributeMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalAttributeMatrixVectorIndexing << "\n" |
| 253 | << "generalVaryingIndexing " << DefaultTBuiltInResource.limits.generalVaryingIndexing << "\n" |
| 254 | << "generalSamplerIndexing " << DefaultTBuiltInResource.limits.generalSamplerIndexing << "\n" |
| 255 | << "generalVariableIndexing " << DefaultTBuiltInResource.limits.generalVariableIndexing << "\n" |
| 256 | << "generalConstantMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalConstantMatrixVectorIndexing << "\n" |
| 257 | ; |
| 258 | |
| 259 | return ostream.str(); |
| 260 | } |
| 261 | |
John Kessenich | 7f349c7 | 2016-07-08 22:09:10 -0600 | [diff] [blame] | 262 | void DecodeResourceLimits(TBuiltInResource* resources, char* config) |
| 263 | { |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 264 | static const char* delims = " \t\n\r"; |
| 265 | |
| 266 | size_t pos = 0; |
| 267 | std::string configStr(config); |
| 268 | |
| 269 | while ((pos = configStr.find_first_not_of(delims, pos)) != std::string::npos) { |
| 270 | const size_t token_s = pos; |
| 271 | const size_t token_e = configStr.find_first_of(delims, token_s); |
| 272 | const size_t value_s = configStr.find_first_not_of(delims, token_e); |
| 273 | const size_t value_e = configStr.find_first_of(delims, value_s); |
| 274 | pos = value_e; |
| 275 | |
| 276 | // Faster to use compare(), but prefering readability. |
| 277 | const std::string tokenStr = configStr.substr(token_s, token_e-token_s); |
| 278 | const std::string valueStr = configStr.substr(value_s, value_e-value_s); |
| 279 | |
| 280 | if (value_s == std::string::npos || ! (valueStr[0] == '-' || isdigit(valueStr[0]))) { |
| 281 | printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n", |
| 282 | valueStr.c_str()); |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 283 | return; |
| 284 | } |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 285 | |
David Neto | e301f67 | 2016-10-31 17:02:45 -0400 | [diff] [blame] | 286 | const int value = std::atoi(valueStr.c_str()); |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 287 | |
| 288 | if (tokenStr == "MaxLights") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 289 | resources->maxLights = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 290 | else if (tokenStr == "MaxClipPlanes") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 291 | resources->maxClipPlanes = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 292 | else if (tokenStr == "MaxTextureUnits") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 293 | resources->maxTextureUnits = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 294 | else if (tokenStr == "MaxTextureCoords") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 295 | resources->maxTextureCoords = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 296 | else if (tokenStr == "MaxVertexAttribs") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 297 | resources->maxVertexAttribs = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 298 | else if (tokenStr == "MaxVertexUniformComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 299 | resources->maxVertexUniformComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 300 | else if (tokenStr == "MaxVaryingFloats") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 301 | resources->maxVaryingFloats = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 302 | else if (tokenStr == "MaxVertexTextureImageUnits") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 303 | resources->maxVertexTextureImageUnits = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 304 | else if (tokenStr == "MaxCombinedTextureImageUnits") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 305 | resources->maxCombinedTextureImageUnits = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 306 | else if (tokenStr == "MaxTextureImageUnits") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 307 | resources->maxTextureImageUnits = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 308 | else if (tokenStr == "MaxFragmentUniformComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 309 | resources->maxFragmentUniformComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 310 | else if (tokenStr == "MaxDrawBuffers") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 311 | resources->maxDrawBuffers = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 312 | else if (tokenStr == "MaxVertexUniformVectors") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 313 | resources->maxVertexUniformVectors = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 314 | else if (tokenStr == "MaxVaryingVectors") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 315 | resources->maxVaryingVectors = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 316 | else if (tokenStr == "MaxFragmentUniformVectors") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 317 | resources->maxFragmentUniformVectors = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 318 | else if (tokenStr == "MaxVertexOutputVectors") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 319 | resources->maxVertexOutputVectors = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 320 | else if (tokenStr == "MaxFragmentInputVectors") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 321 | resources->maxFragmentInputVectors = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 322 | else if (tokenStr == "MinProgramTexelOffset") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 323 | resources->minProgramTexelOffset = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 324 | else if (tokenStr == "MaxProgramTexelOffset") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 325 | resources->maxProgramTexelOffset = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 326 | else if (tokenStr == "MaxClipDistances") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 327 | resources->maxClipDistances = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 328 | else if (tokenStr == "MaxComputeWorkGroupCountX") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 329 | resources->maxComputeWorkGroupCountX = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 330 | else if (tokenStr == "MaxComputeWorkGroupCountY") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 331 | resources->maxComputeWorkGroupCountY = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 332 | else if (tokenStr == "MaxComputeWorkGroupCountZ") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 333 | resources->maxComputeWorkGroupCountZ = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 334 | else if (tokenStr == "MaxComputeWorkGroupSizeX") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 335 | resources->maxComputeWorkGroupSizeX = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 336 | else if (tokenStr == "MaxComputeWorkGroupSizeY") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 337 | resources->maxComputeWorkGroupSizeY = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 338 | else if (tokenStr == "MaxComputeWorkGroupSizeZ") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 339 | resources->maxComputeWorkGroupSizeZ = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 340 | else if (tokenStr == "MaxComputeUniformComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 341 | resources->maxComputeUniformComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 342 | else if (tokenStr == "MaxComputeTextureImageUnits") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 343 | resources->maxComputeTextureImageUnits = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 344 | else if (tokenStr == "MaxComputeImageUniforms") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 345 | resources->maxComputeImageUniforms = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 346 | else if (tokenStr == "MaxComputeAtomicCounters") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 347 | resources->maxComputeAtomicCounters = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 348 | else if (tokenStr == "MaxComputeAtomicCounterBuffers") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 349 | resources->maxComputeAtomicCounterBuffers = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 350 | else if (tokenStr == "MaxVaryingComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 351 | resources->maxVaryingComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 352 | else if (tokenStr == "MaxVertexOutputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 353 | resources->maxVertexOutputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 354 | else if (tokenStr == "MaxGeometryInputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 355 | resources->maxGeometryInputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 356 | else if (tokenStr == "MaxGeometryOutputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 357 | resources->maxGeometryOutputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 358 | else if (tokenStr == "MaxFragmentInputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 359 | resources->maxFragmentInputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 360 | else if (tokenStr == "MaxImageUnits") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 361 | resources->maxImageUnits = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 362 | else if (tokenStr == "MaxCombinedImageUnitsAndFragmentOutputs") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 363 | resources->maxCombinedImageUnitsAndFragmentOutputs = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 364 | else if (tokenStr == "MaxCombinedShaderOutputResources") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 365 | resources->maxCombinedShaderOutputResources = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 366 | else if (tokenStr == "MaxImageSamples") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 367 | resources->maxImageSamples = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 368 | else if (tokenStr == "MaxVertexImageUniforms") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 369 | resources->maxVertexImageUniforms = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 370 | else if (tokenStr == "MaxTessControlImageUniforms") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 371 | resources->maxTessControlImageUniforms = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 372 | else if (tokenStr == "MaxTessEvaluationImageUniforms") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 373 | resources->maxTessEvaluationImageUniforms = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 374 | else if (tokenStr == "MaxGeometryImageUniforms") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 375 | resources->maxGeometryImageUniforms = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 376 | else if (tokenStr == "MaxFragmentImageUniforms") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 377 | resources->maxFragmentImageUniforms = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 378 | else if (tokenStr == "MaxCombinedImageUniforms") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 379 | resources->maxCombinedImageUniforms = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 380 | else if (tokenStr == "MaxGeometryTextureImageUnits") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 381 | resources->maxGeometryTextureImageUnits = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 382 | else if (tokenStr == "MaxGeometryOutputVertices") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 383 | resources->maxGeometryOutputVertices = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 384 | else if (tokenStr == "MaxGeometryTotalOutputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 385 | resources->maxGeometryTotalOutputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 386 | else if (tokenStr == "MaxGeometryUniformComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 387 | resources->maxGeometryUniformComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 388 | else if (tokenStr == "MaxGeometryVaryingComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 389 | resources->maxGeometryVaryingComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 390 | else if (tokenStr == "MaxTessControlInputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 391 | resources->maxTessControlInputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 392 | else if (tokenStr == "MaxTessControlOutputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 393 | resources->maxTessControlOutputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 394 | else if (tokenStr == "MaxTessControlTextureImageUnits") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 395 | resources->maxTessControlTextureImageUnits = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 396 | else if (tokenStr == "MaxTessControlUniformComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 397 | resources->maxTessControlUniformComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 398 | else if (tokenStr == "MaxTessControlTotalOutputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 399 | resources->maxTessControlTotalOutputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 400 | else if (tokenStr == "MaxTessEvaluationInputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 401 | resources->maxTessEvaluationInputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 402 | else if (tokenStr == "MaxTessEvaluationOutputComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 403 | resources->maxTessEvaluationOutputComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 404 | else if (tokenStr == "MaxTessEvaluationTextureImageUnits") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 405 | resources->maxTessEvaluationTextureImageUnits = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 406 | else if (tokenStr == "MaxTessEvaluationUniformComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 407 | resources->maxTessEvaluationUniformComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 408 | else if (tokenStr == "MaxTessPatchComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 409 | resources->maxTessPatchComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 410 | else if (tokenStr == "MaxPatchVertices") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 411 | resources->maxPatchVertices = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 412 | else if (tokenStr == "MaxTessGenLevel") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 413 | resources->maxTessGenLevel = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 414 | else if (tokenStr == "MaxViewports") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 415 | resources->maxViewports = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 416 | else if (tokenStr == "MaxVertexAtomicCounters") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 417 | resources->maxVertexAtomicCounters = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 418 | else if (tokenStr == "MaxTessControlAtomicCounters") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 419 | resources->maxTessControlAtomicCounters = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 420 | else if (tokenStr == "MaxTessEvaluationAtomicCounters") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 421 | resources->maxTessEvaluationAtomicCounters = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 422 | else if (tokenStr == "MaxGeometryAtomicCounters") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 423 | resources->maxGeometryAtomicCounters = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 424 | else if (tokenStr == "MaxFragmentAtomicCounters") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 425 | resources->maxFragmentAtomicCounters = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 426 | else if (tokenStr == "MaxCombinedAtomicCounters") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 427 | resources->maxCombinedAtomicCounters = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 428 | else if (tokenStr == "MaxAtomicCounterBindings") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 429 | resources->maxAtomicCounterBindings = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 430 | else if (tokenStr == "MaxVertexAtomicCounterBuffers") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 431 | resources->maxVertexAtomicCounterBuffers = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 432 | else if (tokenStr == "MaxTessControlAtomicCounterBuffers") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 433 | resources->maxTessControlAtomicCounterBuffers = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 434 | else if (tokenStr == "MaxTessEvaluationAtomicCounterBuffers") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 435 | resources->maxTessEvaluationAtomicCounterBuffers = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 436 | else if (tokenStr == "MaxGeometryAtomicCounterBuffers") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 437 | resources->maxGeometryAtomicCounterBuffers = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 438 | else if (tokenStr == "MaxFragmentAtomicCounterBuffers") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 439 | resources->maxFragmentAtomicCounterBuffers = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 440 | else if (tokenStr == "MaxCombinedAtomicCounterBuffers") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 441 | resources->maxCombinedAtomicCounterBuffers = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 442 | else if (tokenStr == "MaxAtomicCounterBufferSize") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 443 | resources->maxAtomicCounterBufferSize = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 444 | else if (tokenStr == "MaxTransformFeedbackBuffers") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 445 | resources->maxTransformFeedbackBuffers = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 446 | else if (tokenStr == "MaxTransformFeedbackInterleavedComponents") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 447 | resources->maxTransformFeedbackInterleavedComponents = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 448 | else if (tokenStr == "MaxCullDistances") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 449 | resources->maxCullDistances = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 450 | else if (tokenStr == "MaxCombinedClipAndCullDistances") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 451 | resources->maxCombinedClipAndCullDistances = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 452 | else if (tokenStr == "MaxSamples") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 453 | resources->maxSamples = value; |
Chao Chen | 3c36699 | 2018-09-19 11:41:59 -0700 | [diff] [blame] | 454 | else if (tokenStr == "MaxMeshOutputVerticesNV") |
| 455 | resources->maxMeshOutputVerticesNV = value; |
| 456 | else if (tokenStr == "MaxMeshOutputPrimitivesNV") |
| 457 | resources->maxMeshOutputPrimitivesNV = value; |
| 458 | else if (tokenStr == "MaxMeshWorkGroupSizeX_NV") |
| 459 | resources->maxMeshWorkGroupSizeX_NV = value; |
| 460 | else if (tokenStr == "MaxMeshWorkGroupSizeY_NV") |
| 461 | resources->maxMeshWorkGroupSizeY_NV = value; |
| 462 | else if (tokenStr == "MaxMeshWorkGroupSizeZ_NV") |
| 463 | resources->maxMeshWorkGroupSizeZ_NV = value; |
| 464 | else if (tokenStr == "MaxTaskWorkGroupSizeX_NV") |
| 465 | resources->maxTaskWorkGroupSizeX_NV = value; |
| 466 | else if (tokenStr == "MaxTaskWorkGroupSizeY_NV") |
| 467 | resources->maxTaskWorkGroupSizeY_NV = value; |
| 468 | else if (tokenStr == "MaxTaskWorkGroupSizeZ_NV") |
| 469 | resources->maxTaskWorkGroupSizeZ_NV = value; |
| 470 | else if (tokenStr == "MaxMeshViewCountNV") |
| 471 | resources->maxMeshViewCountNV = value; |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 472 | else if (tokenStr == "nonInductiveForLoops") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 473 | resources->limits.nonInductiveForLoops = (value != 0); |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 474 | else if (tokenStr == "whileLoops") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 475 | resources->limits.whileLoops = (value != 0); |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 476 | else if (tokenStr == "doWhileLoops") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 477 | resources->limits.doWhileLoops = (value != 0); |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 478 | else if (tokenStr == "generalUniformIndexing") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 479 | resources->limits.generalUniformIndexing = (value != 0); |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 480 | else if (tokenStr == "generalAttributeMatrixVectorIndexing") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 481 | resources->limits.generalAttributeMatrixVectorIndexing = (value != 0); |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 482 | else if (tokenStr == "generalVaryingIndexing") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 483 | resources->limits.generalVaryingIndexing = (value != 0); |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 484 | else if (tokenStr == "generalSamplerIndexing") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 485 | resources->limits.generalSamplerIndexing = (value != 0); |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 486 | else if (tokenStr == "generalVariableIndexing") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 487 | resources->limits.generalVariableIndexing = (value != 0); |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 488 | else if (tokenStr == "generalConstantMatrixVectorIndexing") |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 489 | resources->limits.generalConstantMatrixVectorIndexing = (value != 0); |
| 490 | else |
steve-lunarg | 4e3dd20 | 2016-10-20 23:56:45 -0600 | [diff] [blame] | 491 | printf("Warning: unrecognized limit (%s) in configuration file.\n", tokenStr.c_str()); |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 492 | |
Lei Zhang | 1b14172 | 2016-05-19 13:50:49 -0400 | [diff] [blame] | 493 | } |
| 494 | } |
| 495 | |
Lei Zhang | 414eb60 | 2016-03-04 16:22:34 -0500 | [diff] [blame] | 496 | } // end namespace glslang |