From 079e0e058eec46c9d1e9b1e978416be88cdff5ec Mon Sep 17 00:00:00 2001 From: DrChat Date: Sat, 23 Dec 2017 17:28:20 -0600 Subject: [PATCH] Glslang swizzle vectors should be const --- third_party/glslang-spirv/SpvBuilder.cpp | 4 ++-- third_party/glslang-spirv/SpvBuilder.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/third_party/glslang-spirv/SpvBuilder.cpp b/third_party/glslang-spirv/SpvBuilder.cpp index 36bededc5..ba8ab9e95 100644 --- a/third_party/glslang-spirv/SpvBuilder.cpp +++ b/third_party/glslang-spirv/SpvBuilder.cpp @@ -1222,7 +1222,7 @@ Id Builder::createFunctionCall(spv::Function* function, const std::vector& channels) +Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, const std::vector& channels) { if (channels.size() == 1) return setPrecision(createCompositeExtract(source, typeId, channels.front()), precision); @@ -1239,7 +1239,7 @@ Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, std: } // Comments in header -Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, std::vector& channels) +Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vector& channels) { assert(getNumComponents(source) == (int)channels.size()); if (channels.size() == 1 && getNumComponents(source) == 1) diff --git a/third_party/glslang-spirv/SpvBuilder.h b/third_party/glslang-spirv/SpvBuilder.h index 28f846578..c3c316de0 100644 --- a/third_party/glslang-spirv/SpvBuilder.h +++ b/third_party/glslang-spirv/SpvBuilder.h @@ -267,13 +267,13 @@ public: // Take an rvalue (source) and a set of channels to extract from it to // make a new rvalue, which is returned. - Id createRvalueSwizzle(Decoration precision, Id typeId, Id source, std::vector& channels); + Id createRvalueSwizzle(Decoration precision, Id typeId, Id source, const std::vector& channels); // Take a copy of an lvalue (target) and a source of components, and set the // source components into the lvalue where the 'channels' say to put them. // An updated version of the target is returned. // (No true lvalue or stores are used.) - Id createLvalueSwizzle(Id typeId, Id target, Id source, std::vector& channels); + Id createLvalueSwizzle(Id typeId, Id target, Id source, const std::vector& channels); // If both the id and precision are valid, the id // gets tagged with the requested precision.