glslang portability: Resolve OSX errors, some other OS warnings.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31468 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -573,7 +573,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
|
||||
// so short circuit the access-chain stuff with a swizzle.
|
||||
std::vector<unsigned> swizzle;
|
||||
swizzle.push_back(node->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst());
|
||||
builder.accessChainPushSwizzle(swizzle, node->getLeft()->getVectorSize());
|
||||
builder.accessChainPushSwizzle(swizzle);
|
||||
} else {
|
||||
// normal case for indexing array or structure or block
|
||||
builder.accessChainPush(builder.makeIntConstant(index), convertGlslangToSpvType(node->getType()));
|
||||
@@ -615,7 +615,7 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
|
||||
std::vector<unsigned> swizzle;
|
||||
for (int i = 0; i < (int)swizzleSequence.size(); ++i)
|
||||
swizzle.push_back(swizzleSequence[i]->getAsConstantUnion()->getConstArray()[0].getIConst());
|
||||
builder.accessChainPushSwizzle(swizzle, node->getLeft()->getVectorSize());
|
||||
builder.accessChainPushSwizzle(swizzle);
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace spv {
|
||||
|
||||
void spirvbin_t::stripDebug()
|
||||
{
|
||||
if ((options & Options::STRIP) == 0)
|
||||
if ((options & STRIP) == 0)
|
||||
return;
|
||||
|
||||
// build local Id and name maps
|
||||
@@ -337,7 +337,7 @@ namespace spv {
|
||||
process(
|
||||
[&](spv::Op opCode, unsigned start) {
|
||||
// remember opcodes we want to strip later
|
||||
if ((options & Options::STRIP) && isStripOp(opCode))
|
||||
if ((options & STRIP) && isStripOp(opCode))
|
||||
stripInst(start);
|
||||
|
||||
if (opCode == spv::Op::OpName) {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <stdlib.h>
|
||||
|
||||
namespace spv {
|
||||
|
||||
@@ -112,7 +113,7 @@ public:
|
||||
spirvbin_t(int verbose = 0) : entryPoint(spv::NoResult), largestNewId(0), verbose(verbose) { }
|
||||
|
||||
// remap on an existing binary in memory
|
||||
void remap(std::vector<std::uint32_t>& spv, std::uint32_t opts = Options::DO_EVERYTHING);
|
||||
void remap(std::vector<std::uint32_t>& spv, std::uint32_t opts = DO_EVERYTHING);
|
||||
|
||||
// Type for error/log handler functions
|
||||
typedef std::function<void(const std::string&)> errorfn_t;
|
||||
@@ -131,7 +132,7 @@ private:
|
||||
typedef std::unordered_map<spv::Id, spv::Id> idmap_t;
|
||||
typedef std::unordered_set<spv::Id> idset_t;
|
||||
|
||||
void remap(std::uint32_t opts = Options::DO_EVERYTHING);
|
||||
void remap(std::uint32_t opts = DO_EVERYTHING);
|
||||
|
||||
// Map of names to IDs
|
||||
typedef std::unordered_map<std::string, spv::Id> namemap_t;
|
||||
|
||||
@@ -301,7 +301,7 @@ Id Builder::makeSampler(Id sampledType, Dim dim, samplerContent content, bool ar
|
||||
type = groupedTypes[OpTypeSampler][t];
|
||||
if (type->getIdOperand(0) == sampledType &&
|
||||
type->getImmediateOperand(1) == (unsigned int)dim &&
|
||||
type->getImmediateOperand(2) == content &&
|
||||
type->getImmediateOperand(2) == (unsigned int)content &&
|
||||
type->getImmediateOperand(3) == (arrayed ? 1u : 0u) &&
|
||||
type->getImmediateOperand(4) == ( shadow ? 1u : 0u) &&
|
||||
type->getImmediateOperand(5) == ( ms ? 1u : 0u))
|
||||
@@ -1842,7 +1842,7 @@ void Builder::clearAccessChain()
|
||||
}
|
||||
|
||||
// Comments in header
|
||||
void Builder::accessChainPushSwizzle(std::vector<unsigned>& swizzle, int width)
|
||||
void Builder::accessChainPushSwizzle(std::vector<unsigned>& swizzle)
|
||||
{
|
||||
// if needed, propagate the swizzle for the current access chain
|
||||
if (accessChain.swizzle.size()) {
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
Id makeMatrixType(Id component, int cols, int rows);
|
||||
Id makeArrayType(Id element, unsigned size);
|
||||
Id makeFunctionType(Id returnType, std::vector<Id>& paramTypes);
|
||||
enum samplerContent : unsigned {
|
||||
enum samplerContent {
|
||||
samplerContentTexture,
|
||||
samplerContentImage,
|
||||
samplerContentTextureFilter
|
||||
@@ -470,7 +470,7 @@ public:
|
||||
}
|
||||
|
||||
// push new swizzle onto the end of any existing swizzle, merging into a single swizzle
|
||||
void accessChainPushSwizzle(std::vector<unsigned>& swizzle, int width);
|
||||
void accessChainPushSwizzle(std::vector<unsigned>& swizzle);
|
||||
|
||||
// push a variable component selection onto the access chain; supporting only one, so unsided
|
||||
void accessChainPushComponent(Id component) { accessChain.component = component; }
|
||||
|
||||
Reference in New Issue
Block a user