Remapper: remove debug info for IDs stripped in other passes

If some DCE is performed such as removing dead functions, then even
if we are NOT stripping debug info, we still must remove the debug
opcodes that refer to the now-dead IDs.

Also, this adds a small change to perform no ID remapping if none
is requested, making spirv-remap properly be a no-op if no options
are given.
This commit is contained in:
steve-lunarg
2016-12-09 11:13:23 -07:00
parent 906cc21816
commit 297754cfe8
11 changed files with 246 additions and 219 deletions

View File

@@ -3,7 +3,7 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 190
// Id's are bound by 191
Capability Shader
Capability Sampled1D
@@ -57,9 +57,9 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented
Name 173 "psout"
Name 180 "Color"
Name 184 "Depth"
Name 187 "g_sSamp2d"
Name 188 "g_sSamp2D_b"
Name 189 "g_tTex1df4a"
Name 188 "g_sSamp2d"
Name 189 "g_sSamp2D_b"
Name 190 "g_tTex1df4a"
Decorate 41(g_tTex1df4) DescriptorSet 0
Decorate 41(g_tTex1df4) Binding 0
Decorate 45(g_sSamp) DescriptorSet 0
@@ -77,10 +77,10 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented
Decorate 165(g_tTexcdu4) DescriptorSet 0
Decorate 180(Color) Location 0
Decorate 184(Depth) BuiltIn FragDepth
Decorate 187(g_sSamp2d) DescriptorSet 0
Decorate 188(g_sSamp2D_b) DescriptorSet 0
Decorate 189(g_tTex1df4a) DescriptorSet 0
Decorate 189(g_tTex1df4a) Binding 1
Decorate 188(g_sSamp2d) DescriptorSet 0
Decorate 189(g_sSamp2D_b) DescriptorSet 0
Decorate 190(g_tTex1df4a) DescriptorSet 0
Decorate 190(g_tTex1df4a) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@@ -184,9 +184,9 @@ WARNING: 0:4: 'immediate sampler state' : unimplemented
180(Color): 179(ptr) Variable Output
183: TypePointer Output 35(float)
184(Depth): 183(ptr) Variable Output
187(g_sSamp2d): 44(ptr) Variable UniformConstant
188(g_sSamp2D_b): 44(ptr) Variable UniformConstant
189(g_tTex1df4a): 40(ptr) Variable UniformConstant
188(g_sSamp2d): 44(ptr) Variable UniformConstant
189(g_sSamp2D_b): 44(ptr) Variable UniformConstant
190(g_tTex1df4a): 40(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(mtest): 8(ptr) Variable Function