glslang portability: Fixed a slew of OSX compilation warnings (but not all).
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31469 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -370,7 +370,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
|
||||
if (glslangIntermediate->getXfbMode())
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeXfb);
|
||||
|
||||
spv::ExecutionMode mode;
|
||||
unsigned int mode;
|
||||
switch (glslangIntermediate->getStage()) {
|
||||
case EShLangVertex:
|
||||
break;
|
||||
@@ -384,10 +384,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
|
||||
case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break;
|
||||
case glslang::ElgQuads: mode = spv::ExecutionModeInputQuads; break;
|
||||
case glslang::ElgIsolines: mode = spv::ExecutionModeInputIsolines; break;
|
||||
default: mode = (spv::ExecutionMode)spv::BadValue; break;
|
||||
default: mode = spv::BadValue; break;
|
||||
}
|
||||
if (mode != spv::BadValue)
|
||||
builder.addExecutionMode(shaderEntry, mode);
|
||||
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
|
||||
|
||||
// TODO
|
||||
//builder.addExecutionMode(spv::VertexSpacingMdName, glslangIntermediate->getVertexSpacing());
|
||||
@@ -402,20 +402,20 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* gls
|
||||
case glslang::ElgLinesAdjacency: mode = spv::ExecutionModeInputLinesAdjacency; break;
|
||||
case glslang::ElgTriangles: mode = spv::ExecutionModeInputTriangles; break;
|
||||
case glslang::ElgTrianglesAdjacency: mode = spv::ExecutionModeInputTrianglesAdjacency; break;
|
||||
default: mode = (spv::ExecutionMode)spv::BadValue; break;
|
||||
default: mode = spv::BadValue; break;
|
||||
}
|
||||
if (mode != spv::BadValue)
|
||||
builder.addExecutionMode(shaderEntry, mode);
|
||||
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeInvocations, glslangIntermediate->getInvocations());
|
||||
|
||||
switch (glslangIntermediate->getOutputPrimitive()) {
|
||||
case glslang::ElgPoints: mode = spv::ExecutionModeOutputPoints; break;
|
||||
case glslang::ElgLineStrip: mode = spv::ExecutionModeOutputLineStrip; break;
|
||||
case glslang::ElgTriangleStrip: mode = spv::ExecutionModeOutputTriangleStrip; break;
|
||||
default: mode = (spv::ExecutionMode)spv::BadValue; break;
|
||||
default: mode = spv::BadValue; break;
|
||||
}
|
||||
if (mode != spv::BadValue)
|
||||
builder.addExecutionMode(shaderEntry, mode);
|
||||
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
|
||||
builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, glslangIntermediate->getVertices());
|
||||
break;
|
||||
|
||||
@@ -1239,10 +1239,7 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
|
||||
if (glslang::IsAnonymous(name))
|
||||
name = "";
|
||||
|
||||
if (storageClass == spv::BadValue)
|
||||
return builder.createVariable(spv::StorageClassFunction, spvType, name);
|
||||
else
|
||||
return builder.createVariable(storageClass, spvType, name);
|
||||
return builder.createVariable(storageClass, spvType, name);
|
||||
}
|
||||
|
||||
// Return type Id of the sampled type.
|
||||
|
||||
@@ -2053,8 +2053,8 @@ void Builder::simplifyAccessChainSwizzle()
|
||||
void Builder::mergeAccessChainSwizzle()
|
||||
{
|
||||
// is there even a chance of doing something? Need a single-component swizzle
|
||||
if (accessChain.swizzle.size() > 1 ||
|
||||
accessChain.swizzle.size() == 0 && accessChain.component == 0)
|
||||
if ((accessChain.swizzle.size() > 1) ||
|
||||
(accessChain.swizzle.size() == 0 && accessChain.component == 0))
|
||||
return;
|
||||
|
||||
// TODO: optimization: remove this, but for now confine this to non-dynamic accesses
|
||||
|
||||
@@ -368,8 +368,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
|
||||
disassembleIds(numOperands);
|
||||
return;
|
||||
case OperandVariableLiterals:
|
||||
if (opCode == OpDecorate && stream[word - 1] == DecorationBuiltIn ||
|
||||
opCode == OpMemberDecorate && stream[word - 1] == DecorationBuiltIn) {
|
||||
if ((opCode == OpDecorate && stream[word - 1] == DecorationBuiltIn) ||
|
||||
(opCode == OpMemberDecorate && stream[word - 1] == DecorationBuiltIn)) {
|
||||
out << BuiltInString(stream[word++]);
|
||||
--numOperands;
|
||||
++op;
|
||||
|
||||
Reference in New Issue
Block a user