From 12d693682f8a5080c2b4a9347dfdaea66e7b4de7 Mon Sep 17 00:00:00 2001 From: John Kessenich <cepheus@frii.com> Date: Tue, 9 May 2017 23:30:56 -0600 Subject: [PATCH] Build fix: Make string assignment simpler to avoid some compiler issues. Included changing related parameters to const. Should fix complaints with previous commit. See issue #879. --- glslang/MachineIndependent/Initialize.cpp | 14 +++++++------- glslang/MachineIndependent/Initialize.h | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index af5ee05f7..0dbd9e31a 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -3851,8 +3851,8 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c // samplerBuffer and textureBuffer types. sampler.setTexture(sampler.type, sampler.dim, sampler.arrayed, sampler.shadow, sampler.ms); - typeName = sampler.getString(); - addSamplingFunctions(sampler, typeName, version, profile); + TString textureTypeName = sampler.getString(); + addSamplingFunctions(sampler, textureTypeName, version, profile); } } } @@ -3877,7 +3877,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c // // Add all the query functions for the given type. // -void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) +void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) { if (sampler.image && ((profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 430))) return; @@ -3954,7 +3954,7 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, TString& typeName, int versi // // Add all the image access functions for the given type. // -void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) +void TBuiltIns::addImageFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) { int dims = dimMap[sampler.dim]; // most things with an array add a dimension, except for cubemaps @@ -4047,7 +4047,7 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi // // Add all the subpass access functions for the given type. // -void TBuiltIns::addSubpassSampling(TSampler sampler, TString& typeName, int /*version*/, EProfile /*profile*/) +void TBuiltIns::addSubpassSampling(TSampler sampler, const TString& typeName, int /*version*/, EProfile /*profile*/) { stageBuiltins[EShLangFragment].append(prefixes[sampler.type]); stageBuiltins[EShLangFragment].append("vec4 subpassLoad"); @@ -4064,7 +4064,7 @@ void TBuiltIns::addSubpassSampling(TSampler sampler, TString& typeName, int /*ve // // Add all the texture lookup functions for the given type. // -void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) +void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) { // // texturing @@ -4294,7 +4294,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int ve // // Add all the texture gather functions for the given type. // -void TBuiltIns::addGatherFunctions(TSampler sampler, TString& typeName, int version, EProfile profile) +void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile) { switch (sampler.dim) { case Esd2D: diff --git a/glslang/MachineIndependent/Initialize.h b/glslang/MachineIndependent/Initialize.h index 45b439562..6b54c4da6 100644 --- a/glslang/MachineIndependent/Initialize.h +++ b/glslang/MachineIndependent/Initialize.h @@ -94,11 +94,11 @@ public: protected: void add2ndGenerationSamplingImaging(int version, EProfile profile, const SpvVersion& spvVersion); - void addSubpassSampling(TSampler, TString& typeName, int version, EProfile profile); - void addQueryFunctions(TSampler, TString& typeName, int version, EProfile profile); - void addImageFunctions(TSampler, TString& typeName, int version, EProfile profile); - void addSamplingFunctions(TSampler, TString& typeName, int version, EProfile profile); - void addGatherFunctions(TSampler, TString& typeName, int version, EProfile profile); + void addSubpassSampling(TSampler, const TString& typeName, int version, EProfile profile); + void addQueryFunctions(TSampler, const TString& typeName, int version, EProfile profile); + void addImageFunctions(TSampler, const TString& typeName, int version, EProfile profile); + void addSamplingFunctions(TSampler, const TString& typeName, int version, EProfile profile); + void addGatherFunctions(TSampler, const TString& typeName, int version, EProfile profile); // Helpers for making textual representations of the permutations // of texturing/imaging functions. -- GitLab