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,12 +3,12 @@ Warning, version 450 is not yet complete; most version-specific features are pre
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 20
// Id's are bound by 22
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 15 17
EntryPoint Fragment 4 "main" 17 19
ExecutionMode 4 OriginUpperLeft
2: TypeVoid
3: TypeFunction 2
@@ -17,16 +17,16 @@ Warning, version 450 is not yet complete; most version-specific features are pre
8: TypeFunction 7(fvec3)
11: 6(float) Constant 0
12: 7(fvec3) ConstantComposite 11 11 11
13: TypeVector 6(float) 4
14: TypePointer Output 13(fvec4)
15: 14(ptr) Variable Output
16: TypePointer Input 6(float)
17: 16(ptr) Variable Input
15: TypeVector 6(float) 4
16: TypePointer Output 15(fvec4)
17: 16(ptr) Variable Output
18: TypePointer Input 6(float)
19: 18(ptr) Variable Input
4: 2 Function None 3
5: Label
18: 6(float) Load 17
19: 13(fvec4) CompositeConstruct 18 18 18 18
Store 15 19
20: 6(float) Load 19
21: 15(fvec4) CompositeConstruct 20 20 20 20
Store 17 21
Return
FunctionEnd
9: 7(fvec3) Function None 8