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

@ -439,7 +439,6 @@ spv::Decoration TranslateNoContractionDecoration(const glslang::TQualifier& qual
return spv::DecorationMax;
}
// Translate a glslang built-in variable to a SPIR-V built in decoration. Also generate
// associated capabilities when required. For some built-in variables, a capability
// is generated only when using the variable in an executable instruction, but not when
@ -2139,7 +2138,6 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
return spvType;
}
// Do full recursive conversion of a glslang structure (or block) type to a SPIR-V Id.
// explicitLayout can be kept the same throughout the hierarchical recursive walk.
// Mutually recursive with convertGlslangToSpvType().

View File

@ -286,7 +286,6 @@ namespace spv {
return literal;
}
void spirvbin_t::applyMap()
{
msg(3, 2, std::string("Applying map: "));
@ -300,7 +299,6 @@ namespace spv {
);
}
// Find free IDs for anything we haven't mapped
void spirvbin_t::mapRemainder()
{
@ -462,7 +460,6 @@ namespace spv {
error("bad schema, must be 0");
}
int spirvbin_t::processInstruction(unsigned word, instfn_t instFn, idfn_t idFn)
{
const auto instructionStart = word;
@ -1079,7 +1076,6 @@ namespace spv {
}
}
#ifdef NOTDEF
bool spirvbin_t::matchType(const spirvbin_t::globaltypes_t& globalTypes, spv::Id lt, spv::Id gt) const
{
@ -1139,7 +1135,6 @@ namespace spv {
}
}
// Look for an equivalent type in the globalTypes map
spv::Id spirvbin_t::findType(const spirvbin_t::globaltypes_t& globalTypes, spv::Id lt) const
{
@ -1261,7 +1256,6 @@ namespace spv {
}
}
// Strip a single binary by removing ranges given in stripRange
void spirvbin_t::strip()
{

View File

@ -1936,7 +1936,6 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
}
}
// Step 2: Construct a matrix from that array.
// First make the column vectors, then make the matrix.

View File

@ -311,7 +311,6 @@ namespace {
} // namespace
int main(int argc, char** argv)
{
std::vector<std::string> inputFile;

View File

@ -245,7 +245,6 @@ private:
TPoolAllocator(const TPoolAllocator&); // don't allow default copy constructor
};
//
// There could potentially be many pools with pops happening at
// different times. But a simple use is to have a global pop

View File

@ -42,7 +42,6 @@
// This should not be included by driver code.
//
#define SH_EXPORTING
#include "../Public/ShaderLang.h"
#include "../MachineIndependent/Versions.h"

View File

@ -1601,7 +1601,6 @@ public:
p += snprintf(p, end - p, "passthrough ");
#endif
p += snprintf(p, end - p, ") ");
}
}

View File

@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.1744"
#define GLSLANG_DATE "05-Jan-2017"
#define GLSLANG_REVISION "Overload400-PrecQual.1747"
#define GLSLANG_DATE "06-Jan-2017"

View File

@ -103,7 +103,6 @@ TBuiltIns::~TBuiltIns()
{
}
//
// Add all context-independent built-in functions and variables that are present
// for the given version and profile. Share common ones across stages, otherwise
@ -2524,7 +2523,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"float quadraticAttenuation;"// K2
"};"
"struct gl_LightModelParameters {"
"vec4 ambient;" // Acs
"};"
@ -2827,7 +2825,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
);
}
//============================================================================
//
// Define the interface to the tessellation control shader.
@ -3637,7 +3634,6 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int ve
}
}
//
// Helper function for add2ndGenerationSamplingImaging(),
// when adding context-independent built-in functions.
@ -4137,7 +4133,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
s.append("\n");
}
// compute
if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) {
snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX,

View File

@ -107,7 +107,6 @@ protected:
int dimMap[EsdNumDims];
};
} // end namespace glslang
#endif // _INITIALIZE_INCLUDED_

View File

@ -1245,7 +1245,6 @@ TIntermNode* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nod
return node;
}
TIntermTyped* TIntermediate::addComma(TIntermTyped* left, TIntermTyped* right, const TSourceLoc& loc)
{
// However, the lowest precedence operators of the sequence operator ( , ) and the assignment operators
@ -2304,7 +2303,6 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node)
return false;
}
void TIntermBinary::updatePrecision()
{
#ifdef AMD_EXTENSIONS

View File

@ -206,7 +206,6 @@ void TAllocation::checkGuardBlock(unsigned char*, unsigned char, const char*) co
#endif
}
void TPoolAllocator::push()
{
tAllocState state = { currentPageOffset, inUseList };
@ -334,7 +333,6 @@ void* TPoolAllocator::allocate(size_t numBytes)
return initializeAllocation(inUseList, ret, numBytes);
}
//
// Check all allocations in a list for damage by calling check on each.
//

View File

@ -1032,7 +1032,6 @@ bool PreprocessDeferred(
false, includer);
}
//
// do a partial compile on the given strings for a single compilation unit
// for a potential deferred link into a single stage (and deferred full compile of that
@ -1072,7 +1071,6 @@ bool CompileDeferred(
} // end anonymous namespace for local functions
//
// ShInitialize() should be called exactly once per process, not per thread.
//
@ -1265,7 +1263,6 @@ int ShLinkExt(
if (base->getAsCompiler())
cObjects.push_back(base->getAsCompiler());
if (cObjects[i] == 0)
return 0;
}

View File

@ -33,7 +33,7 @@
//
//
// Travarse a tree of constants to create a single folded constant.
// Traverse a tree of constants to create a single folded constant.
// It should only be used when the whole tree is known to be constant.
//

View File

