Reimplement the DecorationManager
This reimplementation fixes several issues when removing decorations associated to an ID (partially addresses #1174 and gives tools for fixing #898), as well as making it easier to remove groups; a few additional tests have been added. DecorationManager::RemoveDecoration() will still not delete dead decorations it created, but I do not think it is its job either; given the following input ``` OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 OpDecorate %2 Restrict %2 = OpDecorationGroup OpGroupDecorate %2 %1 %3 OpDecorate %4 Invariant %4 = OpDecorationGroup OpGroupDecorate %4 %2 %uint = OpTypeInt 32 0 %1 = OpVariable %uint Uniform %3 = OpVariable %uint Uniform ``` which of the following two outputs would you expect RemoveDecoration(2) to produce: ``` OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 %uint = OpTypeInt 32 0 %1 = OpVariable %uint Uniform %3 = OpVariable %uint Uniform ``` or ``` OpCapability Shader OpCapability Linkage OpMemoryModel Logical GLSL450 OpDecorate %4 Invariant %4 = OpDecorationGroup %uint = OpTypeInt 32 0 %1 = OpVariable %uint Uniform %3 = OpVariable %uint Uniform ``` Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/924 Fixes https://github.com/KhronosGroup/SPIRV-Tools/issues/1174
Loading
Please register or sign in to comment