 28f9b1c28d
			
		
	
	
		28f9b1c28d
		
	
	
	
	
		
			
			Previously if a non-void function implictly returned, a dummy variable was created as return value. Now instead it returns the result of the OpUndef instruction. This better conveys the presence of undefined behavior to SPIR-V consuming tools (and humans). It also saves one ID per occurrence...
		
			
				
	
	
		
			107 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			107 lines
		
	
	
		
			5.0 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| spv.forwardFun.frag
 | |
| 
 | |
| Linked fragment stage:
 | |
| 
 | |
| 
 | |
| // Module Version 99
 | |
| // Generated by (magic number): 51a00bb
 | |
| // Id's are bound by 58
 | |
| 
 | |
|                               Source ESSL 100
 | |
|                               Capability Shader
 | |
|                1:             ExtInstImport  "GLSL.std.450"
 | |
|                               MemoryModel Logical GLSL450
 | |
|                               EntryPoint Fragment 4  "main"
 | |
|                               ExecutionMode 4 OriginLowerLeft
 | |
|                               Name 4  "main"
 | |
|                               Name 7  "bar("
 | |
|                               Name 11  "unreachableReturn("
 | |
|                               Name 17  "foo(vf4;"
 | |
|                               Name 16  "bar"
 | |
|                               Name 19  "color"
 | |
|                               Name 21  "BaseColor"
 | |
|                               Name 22  "param"
 | |
|                               Name 28  "f"
 | |
|                               Name 31  "gl_FragColor"
 | |
|                               Name 37  "d"
 | |
|                               Name 57  "bigColor"
 | |
|                               Decorate 19(color) RelaxedPrecision
 | |
|                               Decorate 21(BaseColor) RelaxedPrecision
 | |
|                               Decorate 21(BaseColor) Smooth
 | |
|                               Decorate 28(f) RelaxedPrecision
 | |
|                               Decorate 31(gl_FragColor) RelaxedPrecision
 | |
|                               Decorate 31(gl_FragColor) BuiltIn FragColor
 | |
|                               Decorate 37(d) RelaxedPrecision
 | |
|                               Decorate 57(bigColor) RelaxedPrecision
 | |
|                               Decorate 57(bigColor) NoStaticUse
 | |
|                2:             TypeVoid
 | |
|                3:             TypeFunction 2
 | |
|                9:             TypeFloat 32
 | |
|               10:             TypeFunction 9(float)
 | |
|               13:             TypeVector 9(float) 4
 | |
|               14:             TypePointer Function 13(fvec4)
 | |
|               15:             TypeFunction 9(float) 14(ptr)
 | |
|               20:             TypePointer Input 13(fvec4)
 | |
|    21(BaseColor):     20(ptr) Variable Input
 | |
|               27:             TypePointer Function 9(float)
 | |
|               30:             TypePointer Output 13(fvec4)
 | |
| 31(gl_FragColor):     30(ptr) Variable Output
 | |
|               36:             TypePointer UniformConstant 9(float)
 | |
|            37(d):     36(ptr) Variable UniformConstant
 | |
|               39:    9(float) Constant 1082549862
 | |
|               40:             TypeBool
 | |
|               44:    9(float) Constant 1067030938
 | |
|               47:    9(float) Constant 1083179008
 | |
|               56:             TypePointer UniformConstant 13(fvec4)
 | |
|     57(bigColor):     56(ptr) Variable UniformConstant
 | |
|          4(main):           2 Function None 3
 | |
|                5:             Label
 | |
|        19(color):     14(ptr) Variable Function
 | |
|        22(param):     14(ptr) Variable Function
 | |
|            28(f):     27(ptr) Variable Function
 | |
|               23:   13(fvec4) Load 21(BaseColor)
 | |
|                               Store 22(param) 23
 | |
|               24:    9(float) FunctionCall 17(foo(vf4;) 22(param)
 | |
|               25:   13(fvec4) CompositeConstruct 24 24 24 24
 | |
|                               Store 19(color) 25
 | |
|               26:           2 FunctionCall 7(bar()
 | |
|               29:    9(float) FunctionCall 11(unreachableReturn()
 | |
|                               Store 28(f) 29
 | |
|               32:   13(fvec4) Load 19(color)
 | |
|               33:    9(float) Load 28(f)
 | |
|               34:   13(fvec4) VectorTimesScalar 32 33
 | |
|                               Store 31(gl_FragColor) 34
 | |
|                               Branch 6
 | |
|                6:             Label
 | |
|                               Return
 | |
|                               FunctionEnd
 | |
|          7(bar():           2 Function None 3
 | |
|                8:             Label
 | |
|                               Return
 | |
|                               FunctionEnd
 | |
| 11(unreachableReturn():    9(float) Function None 10
 | |
|               12:             Label
 | |
|               35:           2 FunctionCall 7(bar()
 | |
|               38:    9(float) Load 37(d)
 | |
|               41:    40(bool) FOrdLessThan 38 39
 | |
|                               SelectionMerge 43 None
 | |
|                               BranchConditional 41 42 46
 | |
|               42:               Label
 | |
|                                 ReturnValue 44
 | |
|               46:               Label
 | |
|                                 ReturnValue 47
 | |
|               43:             Label
 | |
|               49:    9(float) Undef
 | |
|                               ReturnValue 49
 | |
|                               FunctionEnd
 | |
|     17(foo(vf4;):    9(float) Function None 15
 | |
|          16(bar):     14(ptr) FunctionParameter
 | |
|               18:             Label
 | |
|               50:   13(fvec4) Load 16(bar)
 | |
|               51:    9(float) CompositeExtract 50 0
 | |
|               52:   13(fvec4) Load 16(bar)
 | |
|               53:    9(float) CompositeExtract 52 1
 | |
|               54:    9(float) FAdd 51 53
 | |
|                               ReturnValue 54
 | |
|                               FunctionEnd
 |