@ -617,6 +617,7 @@ int TPpContext::CPPinclude(TPpToken* ppToken)
epilogue << (res->file_data[res->file_length - 1] == '\n'? "" : "\n") <<
"#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n";
pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this));
// There's no "current" location anymore.
parseContext.setCurrentColumn(0);
} else {
// things are okay, but there is nothing to process

View File

@ -63,7 +63,6 @@
// there wasn't exactly one entry point.
//
namespace glslang {
//
@ -355,7 +354,6 @@ public:
return blockIndex;
}
// Are we at a level in a dereference chain at which individual active uniform queries are made?
bool isReflectionGranularity(const TType& type)
{
@ -694,7 +692,6 @@ void TReflectionTraverser::visitSymbol(TIntermSymbol* base)
addAttribute(*base);
}
//
// Implement TReflection methods.
//

View File

@ -59,7 +59,6 @@ static void DetachThreadLinux(void *)
DetachThread();
}
//
// Registers cleanup handler, sets cancel type and state, and executes the thread specific
// cleanup handler. This function will be called in the Standalone.cpp for regression
@ -97,7 +96,6 @@ void OS_CleanupThreadData(void)
#endif
}
//
// Thread Local Storage Operations
//
@ -126,7 +124,6 @@ OS_TLSIndex OS_AllocTLSIndex()
return PthreadKeyToTLSIndex(pPoolIndex);
}
bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
{
if (nIndex == OS_INVALID_TLS_INDEX) {
@ -166,7 +163,7 @@ bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
}
namespace {
pthread_mutex_t gMutex;
pthread_mutex_t gMutex;
}
void InitGlobalLock()

View File

@ -77,7 +77,6 @@ OS_TLSIndex OS_AllocTLSIndex()
return ToGenericTLSIndex(dwIndex);
}
bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
{
if (nIndex == OS_INVALID_TLS_INDEX) {

View File

@ -269,7 +269,6 @@ bool HlslGrammar::acceptSamplerDeclarationDX9(TType& /*type*/)
return false;
}
// declaration
// : sampler_declaration_dx9 post_decls SEMICOLON
// | fully_specified_type declarator_list SEMICOLON
@ -1099,7 +1098,6 @@ bool HlslGrammar::acceptTextureType(TType& type)
return true;
}
// If token is for a type, update 'type' with the type information,
// and return true and advance.
// Otherwise, return false, and don't advance
@ -1261,7 +1259,6 @@ bool HlslGrammar::acceptType(TType& type)
new(&type) TType(EbtUint, EvqTemporary, 4);
break;
case EHTokBool:
new(&type) TType(EbtBool);
break;
@ -1814,7 +1811,6 @@ bool HlslGrammar::acceptFunctionParameters(TFunction& function)
return true;
}
// default_parameter_declaration
// : EQUAL conditional_expression
// : EQUAL initializer
@ -1837,7 +1833,7 @@ bool HlslGrammar::acceptDefaultParameterDeclaration(const TType& type, TIntermTy
return false;
TIntermTyped* arguments = nullptr;
for (int i=0; i<int(node->getAsAggregate()->getSequence().size()); i++)
for (int i = 0; i < int(node->getAsAggregate()->getSequence().size()); i++)
parseContext.handleFunctionArgument(constructor, arguments, node->getAsAggregate()->getSequence()[i]->getAsTyped());
node = parseContext.handleFunctionCall(token.loc, constructor, node);

View File

@ -1216,7 +1216,6 @@ bool HlslParseContext::wasSplit(const TIntermTyped* node) const
wasSplit(node->getAsSymbolNode()->getId());
}
// Turn an access into an aggregate that was flattened to instead be
// an access to the individual variable the member was flattened to.
// Assumes shouldFlatten() or equivalent was called first.
@ -1299,7 +1298,6 @@ void HlslParseContext::splitAccessArray(const TSourceLoc& loc, TIntermTyped* bas
builtInIoIndex = index;
}
// Turn an access into an struct that was split to instead be an
// access to either the modified structure, or a direct reference to
// one of the split member variables.
@ -1436,7 +1434,6 @@ TFunction& HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFu
return function;
}
// Add interstage IO variables to the linkage in canonical order.
void HlslParseContext::addInterstageIoToLinkage()
{
@ -3504,7 +3501,6 @@ void HlslParseContext::handleSemantic(TSourceLoc loc, TQualifier& qualifier, con
// stage, it would just be ignored as it is likely there as part of an output struct from one stage
// to the next
bool bParseDX9 = false;
if (bParseDX9) {
if (semanticUpperCase == "PSIZE")
@ -3794,7 +3790,6 @@ void HlslParseContext::globalCheck(const TSourceLoc& loc, const char* token)
error(loc, "not allowed in nested scope", token, "");
}
bool HlslParseContext::builtInName(const TString& /*identifier*/)
{
return false;
@ -6288,5 +6283,4 @@ void HlslParseContext::finish()
TParseContextBase::finish();
}
} // end namespace glslang

View File

@ -195,7 +195,6 @@ 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)
{
@ -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.
//
@ -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)
{
@ -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
@ -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.
@ -1179,5 +1173,4 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil
{
}
} // end namespace glslang

View File

@ -316,7 +316,6 @@ void HlslScanContext::fillInKeywordMap()
(*KeywordMap)["RWTexture3D"] = EHTokRWTexture3d;
(*KeywordMap)["RWBuffer"] = EHTokRWBuffer;
(*KeywordMap)["struct"] = EHTokStruct;
(*KeywordMap)["cbuffer"] = EHTokCBuffer;
(*KeywordMap)["tbuffer"] = EHTokTBuffer;

View File

@ -252,7 +252,6 @@ enum EHlslTokenClass {
EHTokRWTexture3d,
EHTokRWBuffer,
// variable, user type, ...
EHTokIdentifier,
EHTokTypeName,