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

@ -1,13 +1,13 @@
remap.hlsl.templatetypes.none.frag
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 149
// Id's are bound by 150
Capability Shader
Capability Float64
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 146 148
EntryPoint Fragment 4 "main" 146 149
ExecutionMode 4 OriginUpperLeft
Name 4 "main"
Name 9 "r00"
@ -39,9 +39,9 @@ remap.hlsl.templatetypes.none.frag
Name 136 "r65"
Name 141 "r66"
Name 146 "@entryPointOutput"
Name 148 "input"
Name 149 "input"
Decorate 146(@entryPointOutput) Location 0
Decorate 148(input) Location 0
Decorate 149(input) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -157,8 +157,8 @@ remap.hlsl.templatetypes.none.frag
144: 139 ConstantComposite 72 126 142 143
145: TypePointer Output 6(float)
146(@entryPointOutput): 145(ptr) Variable Output
147: TypePointer Input 7(fvec4)
148(input): 147(ptr) Variable Input
148: TypePointer Input 7(fvec4)
149(input): 148(ptr) Variable Input
4(main): 2 Function None 3
5: Label
9(r00): 8(ptr) Variable Function