Use std::variant to represent TSpirvTypeParameter

This PR is try to address the review comment:
https://github.com/KhronosGroup/glslang/pull/3253#discussion_r1254932979.
This commit is contained in:
Rex Xu 2023-09-10 19:27:58 +08:00 committed by arcady-lunarg
parent afe6e781bd
commit 323836e46b
3 changed files with 35 additions and 29 deletions

View file

@ -45,11 +45,11 @@ namespace glslang {
bool TSpirvTypeParameter::operator==(const TSpirvTypeParameter& rhs) const
{
if (constant != nullptr)
return constant->getConstArray() == rhs.constant->getConstArray();
if (getAsConstant() != nullptr)
return getAsConstant()->getConstArray() == rhs.getAsConstant()->getConstArray();
assert(type != nullptr);
return *type == *rhs.type;
assert(getAsType() != nullptr);
return *getAsType() == *rhs.getAsType();
}
//