From 0dfbe3f90d35e298b0160a16656eb69fa8023ca2 Mon Sep 17 00:00:00 2001 From: baldurk Date: Sat, 2 Apr 2016 13:38:28 +0200 Subject: [PATCH 1/3] Change {parameter} lists into explicit std::vector temporaries --- SPIRV/SpvBuilder.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 4235f273..9437c9e4 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -1067,7 +1067,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index) // Generate code for spec constants if in spec constant operation // generation mode. if (generatingOpCodeForSpecConst) { - return createSpecConstantOp(OpCompositeExtract, typeId, {composite}, {index}); + return createSpecConstantOp(OpCompositeExtract, typeId, std::vector(1, composite), std::vector(1, index)); } Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract); extract->addIdOperand(composite); @@ -1082,7 +1082,7 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, std::vector(1, composite), indexes); } Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract); extract->addIdOperand(composite); @@ -1184,7 +1184,7 @@ Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand) // Generate code for spec constants if in spec constant operation // generation mode. if (generatingOpCodeForSpecConst) { - return createSpecConstantOp(opCode, typeId, {operand}, {}); + return createSpecConstantOp(opCode, typeId, std::vector(1, operand), std::vector()); } Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(operand); @@ -1198,7 +1198,9 @@ Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right) // Generate code for spec constants if in spec constant operation // generation mode. if (generatingOpCodeForSpecConst) { - return createSpecConstantOp(opCode, typeId, {left, right}, {}); + std::vector operands(2); + operands[0] = left; operands[1] = right; + return createSpecConstantOp(opCode, typeId, operands, std::vector()); } Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(left); @@ -1261,7 +1263,9 @@ Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, std: return setPrecision(createCompositeExtract(source, typeId, channels.front()), precision); if (generatingOpCodeForSpecConst) { - return setPrecision(createSpecConstantOp(OpVectorShuffle, typeId, {source, source}, channels), precision); + std::vector operands(2); + operands[0] = operands[1] = source; + return setPrecision(createSpecConstantOp(OpVectorShuffle, typeId, operands, channels), precision); } Instruction* swizzle = new Instruction(getUniqueId(), typeId, OpVectorShuffle); assert(isVector(source)); From bd9f8351f4fafd16fbe26f07e5150f18460f05ca Mon Sep 17 00:00:00 2001 From: baldurk Date: Sat, 2 Apr 2016 13:38:42 +0200 Subject: [PATCH 2/3] Specify explicit return type on lambda function --- SPIRV/SpvBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 9437c9e4..dda6bb09 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -2213,7 +2213,7 @@ void Builder::eliminateDeadDecorations() { } } decorations.erase(std::remove_if(decorations.begin(), decorations.end(), - [&unreachable_definitions](std::unique_ptr& I) { + [&unreachable_definitions](std::unique_ptr& I) -> bool { Instruction* inst = I.get(); Id decoration_id = inst->getIdOperand(0); return unreachable_definitions.count(decoration_id) != 0; From 6a6d6dda956332b3a8f16b1feebdcf4c19fac8b3 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Sun, 3 Apr 2016 01:17:13 +0100 Subject: [PATCH 3/3] fix spelling mistakes --- CMakeLists.txt | 2 +- README.md | 4 ++-- SPIRV/SPVRemapper.cpp | 2 +- SPIRV/SpvBuilder.cpp | 2 +- glslang/Include/InfoSink.h | 2 +- glslang/Include/PoolAlloc.h | 6 +++--- glslang/OSDependent/Unix/ossource.cpp | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac756f55..12655f78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ elseif(UNIX) add_definitions(-fPIC) add_definitions(-DGLSLANG_OSINCLUDE_UNIX) else(WIN32) - message("unkown platform") + message("unknown platform") endif(WIN32) if(CMAKE_COMPILER_IS_GNUCXX) diff --git a/README.md b/README.md index 77508774..56bdeec9 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ class TProgram See `ShaderLang.h` and the usage of it in `StandAlone/StandAlone.cpp` for more details. -### C Functional Interface (orginal) +### C Functional Interface (orignal) This interface is in roughly the first 2/3 of `ShaderLang.h`, and referred to as the `Sh*()` interface, as all the entry points start `Sh`. @@ -118,7 +118,7 @@ ShCompile(shader, compiler) -> compiler(AST) -> ``` In practice, `ShCompile()` takes shader strings, default version, and -warning/error and other options for controling compilation. +warning/error and other options for controlling compilation. Testing ------- diff --git a/SPIRV/SPVRemapper.cpp b/SPIRV/SPVRemapper.cpp index 965867ef..35dda17b 100755 --- a/SPIRV/SPVRemapper.cpp +++ b/SPIRV/SPVRemapper.cpp @@ -573,7 +573,7 @@ namespace spv { op_fn_nop); // Window size for context-sensitive canonicalization values - // Emperical best size from a single data set. TODO: Would be a good tunable. + // Empirical best size from a single data set. TODO: Would be a good tunable. // We essentially perform a little convolution around each instruction, // to capture the flavor of nearby code, to hopefully match to similar // code in other modules. diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 4235f273..e347fe38 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -2319,7 +2319,7 @@ void Builder::simplifyAccessChainSwizzle() // To the extent any swizzling can become part of the chain // of accesses instead of a post operation, make it so. -// If 'dynamic' is true, include transfering a non-static component index, +// If 'dynamic' is true, include transferring a non-static component index, // otherwise, only transfer static indexes. // // Also, Boolean vectors are likely to be special. While diff --git a/glslang/Include/InfoSink.h b/glslang/Include/InfoSink.h index a321ebcc..5862e5d8 100644 --- a/glslang/Include/InfoSink.h +++ b/glslang/Include/InfoSink.h @@ -92,7 +92,7 @@ public: case EPrefixInternalError: append("INTERNAL ERROR: "); break; case EPrefixUnimplemented: append("UNIMPLEMENTED: "); break; case EPrefixNote: append("NOTE: "); break; - default: append("UNKOWN ERROR: "); break; + default: append("UNKNOWN ERROR: "); break; } } void location(const TSourceLoc& loc) { diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h index de41053f..c3bebc63 100644 --- a/glslang/Include/PoolAlloc.h +++ b/glslang/Include/PoolAlloc.h @@ -95,7 +95,7 @@ public: void checkAllocList() const; - // Return total size needed to accomodate user buffer of 'size', + // Return total size needed to accommodate user buffer of 'size', // plus our tracking data. inline static size_t allocationSize(size_t size) { return size + 2 * guardBlockSize + headerSize(); @@ -241,8 +241,8 @@ protected: int numCalls; // just an interesting statistic size_t totalBytes; // just an interesting statistic private: - TPoolAllocator& operator=(const TPoolAllocator&); // dont allow assignment operator - TPoolAllocator(const TPoolAllocator&); // dont allow default copy constructor + TPoolAllocator& operator=(const TPoolAllocator&); // don't allow assignment operator + TPoolAllocator(const TPoolAllocator&); // don't allow default copy constructor }; diff --git a/glslang/OSDependent/Unix/ossource.cpp b/glslang/OSDependent/Unix/ossource.cpp index 5ce882ab..3bd725ea 100644 --- a/glslang/OSDependent/Unix/ossource.cpp +++ b/glslang/OSDependent/Unix/ossource.cpp @@ -61,7 +61,7 @@ static void DetachThreadLinux(void *) // -// Registers cleanup handler, sets cancel type and state, and excecutes the thread specific +// 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 // testing. When OpenGL applications are run with the driver code, Linux OS does the // thread cleanup.