Don't remove SPIR-V blocks before codegen.
A removed block releases its instructions, so Module::idToInstruction suddenly contains dangling references. The original motivation for block removal was to skip some unreachable blocks, but that's already achieved by InReadableOrder.cpp. Also updated stale comments.
This commit is contained in:
@@ -7,20 +7,20 @@ Linked fragment stage:
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 22
|
||||
// Id's are bound by 23
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 12 16
|
||||
EntryPoint Fragment 4 "main" 12 17
|
||||
ExecutionMode 4 OriginLowerLeft
|
||||
Source GLSL 150
|
||||
Name 4 "main"
|
||||
Name 9 "foo("
|
||||
Name 12 "BaseColor"
|
||||
Name 16 "gl_FragColor"
|
||||
Name 19 "bigColor"
|
||||
Name 21 "d"
|
||||
Name 17 "gl_FragColor"
|
||||
Name 20 "bigColor"
|
||||
Name 22 "d"
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
@@ -28,16 +28,16 @@ Linked fragment stage:
|
||||
8: TypeFunction 7(fvec4)
|
||||
11: TypePointer Input 7(fvec4)
|
||||
12(BaseColor): 11(ptr) Variable Input
|
||||
15: TypePointer Output 7(fvec4)
|
||||
16(gl_FragColor): 15(ptr) Variable Output
|
||||
18: TypePointer UniformConstant 7(fvec4)
|
||||
19(bigColor): 18(ptr) Variable UniformConstant
|
||||
20: TypePointer UniformConstant 6(float)
|
||||
21(d): 20(ptr) Variable UniformConstant
|
||||
16: TypePointer Output 7(fvec4)
|
||||
17(gl_FragColor): 16(ptr) Variable Output
|
||||
19: TypePointer UniformConstant 7(fvec4)
|
||||
20(bigColor): 19(ptr) Variable UniformConstant
|
||||
21: TypePointer UniformConstant 6(float)
|
||||
22(d): 21(ptr) Variable UniformConstant
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
17: 7(fvec4) FunctionCall 9(foo()
|
||||
Store 16(gl_FragColor) 17
|
||||
18: 7(fvec4) FunctionCall 9(foo()
|
||||
Store 17(gl_FragColor) 18
|
||||
Return
|
||||
FunctionEnd
|
||||
9(foo(): 7(fvec4) Function None 8
|
||||
|
||||
Reference in New Issue
Block a user