Skip to content

Commit

Permalink
SPV: Change the key of extBuiltinMap to std::string
Browse files Browse the repository at this point in the history
Using const char* is not a good choice. We assume strings are always
from spv::E_SPV_XXX definitions. However, it is not the case. We can
store the name strings of extended intruction set in local variables.
  • Loading branch information
amdrexu committed Feb 26, 2021
1 parent 51d672b commit 77fe62f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SPIRV/GlslangToSpv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class TGlslangToSpvTraverser : public glslang::TIntermTraverser {
bool nanMinMaxClamp; // true if use NMin/NMax/NClamp instead of FMin/FMax/FClamp
spv::Id stdBuiltins;
spv::Id nonSemanticDebugPrintf;
std::unordered_map<const char*, spv::Id> extBuiltinMap;
std::unordered_map<std::string, spv::Id> extBuiltinMap;

std::unordered_map<long long, spv::Id> symbolValues;
std::unordered_set<long long> rValueParameters; // set of formal function parameters passed as rValues,
Expand Down

0 comments on commit 77fe62f

Please sign in to comment.