mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Externals: Update glslang to upstream commit 32d3ec3
This commit is contained in:
30
Externals/glslang/StandAlone/CMakeLists.txt
vendored
Normal file → Executable file
30
Externals/glslang/StandAlone/CMakeLists.txt
vendored
Normal file → Executable file
@ -1,14 +1,13 @@
|
||||
add_library(glslang-default-resource-limits
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp
|
||||
)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp)
|
||||
set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang)
|
||||
set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
target_include_directories(glslang-default-resource-limits
|
||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PUBLIC ${PROJECT_SOURCE_DIR}
|
||||
)
|
||||
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
PUBLIC ${PROJECT_SOURCE_DIR})
|
||||
|
||||
set(SOURCES StandAlone.cpp)
|
||||
set(SOURCES StandAlone.cpp DirStackFileIncluder.h)
|
||||
set(REMAPPER_SOURCES spirv-remap.cpp)
|
||||
|
||||
add_executable(glslangValidator ${SOURCES})
|
||||
@ -20,10 +19,8 @@ glslang_set_link_args(spirv-remap)
|
||||
|
||||
set(LIBRARIES
|
||||
glslang
|
||||
OGLCompiler
|
||||
OSDependent
|
||||
HLSL
|
||||
SPIRV
|
||||
SPVRemapper
|
||||
glslang-default-resource-limits)
|
||||
|
||||
if(WIN32)
|
||||
@ -41,8 +38,15 @@ if(WIN32)
|
||||
source_group("Source" FILES ${SOURCES})
|
||||
endif(WIN32)
|
||||
|
||||
install(TARGETS glslangValidator
|
||||
RUNTIME DESTINATION bin)
|
||||
if(ENABLE_GLSLANG_INSTALL)
|
||||
install(TARGETS glslangValidator
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
install(TARGETS spirv-remap
|
||||
RUNTIME DESTINATION bin)
|
||||
install(TARGETS spirv-remap
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
|
||||
if(BUILD_SHARED_LIBS)
|
||||
install(TARGETS glslang-default-resource-limits
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
endif()
|
||||
endif(ENABLE_GLSLANG_INSTALL)
|
||||
|
141
Externals/glslang/StandAlone/DirStackFileIncluder.h
vendored
Normal file
141
Externals/glslang/StandAlone/DirStackFileIncluder.h
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
//
|
||||
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
|
||||
// Copyright (C) 2017 Google, Inc.
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// Redistributions in binary form must reproduce the above
|
||||
// copyright notice, this list of conditions and the following
|
||||
// disclaimer in the documentation and/or other materials provided
|
||||
// with the distribution.
|
||||
//
|
||||
// Neither the name of 3Dlabs Inc. Ltd. nor the names of its
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
|
||||
#include "./../glslang/Public/ShaderLang.h"
|
||||
|
||||
// Default include class for normal include convention of search backward
|
||||
// through the stack of active include paths (for nested includes).
|
||||
// Can be overridden to customize.
|
||||
class DirStackFileIncluder : public glslang::TShader::Includer {
|
||||
public:
|
||||
DirStackFileIncluder() : externalLocalDirectoryCount(0) { }
|
||||
|
||||
virtual IncludeResult* includeLocal(const char* headerName,
|
||||
const char* includerName,
|
||||
size_t inclusionDepth) override
|
||||
{
|
||||
return readLocalPath(headerName, includerName, (int)inclusionDepth);
|
||||
}
|
||||
|
||||
virtual IncludeResult* includeSystem(const char* headerName,
|
||||
const char* /*includerName*/,
|
||||
size_t /*inclusionDepth*/) override
|
||||
{
|
||||
return readSystemPath(headerName);
|
||||
}
|
||||
|
||||
// Externally set directories. E.g., from a command-line -I<dir>.
|
||||
// - Most-recently pushed are checked first.
|
||||
// - All these are checked after the parse-time stack of local directories
|
||||
// is checked.
|
||||
// - This only applies to the "local" form of #include.
|
||||
// - Makes its own copy of the path.
|
||||
virtual void pushExternalLocalDirectory(const std::string& dir)
|
||||
{
|
||||
directoryStack.push_back(dir);
|
||||
externalLocalDirectoryCount = (int)directoryStack.size();
|
||||
}
|
||||
|
||||
virtual void releaseInclude(IncludeResult* result) override
|
||||
{
|
||||
if (result != nullptr) {
|
||||
delete [] static_cast<tUserDataElement*>(result->userData);
|
||||
delete result;
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~DirStackFileIncluder() override { }
|
||||
|
||||
protected:
|
||||
typedef char tUserDataElement;
|
||||
std::vector<std::string> directoryStack;
|
||||
int externalLocalDirectoryCount;
|
||||
|
||||
// Search for a valid "local" path based on combining the stack of include
|
||||
// directories and the nominal name of the header.
|
||||
virtual IncludeResult* readLocalPath(const char* headerName, const char* includerName, int depth)
|
||||
{
|
||||
// Discard popped include directories, and
|
||||
// initialize when at parse-time first level.
|
||||
directoryStack.resize(depth + externalLocalDirectoryCount);
|
||||
if (depth == 1)
|
||||
directoryStack.back() = getDirectory(includerName);
|
||||
|
||||
// Find a directory that works, using a reverse search of the include stack.
|
||||
for (auto it = directoryStack.rbegin(); it != directoryStack.rend(); ++it) {
|
||||
std::string path = *it + '/' + headerName;
|
||||
std::replace(path.begin(), path.end(), '\\', '/');
|
||||
std::ifstream file(path, std::ios_base::binary | std::ios_base::ate);
|
||||
if (file) {
|
||||
directoryStack.push_back(getDirectory(path));
|
||||
return newIncludeResult(path, file, (int)file.tellg());
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Search for a valid <system> path.
|
||||
// Not implemented yet; returning nullptr signals failure to find.
|
||||
virtual IncludeResult* readSystemPath(const char* /*headerName*/) const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Do actual reading of the file, filling in a new include result.
|
||||
virtual IncludeResult* newIncludeResult(const std::string& path, std::ifstream& file, int length) const
|
||||
{
|
||||
char* content = new tUserDataElement [length];
|
||||
file.seekg(0, file.beg);
|
||||
file.read(content, length);
|
||||
return new IncludeResult(path, content, length, content);
|
||||
}
|
||||
|
||||
// If no path markers, return current working directory.
|
||||
// Otherwise, strip file name and return path leading up to it.
|
||||
virtual std::string getDirectory(const std::string path) const
|
||||
{
|
||||
size_t last = path.find_last_of("/\\");
|
||||
return last == std::string::npos ? "." : path.substr(0, last);
|
||||
}
|
||||
};
|
217
Externals/glslang/StandAlone/ResourceLimits.cpp
vendored
217
Externals/glslang/StandAlone/ResourceLimits.cpp
vendored
@ -35,6 +35,7 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <cctype>
|
||||
|
||||
#include "ResourceLimits.h"
|
||||
|
||||
@ -240,205 +241,217 @@ std::string GetDefaultTBuiltInResourceString()
|
||||
|
||||
void DecodeResourceLimits(TBuiltInResource* resources, char* config)
|
||||
{
|
||||
const char* delims = " \t\n\r";
|
||||
const char* token = strtok(config, delims);
|
||||
while (token) {
|
||||
const char* valueStr = strtok(0, delims);
|
||||
if (valueStr == 0 || ! (valueStr[0] == '-' || (valueStr[0] >= '0' && valueStr[0] <= '9'))) {
|
||||
printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n", valueStr ? valueStr : "");
|
||||
static const char* delims = " \t\n\r";
|
||||
|
||||
size_t pos = 0;
|
||||
std::string configStr(config);
|
||||
|
||||
while ((pos = configStr.find_first_not_of(delims, pos)) != std::string::npos) {
|
||||
const size_t token_s = pos;
|
||||
const size_t token_e = configStr.find_first_of(delims, token_s);
|
||||
const size_t value_s = configStr.find_first_not_of(delims, token_e);
|
||||
const size_t value_e = configStr.find_first_of(delims, value_s);
|
||||
pos = value_e;
|
||||
|
||||
// Faster to use compare(), but prefering readability.
|
||||
const std::string tokenStr = configStr.substr(token_s, token_e-token_s);
|
||||
const std::string valueStr = configStr.substr(value_s, value_e-value_s);
|
||||
|
||||
if (value_s == std::string::npos || ! (valueStr[0] == '-' || isdigit(valueStr[0]))) {
|
||||
printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n",
|
||||
valueStr.c_str());
|
||||
return;
|
||||
}
|
||||
int value = atoi(valueStr);
|
||||
|
||||
if (strcmp(token, "MaxLights") == 0)
|
||||
const int value = std::atoi(valueStr.c_str());
|
||||
|
||||
if (tokenStr == "MaxLights")
|
||||
resources->maxLights = value;
|
||||
else if (strcmp(token, "MaxClipPlanes") == 0)
|
||||
else if (tokenStr == "MaxClipPlanes")
|
||||
resources->maxClipPlanes = value;
|
||||
else if (strcmp(token, "MaxTextureUnits") == 0)
|
||||
else if (tokenStr == "MaxTextureUnits")
|
||||
resources->maxTextureUnits = value;
|
||||
else if (strcmp(token, "MaxTextureCoords") == 0)
|
||||
else if (tokenStr == "MaxTextureCoords")
|
||||
resources->maxTextureCoords = value;
|
||||
else if (strcmp(token, "MaxVertexAttribs") == 0)
|
||||
else if (tokenStr == "MaxVertexAttribs")
|
||||
resources->maxVertexAttribs = value;
|
||||
else if (strcmp(token, "MaxVertexUniformComponents") == 0)
|
||||
else if (tokenStr == "MaxVertexUniformComponents")
|
||||
resources->maxVertexUniformComponents = value;
|
||||
else if (strcmp(token, "MaxVaryingFloats") == 0)
|
||||
else if (tokenStr == "MaxVaryingFloats")
|
||||
resources->maxVaryingFloats = value;
|
||||
else if (strcmp(token, "MaxVertexTextureImageUnits") == 0)
|
||||
else if (tokenStr == "MaxVertexTextureImageUnits")
|
||||
resources->maxVertexTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxCombinedTextureImageUnits") == 0)
|
||||
else if (tokenStr == "MaxCombinedTextureImageUnits")
|
||||
resources->maxCombinedTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxTextureImageUnits") == 0)
|
||||
else if (tokenStr == "MaxTextureImageUnits")
|
||||
resources->maxTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxFragmentUniformComponents") == 0)
|
||||
else if (tokenStr == "MaxFragmentUniformComponents")
|
||||
resources->maxFragmentUniformComponents = value;
|
||||
else if (strcmp(token, "MaxDrawBuffers") == 0)
|
||||
else if (tokenStr == "MaxDrawBuffers")
|
||||
resources->maxDrawBuffers = value;
|
||||
else if (strcmp(token, "MaxVertexUniformVectors") == 0)
|
||||
else if (tokenStr == "MaxVertexUniformVectors")
|
||||
resources->maxVertexUniformVectors = value;
|
||||
else if (strcmp(token, "MaxVaryingVectors") == 0)
|
||||
else if (tokenStr == "MaxVaryingVectors")
|
||||
resources->maxVaryingVectors = value;
|
||||
else if (strcmp(token, "MaxFragmentUniformVectors") == 0)
|
||||
else if (tokenStr == "MaxFragmentUniformVectors")
|
||||
resources->maxFragmentUniformVectors = value;
|
||||
else if (strcmp(token, "MaxVertexOutputVectors") == 0)
|
||||
else if (tokenStr == "MaxVertexOutputVectors")
|
||||
resources->maxVertexOutputVectors = value;
|
||||
else if (strcmp(token, "MaxFragmentInputVectors") == 0)
|
||||
else if (tokenStr == "MaxFragmentInputVectors")
|
||||
resources->maxFragmentInputVectors = value;
|
||||
else if (strcmp(token, "MinProgramTexelOffset") == 0)
|
||||
else if (tokenStr == "MinProgramTexelOffset")
|
||||
resources->minProgramTexelOffset = value;
|
||||
else if (strcmp(token, "MaxProgramTexelOffset") == 0)
|
||||
else if (tokenStr == "MaxProgramTexelOffset")
|
||||
resources->maxProgramTexelOffset = value;
|
||||
else if (strcmp(token, "MaxClipDistances") == 0)
|
||||
else if (tokenStr == "MaxClipDistances")
|
||||
resources->maxClipDistances = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupCountX") == 0)
|
||||
else if (tokenStr == "MaxComputeWorkGroupCountX")
|
||||
resources->maxComputeWorkGroupCountX = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupCountY") == 0)
|
||||
else if (tokenStr == "MaxComputeWorkGroupCountY")
|
||||
resources->maxComputeWorkGroupCountY = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupCountZ") == 0)
|
||||
else if (tokenStr == "MaxComputeWorkGroupCountZ")
|
||||
resources->maxComputeWorkGroupCountZ = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupSizeX") == 0)
|
||||
else if (tokenStr == "MaxComputeWorkGroupSizeX")
|
||||
resources->maxComputeWorkGroupSizeX = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupSizeY") == 0)
|
||||
else if (tokenStr == "MaxComputeWorkGroupSizeY")
|
||||
resources->maxComputeWorkGroupSizeY = value;
|
||||
else if (strcmp(token, "MaxComputeWorkGroupSizeZ") == 0)
|
||||
else if (tokenStr == "MaxComputeWorkGroupSizeZ")
|
||||
resources->maxComputeWorkGroupSizeZ = value;
|
||||
else if (strcmp(token, "MaxComputeUniformComponents") == 0)
|
||||
else if (tokenStr == "MaxComputeUniformComponents")
|
||||
resources->maxComputeUniformComponents = value;
|
||||
else if (strcmp(token, "MaxComputeTextureImageUnits") == 0)
|
||||
else if (tokenStr == "MaxComputeTextureImageUnits")
|
||||
resources->maxComputeTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxComputeImageUniforms") == 0)
|
||||
else if (tokenStr == "MaxComputeImageUniforms")
|
||||
resources->maxComputeImageUniforms = value;
|
||||
else if (strcmp(token, "MaxComputeAtomicCounters") == 0)
|
||||
else if (tokenStr == "MaxComputeAtomicCounters")
|
||||
resources->maxComputeAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxComputeAtomicCounterBuffers") == 0)
|
||||
else if (tokenStr == "MaxComputeAtomicCounterBuffers")
|
||||
resources->maxComputeAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxVaryingComponents") == 0)
|
||||
else if (tokenStr == "MaxVaryingComponents")
|
||||
resources->maxVaryingComponents = value;
|
||||
else if (strcmp(token, "MaxVertexOutputComponents") == 0)
|
||||
else if (tokenStr == "MaxVertexOutputComponents")
|
||||
resources->maxVertexOutputComponents = value;
|
||||
else if (strcmp(token, "MaxGeometryInputComponents") == 0)
|
||||
else if (tokenStr == "MaxGeometryInputComponents")
|
||||
resources->maxGeometryInputComponents = value;
|
||||
else if (strcmp(token, "MaxGeometryOutputComponents") == 0)
|
||||
else if (tokenStr == "MaxGeometryOutputComponents")
|
||||
resources->maxGeometryOutputComponents = value;
|
||||
else if (strcmp(token, "MaxFragmentInputComponents") == 0)
|
||||
else if (tokenStr == "MaxFragmentInputComponents")
|
||||
resources->maxFragmentInputComponents = value;
|
||||
else if (strcmp(token, "MaxImageUnits") == 0)
|
||||
else if (tokenStr == "MaxImageUnits")
|
||||
resources->maxImageUnits = value;
|
||||
else if (strcmp(token, "MaxCombinedImageUnitsAndFragmentOutputs") == 0)
|
||||
else if (tokenStr == "MaxCombinedImageUnitsAndFragmentOutputs")
|
||||
resources->maxCombinedImageUnitsAndFragmentOutputs = value;
|
||||
else if (strcmp(token, "MaxCombinedShaderOutputResources") == 0)
|
||||
else if (tokenStr == "MaxCombinedShaderOutputResources")
|
||||
resources->maxCombinedShaderOutputResources = value;
|
||||
else if (strcmp(token, "MaxImageSamples") == 0)
|
||||
else if (tokenStr == "MaxImageSamples")
|
||||
resources->maxImageSamples = value;
|
||||
else if (strcmp(token, "MaxVertexImageUniforms") == 0)
|
||||
else if (tokenStr == "MaxVertexImageUniforms")
|
||||
resources->maxVertexImageUniforms = value;
|
||||
else if (strcmp(token, "MaxTessControlImageUniforms") == 0)
|
||||
else if (tokenStr == "MaxTessControlImageUniforms")
|
||||
resources->maxTessControlImageUniforms = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationImageUniforms") == 0)
|
||||
else if (tokenStr == "MaxTessEvaluationImageUniforms")
|
||||
resources->maxTessEvaluationImageUniforms = value;
|
||||
else if (strcmp(token, "MaxGeometryImageUniforms") == 0)
|
||||
else if (tokenStr == "MaxGeometryImageUniforms")
|
||||
resources->maxGeometryImageUniforms = value;
|
||||
else if (strcmp(token, "MaxFragmentImageUniforms") == 0)
|
||||
else if (tokenStr == "MaxFragmentImageUniforms")
|
||||
resources->maxFragmentImageUniforms = value;
|
||||
else if (strcmp(token, "MaxCombinedImageUniforms") == 0)
|
||||
else if (tokenStr == "MaxCombinedImageUniforms")
|
||||
resources->maxCombinedImageUniforms = value;
|
||||
else if (strcmp(token, "MaxGeometryTextureImageUnits") == 0)
|
||||
else if (tokenStr == "MaxGeometryTextureImageUnits")
|
||||
resources->maxGeometryTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxGeometryOutputVertices") == 0)
|
||||
else if (tokenStr == "MaxGeometryOutputVertices")
|
||||
resources->maxGeometryOutputVertices = value;
|
||||
else if (strcmp(token, "MaxGeometryTotalOutputComponents") == 0)
|
||||
else if (tokenStr == "MaxGeometryTotalOutputComponents")
|
||||
resources->maxGeometryTotalOutputComponents = value;
|
||||
else if (strcmp(token, "MaxGeometryUniformComponents") == 0)
|
||||
else if (tokenStr == "MaxGeometryUniformComponents")
|
||||
resources->maxGeometryUniformComponents = value;
|
||||
else if (strcmp(token, "MaxGeometryVaryingComponents") == 0)
|
||||
else if (tokenStr == "MaxGeometryVaryingComponents")
|
||||
resources->maxGeometryVaryingComponents = value;
|
||||
else if (strcmp(token, "MaxTessControlInputComponents") == 0)
|
||||
else if (tokenStr == "MaxTessControlInputComponents")
|
||||
resources->maxTessControlInputComponents = value;
|
||||
else if (strcmp(token, "MaxTessControlOutputComponents") == 0)
|
||||
else if (tokenStr == "MaxTessControlOutputComponents")
|
||||
resources->maxTessControlOutputComponents = value;
|
||||
else if (strcmp(token, "MaxTessControlTextureImageUnits") == 0)
|
||||
else if (tokenStr == "MaxTessControlTextureImageUnits")
|
||||
resources->maxTessControlTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxTessControlUniformComponents") == 0)
|
||||
else if (tokenStr == "MaxTessControlUniformComponents")
|
||||
resources->maxTessControlUniformComponents = value;
|
||||
else if (strcmp(token, "MaxTessControlTotalOutputComponents") == 0)
|
||||
else if (tokenStr == "MaxTessControlTotalOutputComponents")
|
||||
resources->maxTessControlTotalOutputComponents = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationInputComponents") == 0)
|
||||
else if (tokenStr == "MaxTessEvaluationInputComponents")
|
||||
resources->maxTessEvaluationInputComponents = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationOutputComponents") == 0)
|
||||
else if (tokenStr == "MaxTessEvaluationOutputComponents")
|
||||
resources->maxTessEvaluationOutputComponents = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationTextureImageUnits") == 0)
|
||||
else if (tokenStr == "MaxTessEvaluationTextureImageUnits")
|
||||
resources->maxTessEvaluationTextureImageUnits = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationUniformComponents") == 0)
|
||||
else if (tokenStr == "MaxTessEvaluationUniformComponents")
|
||||
resources->maxTessEvaluationUniformComponents = value;
|
||||
else if (strcmp(token, "MaxTessPatchComponents") == 0)
|
||||
else if (tokenStr == "MaxTessPatchComponents")
|
||||
resources->maxTessPatchComponents = value;
|
||||
else if (strcmp(token, "MaxPatchVertices") == 0)
|
||||
else if (tokenStr == "MaxPatchVertices")
|
||||
resources->maxPatchVertices = value;
|
||||
else if (strcmp(token, "MaxTessGenLevel") == 0)
|
||||
else if (tokenStr == "MaxTessGenLevel")
|
||||
resources->maxTessGenLevel = value;
|
||||
else if (strcmp(token, "MaxViewports") == 0)
|
||||
else if (tokenStr == "MaxViewports")
|
||||
resources->maxViewports = value;
|
||||
else if (strcmp(token, "MaxVertexAtomicCounters") == 0)
|
||||
else if (tokenStr == "MaxVertexAtomicCounters")
|
||||
resources->maxVertexAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxTessControlAtomicCounters") == 0)
|
||||
else if (tokenStr == "MaxTessControlAtomicCounters")
|
||||
resources->maxTessControlAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationAtomicCounters") == 0)
|
||||
else if (tokenStr == "MaxTessEvaluationAtomicCounters")
|
||||
resources->maxTessEvaluationAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxGeometryAtomicCounters") == 0)
|
||||
else if (tokenStr == "MaxGeometryAtomicCounters")
|
||||
resources->maxGeometryAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxFragmentAtomicCounters") == 0)
|
||||
else if (tokenStr == "MaxFragmentAtomicCounters")
|
||||
resources->maxFragmentAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxCombinedAtomicCounters") == 0)
|
||||
else if (tokenStr == "MaxCombinedAtomicCounters")
|
||||
resources->maxCombinedAtomicCounters = value;
|
||||
else if (strcmp(token, "MaxAtomicCounterBindings") == 0)
|
||||
else if (tokenStr == "MaxAtomicCounterBindings")
|
||||
resources->maxAtomicCounterBindings = value;
|
||||
else if (strcmp(token, "MaxVertexAtomicCounterBuffers") == 0)
|
||||
else if (tokenStr == "MaxVertexAtomicCounterBuffers")
|
||||
resources->maxVertexAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxTessControlAtomicCounterBuffers") == 0)
|
||||
else if (tokenStr == "MaxTessControlAtomicCounterBuffers")
|
||||
resources->maxTessControlAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxTessEvaluationAtomicCounterBuffers") == 0)
|
||||
else if (tokenStr == "MaxTessEvaluationAtomicCounterBuffers")
|
||||
resources->maxTessEvaluationAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxGeometryAtomicCounterBuffers") == 0)
|
||||
else if (tokenStr == "MaxGeometryAtomicCounterBuffers")
|
||||
resources->maxGeometryAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxFragmentAtomicCounterBuffers") == 0)
|
||||
else if (tokenStr == "MaxFragmentAtomicCounterBuffers")
|
||||
resources->maxFragmentAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxCombinedAtomicCounterBuffers") == 0)
|
||||
else if (tokenStr == "MaxCombinedAtomicCounterBuffers")
|
||||
resources->maxCombinedAtomicCounterBuffers = value;
|
||||
else if (strcmp(token, "MaxAtomicCounterBufferSize") == 0)
|
||||
else if (tokenStr == "MaxAtomicCounterBufferSize")
|
||||
resources->maxAtomicCounterBufferSize = value;
|
||||
else if (strcmp(token, "MaxTransformFeedbackBuffers") == 0)
|
||||
else if (tokenStr == "MaxTransformFeedbackBuffers")
|
||||
resources->maxTransformFeedbackBuffers = value;
|
||||
else if (strcmp(token, "MaxTransformFeedbackInterleavedComponents") == 0)
|
||||
else if (tokenStr == "MaxTransformFeedbackInterleavedComponents")
|
||||
resources->maxTransformFeedbackInterleavedComponents = value;
|
||||
else if (strcmp(token, "MaxCullDistances") == 0)
|
||||
else if (tokenStr == "MaxCullDistances")
|
||||
resources->maxCullDistances = value;
|
||||
else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0)
|
||||
else if (tokenStr == "MaxCombinedClipAndCullDistances")
|
||||
resources->maxCombinedClipAndCullDistances = value;
|
||||
else if (strcmp(token, "MaxSamples") == 0)
|
||||
else if (tokenStr == "MaxSamples")
|
||||
resources->maxSamples = value;
|
||||
|
||||
else if (strcmp(token, "nonInductiveForLoops") == 0)
|
||||
else if (tokenStr == "nonInductiveForLoops")
|
||||
resources->limits.nonInductiveForLoops = (value != 0);
|
||||
else if (strcmp(token, "whileLoops") == 0)
|
||||
else if (tokenStr == "whileLoops")
|
||||
resources->limits.whileLoops = (value != 0);
|
||||
else if (strcmp(token, "doWhileLoops") == 0)
|
||||
else if (tokenStr == "doWhileLoops")
|
||||
resources->limits.doWhileLoops = (value != 0);
|
||||
else if (strcmp(token, "generalUniformIndexing") == 0)
|
||||
else if (tokenStr == "generalUniformIndexing")
|
||||
resources->limits.generalUniformIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalAttributeMatrixVectorIndexing") == 0)
|
||||
else if (tokenStr == "generalAttributeMatrixVectorIndexing")
|
||||
resources->limits.generalAttributeMatrixVectorIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalVaryingIndexing") == 0)
|
||||
else if (tokenStr == "generalVaryingIndexing")
|
||||
resources->limits.generalVaryingIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalSamplerIndexing") == 0)
|
||||
else if (tokenStr == "generalSamplerIndexing")
|
||||
resources->limits.generalSamplerIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalVariableIndexing") == 0)
|
||||
else if (tokenStr == "generalVariableIndexing")
|
||||
resources->limits.generalVariableIndexing = (value != 0);
|
||||
else if (strcmp(token, "generalConstantMatrixVectorIndexing") == 0)
|
||||
else if (tokenStr == "generalConstantMatrixVectorIndexing")
|
||||
resources->limits.generalConstantMatrixVectorIndexing = (value != 0);
|
||||
else
|
||||
printf("Warning: unrecognized limit (%s) in configuration file.\n", token);
|
||||
printf("Warning: unrecognized limit (%s) in configuration file.\n", tokenStr.c_str());
|
||||
|
||||
token = strtok(0, delims);
|
||||
}
|
||||
}
|
||||
|
||||
|
1197
Externals/glslang/StandAlone/StandAlone.cpp
vendored
1197
Externals/glslang/StandAlone/StandAlone.cpp
vendored
File diff suppressed because it is too large
Load Diff
51
Externals/glslang/StandAlone/Worklist.h
vendored
51
Externals/glslang/StandAlone/Worklist.h
vendored
@ -1,11 +1,11 @@
|
||||
//
|
||||
//Copyright (C) 2013 LunarG, Inc.
|
||||
// Copyright (C) 2013 LunarG, Inc.
|
||||
//
|
||||
//All rights reserved.
|
||||
// All rights reserved.
|
||||
//
|
||||
//Redistribution and use in source and binary forms, with or without
|
||||
//modification, are permitted provided that the following conditions
|
||||
//are met:
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
@ -19,25 +19,26 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
//POSSIBILITY OF SUCH DAMAGE.
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
#ifndef WORKLIST_H_INCLUDED
|
||||
#define WORKLIST_H_INCLUDED
|
||||
|
||||
#include "../glslang/OSDependent/osinclude.h"
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
namespace glslang {
|
||||
|
||||
@ -58,23 +59,18 @@ namespace glslang {
|
||||
|
||||
void add(TWorkItem* item)
|
||||
{
|
||||
GetGlobalLock();
|
||||
|
||||
std::lock_guard<std::mutex> guard(mutex);
|
||||
worklist.push_back(item);
|
||||
|
||||
ReleaseGlobalLock();
|
||||
}
|
||||
|
||||
|
||||
bool remove(TWorkItem*& item)
|
||||
{
|
||||
GetGlobalLock();
|
||||
|
||||
std::lock_guard<std::mutex> guard(mutex);
|
||||
|
||||
if (worklist.empty())
|
||||
return false;
|
||||
item = worklist.front();
|
||||
worklist.pop_front();
|
||||
|
||||
ReleaseGlobalLock();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -90,6 +86,7 @@ namespace glslang {
|
||||
}
|
||||
|
||||
protected:
|
||||
std::mutex mutex;
|
||||
std::list<TWorkItem*> worklist;
|
||||
};
|
||||
|
||||
|
39
Externals/glslang/StandAlone/spirv-remap.cpp
vendored
39
Externals/glslang/StandAlone/spirv-remap.cpp
vendored
@ -1,11 +1,11 @@
|
||||
//
|
||||
//Copyright (C) 2015 LunarG, Inc.
|
||||
// Copyright (C) 2015 LunarG, Inc.
|
||||
//
|
||||
//All rights reserved.
|
||||
// All rights reserved.
|
||||
//
|
||||
//Redistribution and use in source and binary forms, with or without
|
||||
//modification, are permitted provided that the following conditions
|
||||
//are met:
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions
|
||||
// are met:
|
||||
//
|
||||
// Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
@ -19,18 +19,18 @@
|
||||
// contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
//POSSIBILITY OF SUCH DAMAGE.
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
// POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
@ -143,8 +143,8 @@ namespace {
|
||||
<< " [--map (all|types|names|funcs)]"
|
||||
<< " [--dce (all|types|funcs)]"
|
||||
<< " [--opt (all|loadstore)]"
|
||||
<< " [--strip-all | --strip all | -s]"
|
||||
<< " [--do-everything]"
|
||||
<< " [--strip-all | --strip all | -s]"
|
||||
<< " [--do-everything]"
|
||||
<< " --input | -i file1 [file2...] --output|-o DESTDIR"
|
||||
<< std::endl;
|
||||
|
||||
@ -311,7 +311,6 @@ namespace {
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::vector<std::string> inputFile;
|
||||
|
Reference in New Issue
Block a user