#include "spvCfg.hpp"
#include "GLSLangCompiler.hpp"

using namespace spirvPacker;
using namespace glslang;

#define CAST(x) static_cast<int>(x)

void GLSLangCompiler::initResources(ConfigSection &_sec) {
  _sec.addEntry("maxLights", 32l);
  _sec.addEntry("maxClipPlanes", 6l);
  _sec.addEntry("maxTextureUnits", 32l);
  _sec.addEntry("maxTextureCoords", 32l);
  _sec.addEntry("maxVertexAttribs", 64l);
  _sec.addEntry("maxVertexUniformComponents", 4096l);
  _sec.addEntry("maxVaryingFloats", 64l);
  _sec.addEntry("maxVertexTextureImageUnits", 32l);
  _sec.addEntry("maxCombinedTextureImageUnits", 80l);
  _sec.addEntry("maxTextureImageUnits", 32l);
  _sec.addEntry("maxFragmentUniformComponents", 4096l);
  _sec.addEntry("maxDrawBuffers", 32l);
  _sec.addEntry("maxVertexUniformVectors", 128l);
  _sec.addEntry("maxVaryingVectors", 8l);
  _sec.addEntry("maxFragmentUniformVectors", 16l);
  _sec.addEntry("maxVertexOutputVectors", 16l);
  _sec.addEntry("maxFragmentInputVectors", 15l);
  _sec.addEntry("minProgramTexelOffset", -8l);
  _sec.addEntry("maxProgramTexelOffset", 7l);
  _sec.addEntry("maxClipDistances", 8l);
  _sec.addEntry("maxComputeWorkGroupCountX", 65535l);
  _sec.addEntry("maxComputeWorkGroupCountY", 65535l);
  _sec.addEntry("maxComputeWorkGroupCountZ", 65535l);
  _sec.addEntry("maxComputeWorkGroupSizeX", 1024l);
  _sec.addEntry("maxComputeWorkGroupSizeY", 1024l);
  _sec.addEntry("maxComputeWorkGroupSizeZ", 64l);
  _sec.addEntry("maxComputeUniformComponents", 1024l);
  _sec.addEntry("maxComputeTextureImageUnits", 16l);
  _sec.addEntry("maxComputeImageUniforms", 8l);
  _sec.addEntry("maxComputeAtomicCounters", 8l);
  _sec.addEntry("maxComputeAtomicCounterBuffers", 1l);
  _sec.addEntry("maxVaryingComponents", 60l);
  _sec.addEntry("maxVertexOutputComponents", 64l);
  _sec.addEntry("maxGeometryInputComponents", 64l);
  _sec.addEntry("maxGeometryOutputComponents", 128l);
  _sec.addEntry("maxFragmentInputComponents", 128l);
  _sec.addEntry("maxImageUnits", 8l);
  _sec.addEntry("maxCombinedImageUnitsAndFragmentOutputs", 8l);
  _sec.addEntry("maxCombinedShaderOutputResources", 8l);
  _sec.addEntry("maxImageSamples", 0l);
  _sec.addEntry("maxVertexImageUniforms", 0l);
  _sec.addEntry("maxTessControlImageUniforms", 0l);
  _sec.addEntry("maxTessEvaluationImageUniforms", 0l);
  _sec.addEntry("maxGeometryImageUniforms", 0l);
  _sec.addEntry("maxFragmentImageUniforms", 8l);
  _sec.addEntry("maxCombinedImageUniforms", 8l);
  _sec.addEntry("maxGeometryTextureImageUnits", 16l);
  _sec.addEntry("maxGeometryOutputVertices", 256l);
  _sec.addEntry("maxGeometryTotalOutputComponents", 1024l);
  _sec.addEntry("maxGeometryUniformComponents", 1024l);
  _sec.addEntry("maxGeometryVaryingComponents", 64l);
  _sec.addEntry("maxTessControlInputComponents", 128l);
  _sec.addEntry("maxTessControlOutputComponents", 128l);
  _sec.addEntry("maxTessControlTextureImageUnits", 16l);
  _sec.addEntry("maxTessControlUniformComponents", 1024l);
  _sec.addEntry("maxTessControlTotalOutputComponents", 4096l);
  _sec.addEntry("maxTessEvaluationInputComponents", 128l);
  _sec.addEntry("maxTessEvaluationOutputComponents", 128l);
  _sec.addEntry("maxTessEvaluationTextureImageUnits", 16l);
  _sec.addEntry("maxTessEvaluationUniformComponents", 1024l);
  _sec.addEntry("maxTessPatchComponents", 120l);
  _sec.addEntry("maxPatchVertices", 32l);
  _sec.addEntry("maxTessGenLevel", 64l);
  _sec.addEntry("maxViewports", 16l);
  _sec.addEntry("maxVertexAtomicCounters", 0l);
  _sec.addEntry("maxTessControlAtomicCounters", 0l);
  _sec.addEntry("maxTessEvaluationAtomicCounters", 0l);
  _sec.addEntry("maxGeometryAtomicCounters", 0l);
  _sec.addEntry("maxFragmentAtomicCounters", 8l);
  _sec.addEntry("maxCombinedAtomicCounters", 8l);
  _sec.addEntry("maxAtomicCounterBindings", 1l);
  _sec.addEntry("maxVertexAtomicCounterBuffers", 0l);
  _sec.addEntry("maxTessControlAtomicCounterBuffers", 0l);
  _sec.addEntry("maxTessEvaluationAtomicCounterBuffers", 0l);
  _sec.addEntry("maxGeometryAtomicCounterBuffers", 0l);
  _sec.addEntry("maxFragmentAtomicCounterBuffers", 1l);
  _sec.addEntry("maxCombinedAtomicCounterBuffers", 1l);
  _sec.addEntry("maxAtomicCounterBufferSize", 16384l);
  _sec.addEntry("maxTransformFeedbackBuffers", 4l);
  _sec.addEntry("maxTransformFeedbackInterleavedComponents", 64l);
  _sec.addEntry("maxCullDistances", 8l);
  _sec.addEntry("maxCombinedClipAndCullDistances", 8l);
  _sec.addEntry("maxSamples", 4l);
  _sec.addEntry("nonInductiveForLoops", true);
  _sec.addEntry("whileLoops", true);
  _sec.addEntry("doWhileLoops", true);
  _sec.addEntry("generalUniformIndexing", true);
  _sec.addEntry("generalAttributeMatrixVectorIndexing", true);
  _sec.addEntry("generalVaryingIndexing", true);
  _sec.addEntry("generalSamplerIndexing", true);
  _sec.addEntry("generalVariableIndexing", true);
  _sec.addEntry("generalConstantMatrixVectorIndexing", true);
}

