From 2915da303ffe4dcccf9827b71065b725ce483ed5 Mon Sep 17 00:00:00 2001 From: LoopDawg Date: Fri, 20 Oct 2017 12:02:38 -0600 Subject: [PATCH] Nonfunctional: minor: use std::array for per-set shifts, fix warning. Two unrelated, minor tweaks: (1) Use std::array for shiftBindingForSet. Now matches shiftBinding. (2) Add parens in shouldFlatten() to make compiler warning happy. --- glslang/MachineIndependent/localintermediate.h | 3 +-- hlsl/hlslParseHelper.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 6a855c1a..84953952 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -677,8 +677,7 @@ protected: std::array shiftBinding; // Per-descriptor-set shift values - typedef std::map TDescriptorSetShift; - TDescriptorSetShift shiftBindingForSet[EResCount]; + std::array, EResCount> shiftBindingForSet; std::vector resourceSetBinding; bool autoMapBindings; diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp index b3fc1165..01b9cc3e 100755 --- a/hlsl/hlslParseHelper.cpp +++ b/hlsl/hlslParseHelper.cpp @@ -1157,8 +1157,8 @@ bool HlslParseContext::shouldFlatten(const TType& type, TStorageQualifier qualif case EvqVaryingOut: return type.isStruct() || type.isArray(); case EvqUniform: - return type.isArray() && intermediate.getFlattenUniformArrays() && topLevel || - type.isStruct() && type.containsOpaque(); + return (type.isArray() && intermediate.getFlattenUniformArrays() && topLevel) || + (type.isStruct() && type.containsOpaque()); default: return type.isStruct() && type.containsOpaque(); };