Non-Functional: Whitespace, comments, replace accidentally deleted comment.

- fixed ParseHelper.cpp newlines (crlf -> lf)
- removed trailing white space in most source files
- fix some spelling issues
- extra blank lines
- tabs to spaces
- replace #include comment about no location
This commit is contained in:
John Kessenich 2017-01-06 00:34:48 -07:00
parent 3dd32293f4
commit ecba76fe73
60 changed files with 755 additions and 806 deletions

View file

@ -34,7 +34,7 @@
//
//
// Create strings that declare built-in definitions, add built-ins programmatically
// Create strings that declare built-in definitions, add built-ins programmatically
// that cannot be expressed in the strings, and establish mappings between
// built-in functions and operators.
//
@ -102,14 +102,14 @@ bool IsIllegalSample(const glslang::TString& name, const char* argOrder, int dim
return true;
}
const bool isGather =
(name == "Gather" ||
const bool isGather =
(name == "Gather" ||
name == "GatherRed" ||
name == "GatherGreen" ||
name == "GatherGreen" ||
name == "GatherBlue" ||
name == "GatherAlpha");
const bool isGatherCmp =
const bool isGatherCmp =
(name == "GatherCmpRed" ||
name == "GatherCmpGreen" ||
name == "GatherCmpBlue" ||
@ -174,7 +174,7 @@ const char* IoParam(glslang::TString& s, const char* nthArgOrder)
} else if (*nthArgOrder == '<') { // input params
++nthArgOrder;
s.append("in ");
}
}
return nthArgOrder;
}
@ -195,9 +195,8 @@ inline bool IsEndOfArg(const char* arg)
return arg == nullptr || *arg == '\0' || *arg == ',';
}
// If this is a fixed vector size, such as V3, return the size. Else return 0.
int FixedVecSize(const char* arg)
int FixedVecSize(const char* arg)
{
while (!IsEndOfArg(arg)) {
if (isdigit(*arg))
@ -208,7 +207,6 @@ int FixedVecSize(const char* arg)
return 0; // none found.
}
// Create and return a type name. This is done in GLSL, not HLSL conventions, until such
// time as builtins are parsed using the HLSL parser.
//
@ -229,7 +227,7 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons
char type = *argType;
if (isTranspose) { // Take transpose of matrix dimensions
std::swap(dim0, dim1);
std::swap(dim0, dim1);
} else if (isTexture) {
if (type == 'F') // map base type to texture of that type.
type = 'T'; // e.g, int -> itexture, uint -> utexture, etc.
@ -255,10 +253,10 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons
case 'S': s += "sampler"; break;
case 's': s += "SamplerComparisonState"; break;
case 'T': s += ((isBuffer && isImage) ? "RWBuffer" :
isBuffer ? "Buffer" :
isBuffer ? "Buffer" :
isImage ? "RWTexture" : "Texture"); break;
case 'i': s += ((isBuffer && isImage) ? "RWBuffer" :
isBuffer ? "Buffer" :
isBuffer ? "Buffer" :
isImage ? "RWTexture" : "Texture"); break;
case 'u': s += ((isBuffer && isImage) ? "RWBuffer" :
isBuffer ? "Buffer" :
@ -322,7 +320,7 @@ glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, cons
case 'V':
s += ('0' + char(dim0));
break;
case 'M':
case 'M':
s += ('0' + char(dim0));
s += 'x';
s += ('0' + char(dim1));
@ -389,7 +387,6 @@ inline bool IsValid(const char* cname, char retOrder, char retType, char argOrde
return true;
}
// return position of end of argument specifier
inline const char* FindEndOfArg(const char* arg)
{
@ -424,7 +421,7 @@ inline void FindVectorMatrixBounds(const char* argOrder, int fixedVecSize, int&
if (fixedVecSize > 0) // handle fixed sized vectors
dim0Min = dim0Max = fixedVecSize;
}
} // end anonymous namespace
namespace glslang {
@ -433,7 +430,6 @@ TBuiltInParseablesHlsl::TBuiltInParseablesHlsl()
{
}
//
// Handle creation of mat*mat specially, since it doesn't fall conveniently out of
// the generic prototype creation code below.
@ -476,7 +472,6 @@ void TBuiltInParseablesHlsl::createMatTimesMat()
s.append(");\n"); // close paren
// Create V*M
AppendTypeName(s, "V", "F", xCols, 1); // add return type
s.append(" "); // space between type and name
@ -508,7 +503,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
// needed for furture validation. For now, they are commented out, and set below
// to EShLangAll, to allow any intrinsic to be used in any shader, which is legal
// if it is not called.
//
//
// static const EShLanguageMask EShLangPSCS = EShLanguageMask(EShLangFragmentMask | EShLangComputeMask);
// static const EShLanguageMask EShLangVSPSGS = EShLanguageMask(EShLangVertexMask | EShLangFragmentMask | EShLangGeometryMask);
// static const EShLanguageMask EShLangCS = EShLangComputeMask;
@ -745,7 +740,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
{ "GetSamplePosition", "V2", "F", "$&2,S", "FUI,I", EShLangVSPSGS },
//
//
// UINT Width
// UINT MipLevel, UINT Width, UINT NumberOfLevels
{ "GetDimensions", /* 1D */ "-", "-", "%!~1,>S", "FUI,U", EShLangAll },
@ -947,7 +942,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
AppendTypeName(s, nthArgOrder, nthArgType, argDim0, dim1); // Add arguments
}
s.append(");\n"); // close paren and trailing semicolon
} // dim 1 loop
} // dim 0 loop
@ -956,10 +951,10 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
// skip over special characters
if (isTexture && isalpha(argOrder[1]))
++argOrder;
if (isdigit(argOrder[1]))
if (isdigit(argOrder[1]))
++argOrder;
} // arg order loop
if (intrinsic.stage == EShLangAll) // common builtins are only added once.
break;
}
@ -988,7 +983,6 @@ void TBuiltInParseablesHlsl::initialize(const TBuiltInResource& /*resources*/, i
{
}
//
// Finish adding/processing context-independent built-in symbols.
// 1) Programmatically add symbols that could not be added by simple text strings above.
@ -1167,7 +1161,7 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil
//
// Add context-dependent (resource-specific) built-ins not handled by the above. These
// would be ones that need to be programmatically added because they cannot
// would be ones that need to be programmatically added because they cannot
// be added by simple text strings. For these, also
// 1) Map built-in functions to operators, for those that will turn into an operation node
// instead of remaining a function call.
@ -1179,5 +1173,4 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil
{
}
} // end namespace glslang