mirror of
https://github.com/libretro/RetroArch
synced 2024-07-05 09:48:42 +00:00
(glslang) SpvBuildLogger never used, remove
This commit is contained in:
parent
24a2f1e7c3
commit
6a8fe15772
|
@ -1865,7 +1865,6 @@ ifeq ($(HAVE_BUILTINGLSLANG), 1)
|
||||||
gfx/drivers_shader/glslang.cpp \
|
gfx/drivers_shader/glslang.cpp \
|
||||||
$(DEPS_DIR)/glslang/glslang/SPIRV/GlslangToSpv.cpp \
|
$(DEPS_DIR)/glslang/glslang/SPIRV/GlslangToSpv.cpp \
|
||||||
$(DEPS_DIR)/glslang/glslang/SPIRV/InReadableOrder.cpp \
|
$(DEPS_DIR)/glslang/glslang/SPIRV/InReadableOrder.cpp \
|
||||||
$(DEPS_DIR)/glslang/glslang/SPIRV/Logger.cpp \
|
|
||||||
$(DEPS_DIR)/glslang/glslang/SPIRV/SpvBuilder.cpp \
|
$(DEPS_DIR)/glslang/glslang/SPIRV/SpvBuilder.cpp \
|
||||||
$(wildcard $(DEPS_DIR)/glslang/glslang/OGLCompilersDLL/*.cpp) \
|
$(wildcard $(DEPS_DIR)/glslang/glslang/OGLCompilersDLL/*.cpp) \
|
||||||
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/*.cpp) \
|
$(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/*.cpp) \
|
||||||
|
|
2
deps/glslang/glslang/SPIRV/CMakeLists.txt
vendored
2
deps/glslang/glslang/SPIRV/CMakeLists.txt
vendored
|
@ -1,7 +1,6 @@
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
GlslangToSpv.cpp
|
GlslangToSpv.cpp
|
||||||
InReadableOrder.cpp
|
InReadableOrder.cpp
|
||||||
Logger.cpp
|
|
||||||
SpvBuilder.cpp
|
SpvBuilder.cpp
|
||||||
doc.cpp
|
doc.cpp
|
||||||
)
|
)
|
||||||
|
@ -18,7 +17,6 @@ set(HEADERS
|
||||||
GLSL.ext.KHR.h
|
GLSL.ext.KHR.h
|
||||||
GlslangToSpv.h
|
GlslangToSpv.h
|
||||||
hex_float.h
|
hex_float.h
|
||||||
Logger.h
|
|
||||||
SpvBuilder.h
|
SpvBuilder.h
|
||||||
spvIR.h
|
spvIR.h
|
||||||
doc.h
|
doc.h
|
||||||
|
|
111
deps/glslang/glslang/SPIRV/GlslangToSpv.cpp
vendored
111
deps/glslang/glslang/SPIRV/GlslangToSpv.cpp
vendored
|
@ -114,8 +114,7 @@ struct OpDecorations {
|
||||||
//
|
//
|
||||||
class TGlslangToSpvTraverser : public glslang::TIntermTraverser {
|
class TGlslangToSpvTraverser : public glslang::TIntermTraverser {
|
||||||
public:
|
public:
|
||||||
TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate*, spv::SpvBuildLogger* logger,
|
TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate*, glslang::SpvOptions& options);
|
||||||
glslang::SpvOptions& options);
|
|
||||||
virtual ~TGlslangToSpvTraverser() { }
|
virtual ~TGlslangToSpvTraverser() { }
|
||||||
|
|
||||||
bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*);
|
bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*);
|
||||||
|
@ -219,8 +218,6 @@ protected:
|
||||||
spv::Instruction* entryPoint;
|
spv::Instruction* entryPoint;
|
||||||
int sequenceDepth;
|
int sequenceDepth;
|
||||||
|
|
||||||
spv::SpvBuildLogger* logger;
|
|
||||||
|
|
||||||
// There is a 1:1 mapping between a spv builder and a module; this is thread safe
|
// There is a 1:1 mapping between a spv builder and a module; this is thread safe
|
||||||
spv::Builder builder;
|
spv::Builder builder;
|
||||||
bool inEntryPoint;
|
bool inEntryPoint;
|
||||||
|
@ -1010,13 +1007,12 @@ bool HasNonLayoutQualifiers(const glslang::TType& type, const glslang::TQualifie
|
||||||
// Implement the TGlslangToSpvTraverser class.
|
// Implement the TGlslangToSpvTraverser class.
|
||||||
//
|
//
|
||||||
|
|
||||||
TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate* glslangIntermediate,
|
TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate* glslangIntermediate, glslang::SpvOptions& options)
|
||||||
spv::SpvBuildLogger* buildLogger, glslang::SpvOptions& options)
|
|
||||||
: TIntermTraverser(true, false, true),
|
: TIntermTraverser(true, false, true),
|
||||||
options(options),
|
options(options),
|
||||||
shaderEntry(nullptr), currentFunction(nullptr),
|
shaderEntry(nullptr), currentFunction(nullptr),
|
||||||
sequenceDepth(0), logger(buildLogger),
|
sequenceDepth(0),
|
||||||
builder(spvVersion, (glslang::GetKhronosToolId() << 16) | glslang::GetSpirvGeneratorVersion(), logger),
|
builder(spvVersion, (glslang::GetKhronosToolId() << 16) | glslang::GetSpirvGeneratorVersion()),
|
||||||
inEntryPoint(false), entryPointTerminated(false), linkageOnly(false),
|
inEntryPoint(false), entryPointTerminated(false), linkageOnly(false),
|
||||||
glslangIntermediate(glslangIntermediate)
|
glslangIntermediate(glslangIntermediate)
|
||||||
{
|
{
|
||||||
|
@ -1025,29 +1021,6 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl
|
||||||
builder.clearAccessChain();
|
builder.clearAccessChain();
|
||||||
builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()),
|
builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()),
|
||||||
glslangIntermediate->getVersion());
|
glslangIntermediate->getVersion());
|
||||||
|
|
||||||
if (options.generateDebugInfo) {
|
|
||||||
builder.setEmitOpLines();
|
|
||||||
builder.setSourceFile(glslangIntermediate->getSourceFile());
|
|
||||||
|
|
||||||
// Set the source shader's text. If for SPV version 1.0, include
|
|
||||||
// a preamble in comments stating the OpModuleProcessed instructions.
|
|
||||||
// Otherwise, emit those as actual instructions.
|
|
||||||
std::string text;
|
|
||||||
const std::vector<std::string>& processes = glslangIntermediate->getProcesses();
|
|
||||||
for (int p = 0; p < (int)processes.size(); ++p) {
|
|
||||||
if (glslangIntermediate->getSpv().spv < 0x00010100) {
|
|
||||||
text.append("// OpModuleProcessed ");
|
|
||||||
text.append(processes[p]);
|
|
||||||
text.append("\n");
|
|
||||||
} else
|
|
||||||
builder.addModuleProcessed(processes[p]);
|
|
||||||
}
|
|
||||||
if (glslangIntermediate->getSpv().spv < 0x00010100 && (int)processes.size() > 0)
|
|
||||||
text.append("#line 1\n");
|
|
||||||
text.append(glslangIntermediate->getSourceText());
|
|
||||||
builder.setSourceText(text);
|
|
||||||
}
|
|
||||||
stdBuiltins = builder.import("GLSL.std.450");
|
stdBuiltins = builder.import("GLSL.std.450");
|
||||||
builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450);
|
builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450);
|
||||||
shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str());
|
shaderEntry = builder.makeEntryPoint(glslangIntermediate->getEntryPointName().c_str());
|
||||||
|
@ -1437,7 +1410,6 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case glslang::EOpMatrixSwizzle:
|
case glslang::EOpMatrixSwizzle:
|
||||||
logger->missingFunctionality("matrix swizzle");
|
|
||||||
return true;
|
return true;
|
||||||
case glslang::EOpLogicalOr:
|
case glslang::EOpLogicalOr:
|
||||||
case glslang::EOpLogicalAnd:
|
case glslang::EOpLogicalAnd:
|
||||||
|
@ -1480,7 +1452,6 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
|
||||||
|
|
||||||
builder.clearAccessChain();
|
builder.clearAccessChain();
|
||||||
if (! result) {
|
if (! result) {
|
||||||
logger->missingFunctionality("unknown glslang binary operation");
|
|
||||||
return true; // pick up a child as the place-holder result
|
return true; // pick up a child as the place-holder result
|
||||||
} else {
|
} else {
|
||||||
builder.setAccessChainRValue(result);
|
builder.setAccessChainRValue(result);
|
||||||
|
@ -1637,7 +1608,6 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
logger->missingFunctionality("unknown glslang unary");
|
|
||||||
return true; // pick up operand as placeholder result
|
return true; // pick up operand as placeholder result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1755,8 +1725,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||||
if (result) {
|
if (result) {
|
||||||
builder.clearAccessChain();
|
builder.clearAccessChain();
|
||||||
builder.setAccessChainRValue(result);
|
builder.setAccessChainRValue(result);
|
||||||
} else
|
}
|
||||||
logger->missingFunctionality("missing user function; linker needs to catch that");
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -2122,7 +2091,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (! result) {
|
if (! result) {
|
||||||
logger->missingFunctionality("unknown glslang aggregate");
|
|
||||||
return true; // pick up a child as a placeholder operand
|
return true; // pick up a child as a placeholder operand
|
||||||
} else {
|
} else {
|
||||||
builder.clearAccessChain();
|
builder.clearAccessChain();
|
||||||
|
@ -5564,7 +5532,6 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
logger->missingFunctionality("invocation operation");
|
|
||||||
return spv::NoResult;
|
return spv::NoResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6406,7 +6373,6 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv:
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
logger->missingFunctionality("unknown operation with no arguments");
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6588,7 +6554,6 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n
|
||||||
|
|
||||||
// Neither a front-end constant node, nor a specialization constant node with constant union array or
|
// Neither a front-end constant node, nor a specialization constant node with constant union array or
|
||||||
// constant sub tree as initializer.
|
// constant sub tree as initializer.
|
||||||
logger->missingFunctionality("Neither a front-end constant nor a spec constant.");
|
|
||||||
exit(1);
|
exit(1);
|
||||||
return spv::NoResult;
|
return spv::NoResult;
|
||||||
}
|
}
|
||||||
|
@ -6869,14 +6834,6 @@ spv::Id TGlslangToSpvTraverser::getExtBuiltins(const char* name)
|
||||||
|
|
||||||
namespace glslang {
|
namespace glslang {
|
||||||
|
|
||||||
void GetSpirvVersion(std::string& version)
|
|
||||||
{
|
|
||||||
const int bufSize = 100;
|
|
||||||
char buf[bufSize];
|
|
||||||
snprintf(buf, bufSize, "0x%08x, Revision %d", spv::Version, spv::Revision);
|
|
||||||
version = buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
// For low-order part of the generator's magic number. Bump up
|
// For low-order part of the generator's magic number. Bump up
|
||||||
// when there is a change in the style (e.g., if SSA form changes,
|
// when there is a change in the style (e.g., if SSA form changes,
|
||||||
// or a different instruction sequence to do something gets used).
|
// or a different instruction sequence to do something gets used).
|
||||||
|
@ -6892,63 +6849,8 @@ int GetSpirvGeneratorVersion()
|
||||||
return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent
|
return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write SPIR-V out to a binary file
|
|
||||||
void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName)
|
|
||||||
{
|
|
||||||
std::ofstream out;
|
|
||||||
out.open(baseName, std::ios::binary | std::ios::out);
|
|
||||||
if (out.fail())
|
|
||||||
printf("ERROR: Failed to open file: %s\n", baseName);
|
|
||||||
for (int i = 0; i < (int)spirv.size(); ++i) {
|
|
||||||
unsigned int word = spirv[i];
|
|
||||||
out.write((const char*)&word, 4);
|
|
||||||
}
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write SPIR-V out to a text file with 32-bit hexadecimal words
|
|
||||||
void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, const char* varName)
|
|
||||||
{
|
|
||||||
std::ofstream out;
|
|
||||||
out.open(baseName, std::ios::binary | std::ios::out);
|
|
||||||
if (out.fail())
|
|
||||||
printf("ERROR: Failed to open file: %s\n", baseName);
|
|
||||||
out << "\t// " <<
|
|
||||||
glslang::GetSpirvGeneratorVersion() << "." << GLSLANG_MINOR_VERSION << "." << GLSLANG_PATCH_LEVEL <<
|
|
||||||
std::endl;
|
|
||||||
if (varName != nullptr) {
|
|
||||||
out << "\t #pragma once" << std::endl;
|
|
||||||
out << "const uint32_t " << varName << "[] = {" << std::endl;
|
|
||||||
}
|
|
||||||
const int WORDS_PER_LINE = 8;
|
|
||||||
for (int i = 0; i < (int)spirv.size(); i += WORDS_PER_LINE) {
|
|
||||||
out << "\t";
|
|
||||||
for (int j = 0; j < WORDS_PER_LINE && i + j < (int)spirv.size(); ++j) {
|
|
||||||
const unsigned int word = spirv[i + j];
|
|
||||||
out << "0x" << std::hex << std::setw(8) << std::setfill('0') << word;
|
|
||||||
if (i + j + 1 < (int)spirv.size()) {
|
|
||||||
out << ",";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
out << std::endl;
|
|
||||||
}
|
|
||||||
if (varName != nullptr) {
|
|
||||||
out << "};";
|
|
||||||
}
|
|
||||||
out.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Set up the glslang traversal
|
// Set up the glslang traversal
|
||||||
//
|
|
||||||
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv, SpvOptions* options)
|
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv, SpvOptions* options)
|
||||||
{
|
|
||||||
spv::SpvBuildLogger logger;
|
|
||||||
GlslangToSpv(intermediate, spirv, &logger, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
|
||||||
spv::SpvBuildLogger* logger, SpvOptions* options)
|
|
||||||
{
|
{
|
||||||
TIntermNode* root = intermediate.getTreeRoot();
|
TIntermNode* root = intermediate.getTreeRoot();
|
||||||
|
|
||||||
|
@ -6961,7 +6863,7 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
|
||||||
|
|
||||||
glslang::GetThreadPoolAllocator().push();
|
glslang::GetThreadPoolAllocator().push();
|
||||||
|
|
||||||
TGlslangToSpvTraverser it(intermediate.getSpv().spv, &intermediate, logger, *options);
|
TGlslangToSpvTraverser it(intermediate.getSpv().spv, &intermediate, *options);
|
||||||
root->traverse(&it);
|
root->traverse(&it);
|
||||||
it.finishSpv();
|
it.finishSpv();
|
||||||
it.dumpSpv(spirv);
|
it.dumpSpv(spirv);
|
||||||
|
@ -7019,4 +6921,5 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsign
|
||||||
glslang::GetThreadPoolAllocator().pop();
|
glslang::GetThreadPoolAllocator().pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}; // end namespace glslang
|
}; // end namespace glslang
|
||||||
|
|
11
deps/glslang/glslang/SPIRV/GlslangToSpv.h
vendored
11
deps/glslang/glslang/SPIRV/GlslangToSpv.h
vendored
|
@ -43,25 +43,16 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Logger.h"
|
|
||||||
|
|
||||||
namespace glslang {
|
namespace glslang {
|
||||||
|
|
||||||
struct SpvOptions {
|
struct SpvOptions {
|
||||||
SpvOptions() : generateDebugInfo(false), disableOptimizer(true),
|
SpvOptions() : disableOptimizer(true),
|
||||||
optimizeSize(false) { }
|
optimizeSize(false) { }
|
||||||
bool generateDebugInfo;
|
|
||||||
bool disableOptimizer;
|
bool disableOptimizer;
|
||||||
bool optimizeSize;
|
bool optimizeSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
void GetSpirvVersion(std::string&);
|
|
||||||
int GetSpirvGeneratorVersion();
|
int GetSpirvGeneratorVersion();
|
||||||
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
||||||
SpvOptions* options = nullptr);
|
SpvOptions* options = nullptr);
|
||||||
void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector<unsigned int>& spirv,
|
|
||||||
spv::SpvBuildLogger* logger, SpvOptions* options = nullptr);
|
|
||||||
void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName);
|
|
||||||
void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, const char* varName);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
68
deps/glslang/glslang/SPIRV/Logger.cpp
vendored
68
deps/glslang/glslang/SPIRV/Logger.cpp
vendored
|
@ -1,68 +0,0 @@
|
||||||
//
|
|
||||||
// Copyright (C) 2016 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 Google Inc. 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.
|
|
||||||
|
|
||||||
#include "Logger.h"
|
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
#include <iterator>
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
namespace spv {
|
|
||||||
|
|
||||||
void SpvBuildLogger::tbdFunctionality(const std::string& f)
|
|
||||||
{
|
|
||||||
if (std::find(std::begin(tbdFeatures), std::end(tbdFeatures), f) == std::end(tbdFeatures))
|
|
||||||
tbdFeatures.push_back(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SpvBuildLogger::missingFunctionality(const std::string& f)
|
|
||||||
{
|
|
||||||
if (std::find(std::begin(missingFeatures), std::end(missingFeatures), f) == std::end(missingFeatures))
|
|
||||||
missingFeatures.push_back(f);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string SpvBuildLogger::getAllMessages() const {
|
|
||||||
std::ostringstream messages;
|
|
||||||
for (auto it = tbdFeatures.cbegin(); it != tbdFeatures.cend(); ++it)
|
|
||||||
messages << "TBD functionality: " << *it << "\n";
|
|
||||||
for (auto it = missingFeatures.cbegin(); it != missingFeatures.cend(); ++it)
|
|
||||||
messages << "Missing functionality: " << *it << "\n";
|
|
||||||
for (auto it = warnings.cbegin(); it != warnings.cend(); ++it)
|
|
||||||
messages << "warning: " << *it << "\n";
|
|
||||||
for (auto it = errors.cbegin(); it != errors.cend(); ++it)
|
|
||||||
messages << "error: " << *it << "\n";
|
|
||||||
return messages.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end spv namespace
|
|
74
deps/glslang/glslang/SPIRV/Logger.h
vendored
74
deps/glslang/glslang/SPIRV/Logger.h
vendored
|
@ -1,74 +0,0 @@
|
||||||
//
|
|
||||||
// Copyright (C) 2016 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 Google Inc. 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.
|
|
||||||
|
|
||||||
#ifndef GLSLANG_SPIRV_LOGGER_H
|
|
||||||
#define GLSLANG_SPIRV_LOGGER_H
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace spv {
|
|
||||||
|
|
||||||
// A class for holding all SPIR-V build status messages, including
|
|
||||||
// missing/TBD functionalities, warnings, and errors.
|
|
||||||
class SpvBuildLogger {
|
|
||||||
public:
|
|
||||||
SpvBuildLogger() {}
|
|
||||||
|
|
||||||
// Registers a TBD functionality.
|
|
||||||
void tbdFunctionality(const std::string& f);
|
|
||||||
// Registers a missing functionality.
|
|
||||||
void missingFunctionality(const std::string& f);
|
|
||||||
|
|
||||||
// Logs a warning.
|
|
||||||
void warning(const std::string& w) { warnings.push_back(w); }
|
|
||||||
// Logs an error.
|
|
||||||
void error(const std::string& e) { errors.push_back(e); }
|
|
||||||
|
|
||||||
// Returns all messages accumulated in the order of:
|
|
||||||
// TBD functionalities, missing functionalities, warnings, errors.
|
|
||||||
std::string getAllMessages() const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
SpvBuildLogger(const SpvBuildLogger&);
|
|
||||||
|
|
||||||
std::vector<std::string> tbdFeatures;
|
|
||||||
std::vector<std::string> missingFeatures;
|
|
||||||
std::vector<std::string> warnings;
|
|
||||||
std::vector<std::string> errors;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // end spv namespace
|
|
||||||
|
|
||||||
#endif // GLSLANG_SPIRV_LOGGER_H
|
|
5
deps/glslang/glslang/SPIRV/SpvBuilder.cpp
vendored
5
deps/glslang/glslang/SPIRV/SpvBuilder.cpp
vendored
|
@ -54,7 +54,7 @@
|
||||||
|
|
||||||
namespace spv {
|
namespace spv {
|
||||||
|
|
||||||
Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogger* buildLogger) :
|
Builder::Builder(unsigned int spvVersion, unsigned int magicNumber) :
|
||||||
spvVersion(spvVersion),
|
spvVersion(spvVersion),
|
||||||
source(SourceLanguageUnknown),
|
source(SourceLanguageUnknown),
|
||||||
sourceVersion(0),
|
sourceVersion(0),
|
||||||
|
@ -67,8 +67,7 @@ Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogg
|
||||||
buildPoint(0),
|
buildPoint(0),
|
||||||
uniqueId(0),
|
uniqueId(0),
|
||||||
entryPointFunction(0),
|
entryPointFunction(0),
|
||||||
generatingOpCodeForSpecConst(false),
|
generatingOpCodeForSpecConst(false)
|
||||||
logger(buildLogger)
|
|
||||||
{
|
{
|
||||||
clearAccessChain();
|
clearAccessChain();
|
||||||
}
|
}
|
||||||
|
|
6
deps/glslang/glslang/SPIRV/SpvBuilder.h
vendored
6
deps/glslang/glslang/SPIRV/SpvBuilder.h
vendored
|
@ -46,7 +46,6 @@
|
||||||
#ifndef SpvBuilder_H
|
#ifndef SpvBuilder_H
|
||||||
#define SpvBuilder_H
|
#define SpvBuilder_H
|
||||||
|
|
||||||
#include "Logger.h"
|
|
||||||
#include "spirv.hpp"
|
#include "spirv.hpp"
|
||||||
#include "spvIR.h"
|
#include "spvIR.h"
|
||||||
|
|
||||||
|
@ -62,7 +61,7 @@ namespace spv {
|
||||||
|
|
||||||
class Builder {
|
class Builder {
|
||||||
public:
|
public:
|
||||||
Builder(unsigned int spvVersion, unsigned int userNumber, SpvBuildLogger* logger);
|
Builder(unsigned int spvVersion, unsigned int userNumber);
|
||||||
virtual ~Builder();
|
virtual ~Builder();
|
||||||
|
|
||||||
static const int maxMatrixSize = 4;
|
static const int maxMatrixSize = 4;
|
||||||
|
@ -638,9 +637,6 @@ public:
|
||||||
|
|
||||||
// Our loop stack.
|
// Our loop stack.
|
||||||
std::stack<LoopBlocks> loops;
|
std::stack<LoopBlocks> loops;
|
||||||
|
|
||||||
// The stream for outputting warnings and errors.
|
|
||||||
SpvBuildLogger* logger;
|
|
||||||
}; // end Builder class
|
}; // end Builder class
|
||||||
|
|
||||||
}; // end spv namespace
|
}; // end spv namespace
|
||||||
|
|
6
deps/glslang/glslang/SPIRV/hex_float.h
vendored
6
deps/glslang/glslang/SPIRV/hex_float.h
vendored
|
@ -25,10 +25,6 @@
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER < 1800
|
#if defined(_MSC_VER) && _MSC_VER < 1800
|
||||||
namespace std {
|
namespace std {
|
||||||
bool isnan(double f)
|
|
||||||
{
|
|
||||||
return ::_isnan(f) != 0;
|
|
||||||
}
|
|
||||||
bool isinf(double f)
|
bool isinf(double f)
|
||||||
{
|
{
|
||||||
return ::_finite(f) == 0;
|
return ::_finite(f) == 0;
|
||||||
|
@ -75,7 +71,6 @@ struct FloatProxyTraits {
|
||||||
template <>
|
template <>
|
||||||
struct FloatProxyTraits<float> {
|
struct FloatProxyTraits<float> {
|
||||||
typedef uint32_t uint_type;
|
typedef uint32_t uint_type;
|
||||||
static bool isNan(float f) { return std::isnan(f); }
|
|
||||||
// Returns true if the given value is any kind of infinity.
|
// Returns true if the given value is any kind of infinity.
|
||||||
static bool isInfinity(float f) { return std::isinf(f); }
|
static bool isInfinity(float f) { return std::isinf(f); }
|
||||||
// Returns the maximum normal value.
|
// Returns the maximum normal value.
|
||||||
|
@ -87,7 +82,6 @@ struct FloatProxyTraits<float> {
|
||||||
template <>
|
template <>
|
||||||
struct FloatProxyTraits<double> {
|
struct FloatProxyTraits<double> {
|
||||||
typedef uint64_t uint_type;
|
typedef uint64_t uint_type;
|
||||||
static bool isNan(double f) { return std::isnan(f); }
|
|
||||||
// Returns true if the given value is any kind of infinity.
|
// Returns true if the given value is any kind of infinity.
|
||||||
static bool isInfinity(double f) { return std::isinf(f); }
|
static bool isInfinity(double f) { return std::isinf(f); }
|
||||||
// Returns the maximum normal value.
|
// Returns the maximum normal value.
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include "../gfx/drivers_shader/glslang.cpp"
|
#include "../gfx/drivers_shader/glslang.cpp"
|
||||||
#include "../deps/glslang/glslang/SPIRV/GlslangToSpv.cpp"
|
#include "../deps/glslang/glslang/SPIRV/GlslangToSpv.cpp"
|
||||||
#include "../deps/glslang/glslang/SPIRV/InReadableOrder.cpp"
|
#include "../deps/glslang/glslang/SPIRV/InReadableOrder.cpp"
|
||||||
#include "../deps/glslang/glslang/SPIRV/Logger.cpp"
|
|
||||||
#include "../deps/glslang/glslang/SPIRV/SpvBuilder.cpp"
|
#include "../deps/glslang/glslang/SPIRV/SpvBuilder.cpp"
|
||||||
|
|
||||||
#include "../deps/glslang/glslang/OGLCompilersDLL/InitializeDll.cpp"
|
#include "../deps/glslang/glslang/OGLCompilersDLL/InitializeDll.cpp"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user