TBuiltInResource GLSLangCompiler::getResources(ConfigSection &_sec) {
  TBuiltInResource lRes;

  lRes.maxLights                                   = CAST(_sec("maxLights").valInt());
  lRes.maxClipPlanes                               = CAST(_sec("maxClipPlanes").valInt());
  lRes.maxTextureUnits                             = CAST(_sec("maxTextureUnits").valInt());
  lRes.maxTextureCoords                            = CAST(_sec("maxTextureCoords").valInt());
  lRes.maxVertexAttribs                            = CAST(_sec("maxVertexAttribs").valInt());
  lRes.maxVertexUniformComponents                  = CAST(_sec("maxVertexUniformComponents").valInt());
  lRes.maxVaryingFloats                            = CAST(_sec("maxVaryingFloats").valInt());
  lRes.maxVertexTextureImageUnits                  = CAST(_sec("maxVertexTextureImageUnits").valInt());
  lRes.maxCombinedTextureImageUnits                = CAST(_sec("maxCombinedTextureImageUnits").valInt());
  lRes.maxTextureImageUnits                        = CAST(_sec("maxTextureImageUnits").valInt());
  lRes.maxFragmentUniformComponents                = CAST(_sec("maxFragmentUniformComponents").valInt());
  lRes.maxDrawBuffers                              = CAST(_sec("maxDrawBuffers").valInt());
  lRes.maxVertexUniformVectors                     = CAST(_sec("maxVertexUniformVectors").valInt());
  lRes.maxVaryingVectors                           = CAST(_sec("maxVaryingVectors").valInt());
  lRes.maxFragmentUniformVectors                   = CAST(_sec("maxFragmentUniformVectors").valInt());
  lRes.maxVertexOutputVectors                      = CAST(_sec("maxVertexOutputVectors").valInt());
  lRes.maxFragmentInputVectors                     = CAST(_sec("maxFragmentInputVectors").valInt());
  lRes.minProgramTexelOffset                       = CAST(_sec("minProgramTexelOffset").valInt());
  lRes.maxProgramTexelOffset                       = CAST(_sec("maxProgramTexelOffset").valInt());
  lRes.maxClipDistances                            = CAST(_sec("maxClipDistances").valInt());
  lRes.maxComputeWorkGroupCountX                   = CAST(_sec("maxComputeWorkGroupCountX").valInt());
  lRes.maxComputeWorkGroupCountY                   = CAST(_sec("maxComputeWorkGroupCountY").valInt());
  lRes.maxComputeWorkGroupCountZ                   = CAST(_sec("maxComputeWorkGroupCountZ").valInt());
  lRes.maxComputeWorkGroupSizeX                    = CAST(_sec("maxComputeWorkGroupSizeX").valInt());
  lRes.maxComputeWorkGroupSizeY                    = CAST(_sec("maxComputeWorkGroupSizeY").valInt());
  lRes.maxComputeWorkGroupSizeZ                    = CAST(_sec("maxComputeWorkGroupSizeZ").valInt());
  lRes.maxComputeUniformComponents                 = CAST(_sec("maxComputeUniformComponents").valInt());
  lRes.maxComputeTextureImageUnits                 = CAST(_sec("maxComputeTextureImageUnits").valInt());
  lRes.maxComputeImageUniforms                     = CAST(_sec("maxComputeImageUniforms").valInt());
  lRes.maxComputeAtomicCounters                    = CAST(_sec("maxComputeAtomicCounters").valInt());
  lRes.maxComputeAtomicCounterBuffers              = CAST(_sec("maxComputeAtomicCounterBuffers").valInt());
  lRes.maxVaryingComponents                        = CAST(_sec("maxVaryingComponents").valInt());
  lRes.maxVertexOutputComponents                   = CAST(_sec("maxVertexOutputComponents").valInt());
  lRes.maxGeometryInputComponents                  = CAST(_sec("maxGeometryInputComponents").valInt());
  lRes.maxGeometryOutputComponents                 = CAST(_sec("maxGeometryOutputComponents").valInt());
  lRes.maxFragmentInputComponents                  = CAST(_sec("maxFragmentInputComponents").valInt());
  lRes.maxImageUnits                               = CAST(_sec("maxImageUnits").valInt());
  lRes.maxCombinedImageUnitsAndFragmentOutputs     = CAST(_sec("maxCombinedImageUnitsAndFragmentOutputs").valInt());
  lRes.maxCombinedShaderOutputResources            = CAST(_sec("maxCombinedShaderOutputResources").valInt());
  lRes.maxImageSamples                             = CAST(_sec("maxImageSamples").valInt());
  lRes.maxVertexImageUniforms                      = CAST(_sec("maxVertexImageUniforms").valInt());
  lRes.maxTessControlImageUniforms                 = CAST(_sec("maxTessControlImageUniforms").valInt());
  lRes.maxTessEvaluationImageUniforms              = CAST(_sec("maxTessEvaluationImageUniforms").valInt());
  lRes.maxGeometryImageUniforms                    = CAST(_sec("maxGeometryImageUniforms").valInt());
  lRes.maxFragmentImageUniforms                    = CAST(_sec("maxFragmentImageUniforms").valInt());
  lRes.maxCombinedImageUniforms                    = CAST(_sec("maxCombinedImageUniforms").valInt());
  lRes.maxGeometryTextureImageUnits                = CAST(_sec("maxGeometryTextureImageUnits").valInt());
  lRes.maxGeometryOutputVertices                   = CAST(_sec("maxGeometryOutputVertices").valInt());
  lRes.maxGeometryTotalOutputComponents            = CAST(_sec("maxGeometryTotalOutputComponents").valInt());
  lRes.maxGeometryUniformComponents                = CAST(_sec("maxGeometryUniformComponents").valInt());
  lRes.maxGeometryVaryingComponents                = CAST(_sec("maxGeometryVaryingComponents").valInt());
  lRes.maxTessControlInputComponents               = CAST(_sec("maxTessControlInputComponents").valInt());
  lRes.maxTessControlOutputComponents              = CAST(_sec("maxTessControlOutputComponents").valInt());
  lRes.maxTessControlTextureImageUnits             = CAST(_sec("maxTessControlTextureImageUnits").valInt());
  lRes.maxTessControlUniformComponents             = CAST(_sec("maxTessControlUniformComponents").valInt());
  lRes.maxTessControlTotalOutputComponents         = CAST(_sec("maxTessControlTotalOutputComponents").valInt());
  lRes.maxTessEvaluationInputComponents            = CAST(_sec("maxTessEvaluationInputComponents").valInt());
  lRes.maxTessEvaluationOutputComponents           = CAST(_sec("maxTessEvaluationOutputComponents").valInt());
  lRes.maxTessEvaluationTextureImageUnits          = CAST(_sec("maxTessEvaluationTextureImageUnits").valInt());
  lRes.maxTessEvaluationUniformComponents          = CAST(_sec("maxTessEvaluationUniformComponents").valInt());
  lRes.maxTessPatchComponents                      = CAST(_sec("maxTessPatchComponents").valInt());
  lRes.maxPatchVertices                            = CAST(_sec("maxPatchVertices").valInt());
  lRes.maxTessGenLevel                             = CAST(_sec("maxTessGenLevel").valInt());
  lRes.maxViewports                                = CAST(_sec("maxViewports").valInt());
  lRes.maxVertexAtomicCounters                     = CAST(_sec("maxVertexAtomicCounters").valInt());
  lRes.maxTessControlAtomicCounters                = CAST(_sec("maxTessControlAtomicCounters").valInt());
  lRes.maxTessEvaluationAtomicCounters             = CAST(_sec("maxTessEvaluationAtomicCounters").valInt());
  lRes.maxGeometryAtomicCounters                   = CAST(_sec("maxGeometryAtomicCounters").valInt());
  lRes.maxFragmentAtomicCounters                   = CAST(_sec("maxFragmentAtomicCounters").valInt());
  lRes.maxCombinedAtomicCounters                   = CAST(_sec("maxCombinedAtomicCounters").valInt());
  lRes.maxAtomicCounterBindings                    = CAST(_sec("maxAtomicCounterBindings").valInt());
  lRes.maxVertexAtomicCounterBuffers               = CAST(_sec("maxVertexAtomicCounterBuffers").valInt());
  lRes.maxTessControlAtomicCounterBuffers          = CAST(_sec("maxTessControlAtomicCounterBuffers").valInt());
  lRes.maxTessEvaluationAtomicCounterBuffers       = CAST(_sec("maxTessEvaluationAtomicCounterBuffers").valInt());
  lRes.maxGeometryAtomicCounterBuffers             = CAST(_sec("maxGeometryAtomicCounterBuffers").valInt());
  lRes.maxFragmentAtomicCounterBuffers             = CAST(_sec("maxFragmentAtomicCounterBuffers").valInt());
  lRes.maxCombinedAtomicCounterBuffers             = CAST(_sec("maxCombinedAtomicCounterBuffers").valInt());
  lRes.maxAtomicCounterBufferSize                  = CAST(_sec("maxAtomicCounterBufferSize").valInt());
  lRes.maxTransformFeedbackBuffers                 = CAST(_sec("maxTransformFeedbackBuffers").valInt());
  lRes.maxTransformFeedbackInterleavedComponents   = CAST(_sec("maxTransformFeedbackInterleavedComponents").valInt());
  lRes.maxCullDistances                            = CAST(_sec("maxCullDistances").valInt());
  lRes.maxCombinedClipAndCullDistances             = CAST(_sec("maxCombinedClipAndCullDistances").valInt());
  lRes.maxSamples                                  = CAST(_sec("maxSamples").valInt());
  lRes.limits.nonInductiveForLoops                 = _sec("nonInductiveForLoops").valBool();
  lRes.limits.whileLoops                           = _sec("whileLoops").valBool();
  lRes.limits.doWhileLoops                         = _sec("doWhileLoops").valBool();
  lRes.limits.generalUniformIndexing               = _sec("generalUniformIndexing").valBool();
  lRes.limits.generalAttributeMatrixVectorIndexing = _sec("generalAttributeMatrixVectorIndexing").valBool();
  lRes.limits.generalVaryingIndexing               = _sec("generalVaryingIndexing").valBool();
  lRes.limits.generalSamplerIndexing               = _sec("generalSamplerIndexing").valBool();
  lRes.limits.generalVariableIndexing              = _sec("generalVariableIndexing").valBool();
  lRes.limits.generalConstantMatrixVectorIndexing  = _sec("generalConstantMatrixVectorIndexing").valBool();

  return lRes;
}
/*
 * Copyright (C) 2017 Daniel Mensinger
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// This file was automatically generated by ./genResourcesFile.sh

#include "spvCfg.hpp"
#include "GLSLangCompiler.hpp"

using namespace spirvPacker;
using namespace glslang;

#define CAST(x) static_cast<int>(x)

void GLSLangCompiler::initResources(ConfigSection &_sec) {
  _sec.addEntry("maxLights", 32l);
  _sec.addEntry("maxClipPlanes", 6l);
  _sec.addEntry("maxTextureUnits", 32l);
  _sec.addEntry("maxTextureCoords", 32l);
  _sec.addEntry("maxVertexAttribs", 64l);
  _sec.addEntry("maxVertexUniformComponents", 4096l);
  _sec.addEntry("maxVaryingFloats", 64l);
  _sec.addEntry("maxVertexTextureImageUnits", 32l);
  _sec.addEntry("maxCombinedTextureImageUnits", 80l);
  _sec.addEntry("maxTextureImageUnits", 32l);
  _sec.addEntry("maxFragmentUniformComponents", 4096l);
  _sec.addEntry("maxDrawBuffers", 32l);
  _sec.addEntry("maxVertexUniformVectors", 128l);
  _sec.addEntry("maxVaryingVectors", 8l);
  _sec.addEntry("maxFragmentUniformVectors", 16l);
  _sec.addEntry("maxVertexOutputVectors", 16l);
  _sec.addEntry("maxFragmentInputVectors", 15l);
  _sec.addEntry("minProgramTexelOffset", -8l);
  _sec.addEntry("maxProgramTexelOffset", 7l);
  _sec.addEntry("maxClipDistances", 8l);
  _sec.addEntry("maxComputeWorkGroupCountX", 65535l);
  _sec.addEntry("maxComputeWorkGroupCountY", 65535l);
  _sec.addEntry("maxComputeWorkGroupCountZ", 65535l);
  _sec.addEntry("maxComputeWorkGroupSizeX", 1024l);
  _sec.addEntry("maxComputeWorkGroupSizeY", 1024l);
  _sec.addEntry("maxComputeWorkGroupSizeZ", 64l);
  _sec.addEntry("maxComputeUniformComponents", 1024l);
  _sec.addEntry("maxComputeTextureImageUnits", 16l);
  _sec.addEntry("maxComputeImageUniforms", 8l);
  _sec.addEntry("maxComputeAtomicCounters", 8l);
  _sec.addEntry("maxComputeAtomicCounterBuffers", 1l);
  _sec.addEntry("maxVaryingComponents", 60l);
  _sec.addEntry("maxVertexOutputComponents", 64l);
  _sec.addEntry("maxGeometryInputComponents", 64l);
  _sec.addEntry("maxGeometryOutputComponents", 128l);
  _sec.addEntry("maxFragmentInputComponents", 128l);
  _sec.addEntry("maxImageUnits", 8l);
  _sec.addEntry("maxCombinedImageUnitsAndFragmentOutputs", 8l);
  _sec.addEntry("maxCombinedShaderOutputResources", 8l);
  _sec.addEntry("maxImageSamples", 0l);
  _sec.addEntry("maxVertexImageUniforms", 0l);
  _sec.addEntry("maxTessControlImageUniforms", 0l);
  _sec.addEntry("maxTessEvaluationImageUniforms", 0l);
  _sec.addEntry("maxGeometryImageUniforms", 0l);
  _sec.addEntry("maxFragmentImageUniforms", 8l);
  _sec.addEntry("maxCombinedImageUniforms", 8l);
  _sec.addEntry("maxGeometryTextureImageUnits", 16l);
  _sec.addEntry("maxGeometryOutputVertices", 256l);
  _sec.addEntry("maxGeometryTotalOutputComponents", 1024l);
  _sec.addEntry("maxGeometryUniformComponents", 1024l);
  _sec.addEntry("maxGeometryVaryingComponents", 64l);
  _sec.addEntry("maxTessControlInputComponents", 128l);
  _sec.addEntry("maxTessControlOutputComponents", 128l);
  _sec.addEntry("maxTessControlTextureImageUnits", 16l);
  _sec.addEntry("maxTessControlUniformComponents", 1024l);
  _sec.addEntry("maxTessControlTotalOutputComponents", 4096l);
  _sec.addEntry("maxTessEvaluationInputComponents", 128l);
  _sec.addEntry("maxTessEvaluationOutputComponents", 128l);
  _sec.addEntry("maxTessEvaluationTextureImageUnits", 16l);
  _sec.addEntry("maxTessEvaluationUniformComponents", 1024l);
  _sec.addEntry("maxTessPatchComponents", 120l);
  _sec.addEntry("maxPatchVertices", 32l);
  _sec.addEntry("maxTessGenLevel", 64l);
  _sec.addEntry("maxViewports", 16l);
  _sec.addEntry("maxVertexAtomicCounters", 0l);
  _sec.addEntry("maxTessControlAtomicCounters", 0l);
  _sec.addEntry("maxTessEvaluationAtomicCounters", 0l);
  _sec.addEntry("maxGeometryAtomicCounters", 0l);
  _sec.addEntry("maxFragmentAtomicCounters", 8l);
  _sec.addEntry("maxCombinedAtomicCounters", 8l);
  _sec.addEntry("maxAtomicCounterBindings", 1l);
  _sec.addEntry("maxVertexAtomicCounterBuffers", 0l);
  _sec.addEntry("maxTessControlAtomicCounterBuffers", 0l);
  _sec.addEntry("maxTessEvaluationAtomicCounterBuffers", 0l);
  _sec.addEntry("maxGeometryAtomicCounterBuffers", 0l);
  _sec.addEntry("maxFragmentAtomicCounterBuffers", 1l);
  _sec.addEntry("maxCombinedAtomicCounterBuffers", 1l);
  _sec.addEntry("maxAtomicCounterBufferSize", 16384l);
  _sec.addEntry("maxTransformFeedbackBuffers", 4l);
  _sec.addEntry("maxTransformFeedbackInterleavedComponents", 64l);
  _sec.addEntry("maxCullDistances", 8l);
  _sec.addEntry("maxCombinedClipAndCullDistances", 8l);
  _sec.addEntry("maxSamples", 4l);
  _sec.addEntry("nonInductiveForLoops", true);
  _sec.addEntry("whileLoops", true);
  _sec.addEntry("doWhileLoops", true);
  _sec.addEntry("generalUniformIndexing", true);
  _sec.addEntry("generalAttributeMatrixVectorIndexing", true);
  _sec.addEntry("generalVaryingIndexing", true);
  _sec.addEntry("generalSamplerIndexing", true);
  _sec.addEntry("generalVariableIndexing", true);
  _sec.addEntry("generalConstantMatrixVectorIndexing", true);
}


TBuiltInResource GLSLangCompiler::getResources(ConfigSection &_sec) {
  TBuiltInResource lRes;

  lRes.maxLights                                   = CAST(_sec("maxLights").valInt());
  lRes.maxClipPlanes                               = CAST(_sec("maxClipPlanes").valInt());
  lRes.maxTextureUnits                             = CAST(_sec("maxTextureUnits").valInt());
  lRes.maxTextureCoords                            = CAST(_sec("maxTextureCoords").valInt());
  lRes.maxVertexAttribs                            = CAST(_sec("maxVertexAttribs").valInt());
  lRes.maxVertexUniformComponents                  = CAST(_sec("maxVertexUniformComponents").valInt());
  lRes.maxVaryingFloats                            = CAST(_sec("maxVaryingFloats").valInt());
  lRes.maxVertexTextureImageUnits                  = CAST(_sec("maxVertexTextureImageUnits").valInt());
  lRes.maxCombinedTextureImageUnits                = CAST(_sec("maxCombinedTextureImageUnits").valInt());
  lRes.maxTextureImageUnits                        = CAST(_sec("maxTextureImageUnits").valInt());
  lRes.maxFragmentUniformComponents                = CAST(_sec("maxFragmentUniformComponents").valInt());
  lRes.maxDrawBuffers                              = CAST(_sec("maxDrawBuffers").valInt());
  lRes.maxVertexUniformVectors                     = CAST(_sec("maxVertexUniformVectors").valInt());
  lRes.maxVaryingVectors                           = CAST(_sec("maxVaryingVectors").valInt());
  lRes.maxFragmentUniformVectors                   = CAST(_sec("maxFragmentUniformVectors").valInt());
  lRes.maxVertexOutputVectors                      = CAST(_sec("maxVertexOutputVectors").valInt());
  lRes.maxFragmentInputVectors                     = CAST(_sec("maxFragmentInputVectors").valInt());
  lRes.minProgramTexelOffset                       = CAST(_sec("minProgramTexelOffset").valInt());
  lRes.maxProgramTexelOffset                       = CAST(_sec("maxProgramTexelOffset").valInt());
  lRes.maxClipDistances                            = CAST(_sec("maxClipDistances").valInt());
  lRes.maxComputeWorkGroupCountX                   = CAST(_sec("maxComputeWorkGroupCountX").valInt());
  lRes.maxComputeWorkGroupCountY                   = CAST(_sec("maxComputeWorkGroupCountY").valInt());
  lRes.maxComputeWorkGroupCountZ                   = CAST(_sec("maxComputeWorkGroupCountZ").valInt());
  lRes.maxComputeWorkGroupSizeX                    = CAST(_sec("maxComputeWorkGroupSizeX").valInt());
  lRes.maxComputeWorkGroupSizeY                    = CAST(_sec("maxComputeWorkGroupSizeY").valInt());
  lRes.maxComputeWorkGroupSizeZ                    = CAST(_sec("maxComputeWorkGroupSizeZ").valInt());
  lRes.maxComputeUniformComponents                 = CAST(_sec("maxComputeUniformComponents").valInt());
  lRes.maxComputeTextureImageUnits                 = CAST(_sec("maxComputeTextureImageUnits").valInt());
  lRes.maxComputeImageUniforms                     = CAST(_sec("maxComputeImageUniforms").valInt());
  lRes.maxComputeAtomicCounters                    = CAST(_sec("maxComputeAtomicCounters").valInt());
  lRes.maxComputeAtomicCounterBuffers              = CAST(_sec("maxComputeAtomicCounterBuffers").valInt());
  lRes.maxVaryingComponents                        = CAST(_sec("maxVaryingComponents").valInt());
  lRes.maxVertexOutputComponents                   = CAST(_sec("maxVertexOutputComponents").valInt());
  lRes.maxGeometryInputComponents                  = CAST(_sec("maxGeometryInputComponents").valInt());
  lRes.maxGeometryOutputComponents                 = CAST(_sec("maxGeometryOutputComponents").valInt());
  lRes.maxFragmentInputComponents                  = CAST(_sec("maxFragmentInputComponents").valInt());
  lRes.maxImageUnits                               = CAST(_sec("maxImageUnits").valInt());
  lRes.maxCombinedImageUnitsAndFragmentOutputs     = CAST(_sec("maxCombinedImageUnitsAndFragmentOutputs").valInt());
  lRes.maxCombinedShaderOutputResources            = CAST(_sec("maxCombinedShaderOutputResources").valInt());
  lRes.maxImageSamples                             = CAST(_sec("maxImageSamples").valInt());
  lRes.maxVertexImageUniforms                      = CAST(_sec("maxVertexImageUniforms").valInt());
  lRes.maxTessControlImageUniforms                 = CAST(_sec("maxTessControlImageUniforms").valInt());
  lRes.maxTessEvaluationImageUniforms              = CAST(_sec("maxTessEvaluationImageUniforms").valInt());
  lRes.maxGeometryImageUniforms                    = CAST(_sec("maxGeometryImageUniforms").valInt());
  lRes.maxFragmentImageUniforms                    = CAST(_sec("maxFragmentImageUniforms").valInt());
  lRes.maxCombinedImageUniforms                    = CAST(_sec("maxCombinedImageUniforms").valInt());
  lRes.maxGeometryTextureImageUnits                = CAST(_sec("maxGeometryTextureImageUnits").valInt());
  lRes.maxGeometryOutputVertices                   = CAST(_sec("maxGeometryOutputVertices").valInt());
  lRes.maxGeometryTotalOutputComponents            = CAST(_sec("maxGeometryTotalOutputComponents").valInt());
  lRes.maxGeometryUniformComponents                = CAST(_sec("maxGeometryUniformComponents").valInt());
  lRes.maxGeometryVaryingComponents                = CAST(_sec("maxGeometryVaryingComponents").valInt());
  lRes.maxTessControlInputComponents               = CAST(_sec("maxTessControlInputComponents").valInt());
  lRes.maxTessControlOutputComponents              = CAST(_sec("maxTessControlOutputComponents").valInt());
  lRes.maxTessControlTextureImageUnits             = CAST(_sec("maxTessControlTextureImageUnits").valInt());
  lRes.maxTessControlUniformComponents             = CAST(_sec("maxTessControlUniformComponents").valInt());
  lRes.maxTessControlTotalOutputComponents         = CAST(_sec("maxTessControlTotalOutputComponents").valInt());
  lRes.maxTessEvaluationInputComponents            = CAST(_sec("maxTessEvaluationInputComponents").valInt());
  lRes.maxTessEvaluationOutputComponents           = CAST(_sec("maxTessEvaluationOutputComponents").valInt());
  lRes.maxTessEvaluationTextureImageUnits          = CAST(_sec("maxTessEvaluationTextureImageUnits").valInt());
  lRes.maxTessEvaluationUniformComponents          = CAST(_sec("maxTessEvaluationUniformComponents").valInt());
  lRes.maxTessPatchComponents                      = CAST(_sec("maxTessPatchComponents").valInt());
  lRes.maxPatchVertices                            = CAST(_sec("maxPatchVertices").valInt());
  lRes.maxTessGenLevel                             = CAST(_sec("maxTessGenLevel").valInt());
  lRes.maxViewports                                = CAST(_sec("maxViewports").valInt());
  lRes.maxVertexAtomicCounters                     = CAST(_sec("maxVertexAtomicCounters").valInt());
  lRes.maxTessControlAtomicCounters                = CAST(_sec("maxTessControlAtomicCounters").valInt());
  lRes.maxTessEvaluationAtomicCounters             = CAST(_sec("maxTessEvaluationAtomicCounters").valInt());
  lRes.maxGeometryAtomicCounters                   = CAST(_sec("maxGeometryAtomicCounters").valInt());
  lRes.maxFragmentAtomicCounters                   = CAST(_sec("maxFragmentAtomicCounters").valInt());
  lRes.maxCombinedAtomicCounters                   = CAST(_sec("maxCombinedAtomicCounters").valInt());
  lRes.maxAtomicCounterBindings                    = CAST(_sec("maxAtomicCounterBindings").valInt());
  lRes.maxVertexAtomicCounterBuffers               = CAST(_sec("maxVertexAtomicCounterBuffers").valInt());
  lRes.maxTessControlAtomicCounterBuffers          = CAST(_sec("maxTessControlAtomicCounterBuffers").valInt());
  lRes.maxTessEvaluationAtomicCounterBuffers       = CAST(_sec("maxTessEvaluationAtomicCounterBuffers").valInt());
  lRes.maxGeometryAtomicCounterBuffers             = CAST(_sec("maxGeometryAtomicCounterBuffers").valInt());
  lRes.maxFragmentAtomicCounterBuffers             = CAST(_sec("maxFragmentAtomicCounterBuffers").valInt());
  lRes.maxCombinedAtomicCounterBuffers             = CAST(_sec("maxCombinedAtomicCounterBuffers").valInt());
  lRes.maxAtomicCounterBufferSize                  = CAST(_sec("maxAtomicCounterBufferSize").valInt());
  lRes.maxTransformFeedbackBuffers                 = CAST(_sec("maxTransformFeedbackBuffers").valInt());
  lRes.maxTransformFeedbackInterleavedComponents   = CAST(_sec("maxTransformFeedbackInterleavedComponents").valInt());
  lRes.maxCullDistances                            = CAST(_sec("maxCullDistances").valInt());
  lRes.maxCombinedClipAndCullDistances             = CAST(_sec("maxCombinedClipAndCullDistances").valInt());
  lRes.maxSamples                                  = CAST(_sec("maxSamples").valInt());
  lRes.limits.nonInductiveForLoops                 = _sec("nonInductiveForLoops").valBool();
  lRes.limits.whileLoops                           = _sec("whileLoops").valBool();
  lRes.limits.doWhileLoops                         = _sec("doWhileLoops").valBool();
  lRes.limits.generalUniformIndexing               = _sec("generalUniformIndexing").valBool();
  lRes.limits.generalAttributeMatrixVectorIndexing = _sec("generalAttributeMatrixVectorIndexing").valBool();
  lRes.limits.generalVaryingIndexing               = _sec("generalVaryingIndexing").valBool();
  lRes.limits.generalSamplerIndexing               = _sec("generalSamplerIndexing").valBool();
  lRes.limits.generalVariableIndexing              = _sec("generalVariableIndexing").valBool();
  lRes.limits.generalConstantMatrixVectorIndexing  = _sec("generalConstantMatrixVectorIndexing").valBool();

  return lRes;
}
