diff options
author | Sebastián Aedo <saedo@codeweavers.com> | 2021-11-03 22:12:14 +0300 |
---|---|---|
committer | Sebastián Aedo <saedo@codeweavers.com> | 2021-11-03 22:12:14 +0300 |
commit | 250a02967dda824d383313c2c88212b94c404849 (patch) | |
tree | 44681094ace1d3d2739763caf70ffc70676c4a2c /spirv_cross_parsed_ir.hpp | |
parent | f099d714f3cfb30660906ed8196a643f06f882bc (diff) |
Removed unnecessary tracking of types.
We don't need to keep track of the type itself, only its width since the
type check of the OpSwitch can be done at runtime. This also avoids
creating a dangling reference.
Signed-off-by: Sebastián Aedo <saedo@codeweavers.com>
Diffstat (limited to 'spirv_cross_parsed_ir.hpp')
-rw-r--r-- | spirv_cross_parsed_ir.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spirv_cross_parsed_ir.hpp b/spirv_cross_parsed_ir.hpp index 168c70f2..138d9dd4 100644 --- a/spirv_cross_parsed_ir.hpp +++ b/spirv_cross_parsed_ir.hpp @@ -78,11 +78,12 @@ public: SmallVector<ID> ids_for_constant_or_type; SmallVector<ID> ids_for_constant_or_variable; - // We need to keep track of all the Ops that contains a type for the + // We need to keep track of the width the Ops that contains a type for the // OpSwitch instruction, since this one doesn't contains the type in the // instruction itself. And in some case we need to cast the condition to - // wider types. - std::unordered_map<ID, const SPIRType&> load_types; + // wider types. We only need the width to do the branch fixup since the + // type check itself can be done at runtime + std::unordered_map<ID, uint32_t> load_type_width; // Declared capabilities and extensions in the SPIR-V module. // Not really used except for reflection at the moment. |