Structured control-flow rules allow leaving the middle of a construct through a return, but not through a jump to a block that does a return. Addresses issue #58.
		
			
				
	
	
		
			62 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
spv.whileLoop.frag
 | 
						|
 | 
						|
Linked fragment stage:
 | 
						|
 | 
						|
 | 
						|
// Module Version 99
 | 
						|
// Generated by (magic number): 51a00bb
 | 
						|
// Id's are bound by 31
 | 
						|
 | 
						|
                              Source GLSL 110
 | 
						|
                              Capability Shader
 | 
						|
               1:             ExtInstImport  "GLSL.std.450"
 | 
						|
                              MemoryModel Logical GLSL450
 | 
						|
                              EntryPoint Fragment 4  "main"
 | 
						|
                              ExecutionMode 4 OriginLowerLeft
 | 
						|
                              Name 4  "main"
 | 
						|
                              Name 9  "color"
 | 
						|
                              Name 11  "BaseColor"
 | 
						|
                              Name 19  "d"
 | 
						|
                              Name 24  "bigColor"
 | 
						|
                              Name 29  "gl_FragColor"
 | 
						|
                              Decorate 11(BaseColor) Smooth
 | 
						|
                              Decorate 29(gl_FragColor) BuiltIn FragColor
 | 
						|
               2:             TypeVoid
 | 
						|
               3:             TypeFunction 2
 | 
						|
               6:             TypeFloat 32
 | 
						|
               7:             TypeVector 6(float) 4
 | 
						|
               8:             TypePointer Function 7(fvec4)
 | 
						|
              10:             TypePointer Input 7(fvec4)
 | 
						|
   11(BaseColor):     10(ptr) Variable Input
 | 
						|
              18:             TypePointer UniformConstant 6(float)
 | 
						|
           19(d):     18(ptr) Variable UniformConstant
 | 
						|
              21:             TypeBool
 | 
						|
              23:             TypePointer UniformConstant 7(fvec4)
 | 
						|
    24(bigColor):     23(ptr) Variable UniformConstant
 | 
						|
              28:             TypePointer Output 7(fvec4)
 | 
						|
29(gl_FragColor):     28(ptr) Variable Output
 | 
						|
         4(main):           2 Function None 3
 | 
						|
               5:             Label
 | 
						|
        9(color):      8(ptr) Variable Function
 | 
						|
              12:    7(fvec4) Load 11(BaseColor)
 | 
						|
                              Store 9(color) 12
 | 
						|
                              Branch 13
 | 
						|
              13:             Label
 | 
						|
              16:    7(fvec4) Load 9(color)
 | 
						|
              17:    6(float) CompositeExtract 16 0
 | 
						|
              20:    6(float) Load 19(d)
 | 
						|
              22:    21(bool) FOrdLessThan 17 20
 | 
						|
                              LoopMerge 14 None
 | 
						|
                              BranchConditional 22 15 14
 | 
						|
              15:               Label
 | 
						|
              25:    7(fvec4)   Load 24(bigColor)
 | 
						|
              26:    7(fvec4)   Load 9(color)
 | 
						|
              27:    7(fvec4)   FAdd 26 25
 | 
						|
                                Store 9(color) 27
 | 
						|
                                Branch 13
 | 
						|
              14:             Label
 | 
						|
              30:    7(fvec4) Load 9(color)
 | 
						|
                              Store 29(gl_FragColor) 30
 | 
						|
                              Return
 | 
						|
                              FunctionEnd
 |