From f68024543f77eb8f5bb715ddb298825b4b853360 Mon Sep 17 00:00:00 2001 From: "ntfs.hard" Date: Mon, 30 Mar 2020 00:55:49 +0300 Subject: [PATCH 1/4] opposite inner condition --- hlsl/hlslParseHelper.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index 557d4ae4..2dc173fc 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -757,9 +757,6 @@ TIntermTyped* HlslParseContext::handleBracketOperator(const TSourceLoc& loc, TIn // indexStructBufferContent returns nullptr if it isn't a structuredbuffer (SSBO). TIntermTyped* sbArray = indexStructBufferContent(loc, base); if (sbArray != nullptr) { - if (sbArray == nullptr) - return nullptr; - // Now we'll apply the [] index to that array const TOperator idxOp = (index->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; From 7fc409eecc199e1e81418a86c3b5ed214ad7d809 Mon Sep 17 00:00:00 2001 From: "ntfs.hard" Date: Mon, 30 Mar 2020 01:32:23 +0300 Subject: [PATCH 2/4] bitwise on boolean --- SPIRV/hex_float.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SPIRV/hex_float.h b/SPIRV/hex_float.h index 905b21a4..8be8e9f7 100644 --- a/SPIRV/hex_float.h +++ b/SPIRV/hex_float.h @@ -784,8 +784,8 @@ inline std::istream& ParseNormalFloat(std::istream& is, bool negate_value, if (val.isInfinity()) { // Fail the parse. Emulate standard behaviour by setting the value to // the closest normal value, and set the fail bit on the stream. - value.set_value((value.isNegative() | negate_value) ? T::lowest() - : T::max()); + value.set_value((value.isNegative() || negate_value) ? T::lowest() + : T::max()); is.setstate(std::ios_base::failbit); } return is; From 988cd6769c6c2cb4b9baf448b1f94875935dba42 Mon Sep 17 00:00:00 2001 From: "ntfs.hard" Date: Mon, 30 Mar 2020 01:38:21 +0300 Subject: [PATCH 3/4] unused var --- StandAlone/StandAlone.cpp | 1 - StandAlone/spirv-remap.cpp | 2 -- 2 files changed, 3 deletions(-) diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index c3ae2b4a..bbd1a271 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -1139,7 +1139,6 @@ void CompileAndLinkShaderUnits(std::vector compUnits) for (int stage = 0; stage < EShLangCount; ++stage) { if (program.getIntermediate((EShLanguage)stage)) { std::vector spirv; - std::string warningsErrors; spv::SpvBuildLogger logger; glslang::SpvOptions spvOptions; if (Options & EOptionDebug) diff --git a/StandAlone/spirv-remap.cpp b/StandAlone/spirv-remap.cpp index 5e2ed0ae..48878c3a 100644 --- a/StandAlone/spirv-remap.cpp +++ b/StandAlone/spirv-remap.cpp @@ -334,8 +334,6 @@ int main(int argc, char** argv) if (outputDir.empty()) usage(argv[0], "Output directory required"); - std::string errmsg; - // Main operations: read, remap, and write. execute(inputFile, outputDir, opts, verbosity); From 1dad92000bca7513ff498fb2595568d24e5df6c7 Mon Sep 17 00:00:00 2001 From: "ntfs.hard" Date: Mon, 30 Mar 2020 01:48:15 +0300 Subject: [PATCH 4/4] printf format --- glslang/MachineIndependent/SymbolTable.cpp | 2 +- glslang/MachineIndependent/reflection.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index 5dc83539..06b5a813 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -122,7 +122,7 @@ void TType::buildMangledName(TString& mangledName) const mangledName += "-tx-struct"; char text[16]; // plenty enough space for the small integers. - snprintf(text, sizeof(text), "%d-", sampler.getStructReturnIndex()); + snprintf(text, sizeof(text), "%u-", sampler.getStructReturnIndex()); mangledName += text; } else { switch (sampler.getVectorSize()) { diff --git a/glslang/MachineIndependent/reflection.cpp b/glslang/MachineIndependent/reflection.cpp index b0936711..28769332 100644 --- a/glslang/MachineIndependent/reflection.cpp +++ b/glslang/MachineIndependent/reflection.cpp @@ -1188,7 +1188,7 @@ void TReflection::dump() for (int dim=0; dim<3; ++dim) if (getLocalSize(dim) > 1) - printf("Local size %s: %d\n", axis[dim], getLocalSize(dim)); + printf("Local size %s: %u\n", axis[dim], getLocalSize(dim)); printf("\n"); }