Commit 32a385e9 by John Kessenich

HLSL: Fix #846: support mixed ternary types.

Vector conditions properly convert the true/false expression types to same width vector as the condition. Scalar conditions make the true/false expressions convert to each other.
parent 0603a383
...@@ -5,178 +5,231 @@ gl_FragCoord origin is upper left ...@@ -5,178 +5,231 @@ gl_FragCoord origin is upper left
0:8 Function Definition: vectorCond( ( temp 4-component vector of float) 0:8 Function Definition: vectorCond( ( temp 4-component vector of float)
0:8 Function Parameters: 0:8 Function Parameters:
0:? Sequence 0:? Sequence
0:11 Branch: Return with expression 0:12 Branch: Return with expression
0:10 add ( temp 4-component vector of float) 0:11 add ( temp 4-component vector of float)
0:9 add ( temp 4-component vector of float) 0:10 add ( temp 4-component vector of float)
0:9 mix ( temp 4-component vector of float) 0:9 add ( temp 4-component vector of float)
0:9 f4: direct index for structure ( uniform 4-component vector of float) 0:9 mix ( temp 4-component vector of float)
0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:9 f4: direct index for structure ( uniform 4-component vector of float)
0:9 Constant:
0:9 2 (const uint)
0:9 t4: direct index for structure ( uniform 4-component vector of float)
0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:9 Constant:
0:9 1 (const uint)
0:9 Convert float to bool ( temp 4-component vector of bool)
0:9 c4: direct index for structure ( uniform 4-component vector of float)
0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:9 Constant: 0:9 Constant:
0:9 0 (const uint) 0:9 2 (const uint)
0:10 mix ( temp 4-component vector of float) 0:9 t4: direct index for structure ( uniform 4-component vector of float)
0:10 Construct vec4 ( temp 4-component vector of float) 0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:10 f: direct index for structure ( uniform float) 0:9 Constant:
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:9 1 (const uint)
0:10 Constant: 0:9 Convert float to bool ( temp 4-component vector of bool)
0:10 4 (const uint) 0:9 c4: direct index for structure ( uniform 4-component vector of float)
0:10 Construct vec4 ( temp 4-component vector of float) 0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:10 t: direct index for structure ( uniform float) 0:9 Constant:
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:9 0 (const uint)
0:10 Constant: 0:10 mix ( temp 4-component vector of float)
0:10 3 (const uint) 0:10 Construct vec4 ( temp 4-component vector of float)
0:10 Convert float to bool ( temp 4-component vector of bool) 0:10 f: direct index for structure ( uniform float)
0:10 c4: direct index for structure ( uniform 4-component vector of float) 0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:10 Constant:
0:10 Constant: 0:10 4 (const uint)
0:10 0 (const uint) 0:10 Construct vec4 ( temp 4-component vector of float)
0:11 mix ( temp 4-component vector of float) 0:10 t: direct index for structure ( uniform float)
0:11 f4: direct index for structure ( uniform 4-component vector of float) 0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:10 Constant:
0:11 Constant: 0:10 3 (const uint)
0:11 2 (const uint) 0:10 Convert float to bool ( temp 4-component vector of bool)
0:11 t4: direct index for structure ( uniform 4-component vector of float) 0:10 c4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant: 0:10 Constant:
0:11 1 (const uint) 0:10 0 (const uint)
0:11 Compare Less Than ( temp 4-component vector of bool) 0:11 mix ( temp 4-component vector of float)
0:11 t4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant:
0:11 1 (const uint)
0:11 f4: direct index for structure ( uniform 4-component vector of float) 0:11 f4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant: 0:11 Constant:
0:11 2 (const uint) 0:11 2 (const uint)
0:15 Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float) 0:11 t4: direct index for structure ( uniform 4-component vector of float)
0:15 Function Parameters: 0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:15 'cnd' ( in 2-component vector of bool) 0:11 Constant:
0:15 'src0' ( in 2-component vector of float) 0:11 1 (const uint)
0:15 'src1' ( in 2-component vector of float) 0:11 Compare Less Than ( temp 4-component vector of bool)
0:11 t4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant:
0:11 1 (const uint)
0:11 f4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant:
0:11 2 (const uint)
0:12 mix ( temp 4-component vector of float)
0:12 f4: direct index for structure ( uniform 4-component vector of float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:12 Constant:
0:12 2 (const uint)
0:12 Construct vec4 ( temp 4-component vector of float)
0:12 t: direct index for structure ( uniform float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:12 Constant:
0:12 3 (const uint)
0:12 Convert float to bool ( temp 4-component vector of bool)
0:12 c4: direct index for structure ( uniform 4-component vector of float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:12 Constant:
0:12 0 (const uint)
0:16 Function Definition: scalarCond( ( temp 4-component vector of float)
0:16 Function Parameters:
0:? Sequence 0:? Sequence
0:16 Branch: Return with expression 0:17 Sequence
0:16 mix ( temp 2-component vector of float) 0:17 move second child to first child ( temp 4-component vector of float)
0:16 'src1' ( in 2-component vector of float) 0:17 'ret' ( temp 4-component vector of float)
0:16 'src0' ( in 2-component vector of float) 0:17 Test condition and select ( temp 4-component vector of float)
0:16 'cnd' ( in 2-component vector of bool) 0:17 Condition
0:20 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) 0:17 Compare Not Equal ( temp bool)
0:20 Function Parameters: 0:17 t: direct index for structure ( uniform float)
0:20 'input' ( in 4-component vector of float) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:17 Constant:
0:17 3 (const uint)
0:17 f: direct index for structure ( uniform float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:17 Constant:
0:17 4 (const uint)
0:17 true case
0:17 vector-scale ( temp 4-component vector of float)
0:17 t: direct index for structure ( uniform float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:17 Constant:
0:17 3 (const uint)
0:17 f4: direct index for structure ( uniform 4-component vector of float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:17 Constant:
0:17 2 (const uint)
0:17 false case
0:17 Constant:
0:17 1.000000
0:17 1.000000
0:17 1.000000
0:17 1.000000
0:18 Branch: Return with expression
0:18 'ret' ( temp 4-component vector of float)
0:22 Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
0:22 Function Parameters:
0:22 'cnd' ( in 2-component vector of bool)
0:22 'src0' ( in 2-component vector of float)
0:22 'src1' ( in 2-component vector of float)
0:? Sequence 0:? Sequence
0:21 Sequence 0:23 Branch: Return with expression
0:21 move second child to first child ( temp int) 0:23 mix ( temp 2-component vector of float)
0:21 'a' ( temp int) 0:23 'src1' ( in 2-component vector of float)
0:21 Constant: 0:23 'src0' ( in 2-component vector of float)
0:21 5 (const int) 0:23 'cnd' ( in 2-component vector of bool)
0:22 Sequence 0:27 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
0:22 move second child to first child ( temp int) 0:27 Function Parameters:
0:22 'b' ( temp int) 0:27 'input' ( in 4-component vector of float)
0:22 Constant: 0:? Sequence
0:22 6 (const int) 0:28 Sequence
0:23 Sequence 0:28 move second child to first child ( temp int)
0:23 move second child to first child ( temp int) 0:28 'a' ( temp int)
0:23 'c' ( temp int) 0:28 Constant:
0:23 Constant: 0:28 5 (const int)
0:23 7 (const int) 0:29 Sequence
0:24 Sequence 0:29 move second child to first child ( temp int)
0:24 move second child to first child ( temp int) 0:29 'b' ( temp int)
0:24 'd' ( temp int) 0:29 Constant:
0:24 Constant: 0:29 6 (const int)
0:24 7 (const int) 0:30 Sequence
0:25 Sequence
0:25 move second child to first child ( temp 4-component vector of float)
0:25 'ret' ( temp 4-component vector of float)
0:27 add ( temp 4-component vector of float)
0:26 add ( temp 4-component vector of float)
0:25 add ( temp 4-component vector of float)
0:25 vector-scale ( temp 4-component vector of float)
0:25 Convert int to float ( temp float)
0:25 'a' ( temp int)
0:25 'input' ( in 4-component vector of float)
0:26 vector-scale ( temp 4-component vector of float)
0:26 Convert int to float ( temp float)
0:26 'b' ( temp int)
0:26 'input' ( in 4-component vector of float)
0:27 vector-scale ( temp 4-component vector of float)
0:27 Convert int to float ( temp float)
0:27 'c' ( temp int)
0:27 'input' ( in 4-component vector of float)
0:28 vector-scale ( temp 4-component vector of float)
0:28 Convert int to float ( temp float)
0:28 'd' ( temp int)
0:28 'input' ( in 4-component vector of float)
0:30 Comma ( temp int)
0:30 move second child to first child ( temp int)
0:30 'e' ( temp int)
0:30 move second child to first child ( temp int)
0:30 'a' ( temp int)
0:30 Test condition and select ( temp int)
0:30 Condition
0:30 Convert int to bool ( temp bool)
0:30 'b' ( temp int)
0:30 true case
0:30 move second child to first child ( temp int)
0:30 'c' ( temp int)
0:30 'd' ( temp int)
0:30 false case
0:30 Constant:
0:30 10 (const int)
0:30 move second child to first child ( temp int) 0:30 move second child to first child ( temp int)
0:30 'b' ( temp int) 0:30 'c' ( temp int)
0:30 Test condition and select ( temp int) 0:30 Constant:
0:30 Condition 0:30 7 (const int)
0:30 Convert int to bool ( temp bool) 0:31 Sequence
0:30 'a' ( temp int) 0:31 move second child to first child ( temp int)
0:30 true case 0:31 'd' ( temp int)
0:30 move second child to first child ( temp int) 0:31 Constant:
0:30 'd' ( temp int) 0:31 7 (const int)
0:30 'c' ( temp int) 0:32 Sequence
0:30 false case 0:32 move second child to first child ( temp 4-component vector of float)
0:30 Constant: 0:32 'ret' ( temp 4-component vector of float)
0:30 11 (const int) 0:34 add ( temp 4-component vector of float)
0:32 move second child to first child ( temp 4-component vector of float)
0:32 'f' ( temp 4-component vector of float)
0:32 Test condition and select ( temp 4-component vector of float)
0:32 Condition
0:32 Compare Less Than ( temp bool)
0:32 direct index ( temp float)
0:32 'ret' ( temp 4-component vector of float)
0:32 Constant:
0:32 0 (const int)
0:32 direct index ( temp float)
0:32 'input' ( in 4-component vector of float)
0:32 Constant:
0:32 1 (const int)
0:32 true case
0:32 vector-scale ( temp 4-component vector of float)
0:32 Convert int to float ( temp float)
0:32 'c' ( temp int)
0:32 'input' ( in 4-component vector of float)
0:32 false case
0:32 vector-scale ( temp 4-component vector of float)
0:32 Convert int to float ( temp float)
0:32 'd' ( temp int)
0:32 'input' ( in 4-component vector of float)
0:34 Branch: Return with expression
0:33 add ( temp 4-component vector of float)
0:33 add ( temp 4-component vector of float)
0:33 add ( temp 4-component vector of float) 0:33 add ( temp 4-component vector of float)
0:33 vector-scale ( temp 4-component vector of float) 0:32 add ( temp 4-component vector of float)
0:33 Convert int to float ( temp float) 0:32 vector-scale ( temp 4-component vector of float)
0:33 'e' ( temp int) 0:32 Convert int to float ( temp float)
0:33 'ret' ( temp 4-component vector of float) 0:32 'a' ( temp int)
0:33 'f' ( temp 4-component vector of float) 0:32 'input' ( in 4-component vector of float)
0:33 Function Call: vectorCond( ( temp 4-component vector of float) 0:33 vector-scale ( temp 4-component vector of float)
0:33 Convert int to float ( temp float)
0:33 'b' ( temp int)
0:33 'input' ( in 4-component vector of float)
0:34 vector-scale ( temp 4-component vector of float)
0:34 Convert int to float ( temp float)
0:34 'c' ( temp int)
0:34 'input' ( in 4-component vector of float)
0:35 vector-scale ( temp 4-component vector of float)
0:35 Convert int to float ( temp float)
0:35 'd' ( temp int)
0:35 'input' ( in 4-component vector of float)
0:37 Comma ( temp int)
0:37 move second child to first child ( temp int)
0:37 'e' ( temp int)
0:37 move second child to first child ( temp int)
0:37 'a' ( temp int)
0:37 Test condition and select ( temp int)
0:37 Condition
0:37 Convert int to bool ( temp bool)
0:37 'b' ( temp int)
0:37 true case
0:37 move second child to first child ( temp int)
0:37 'c' ( temp int)
0:37 'd' ( temp int)
0:37 false case
0:37 Constant:
0:37 10 (const int)
0:37 move second child to first child ( temp int)
0:37 'b' ( temp int)
0:37 Test condition and select ( temp int)
0:37 Condition
0:37 Convert int to bool ( temp bool)
0:37 'a' ( temp int)
0:37 true case
0:37 move second child to first child ( temp int)
0:37 'd' ( temp int)
0:37 'c' ( temp int)
0:37 false case
0:37 Constant:
0:37 11 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 'f' ( temp 4-component vector of float)
0:39 Test condition and select ( temp 4-component vector of float)
0:39 Condition
0:39 Compare Less Than ( temp bool)
0:39 direct index ( temp float)
0:39 'ret' ( temp 4-component vector of float)
0:39 Constant:
0:39 0 (const int)
0:39 direct index ( temp float)
0:39 'input' ( in 4-component vector of float)
0:39 Constant:
0:39 1 (const int)
0:39 true case
0:39 vector-scale ( temp 4-component vector of float)
0:39 Convert int to float ( temp float)
0:39 'c' ( temp int)
0:39 'input' ( in 4-component vector of float)
0:39 false case
0:39 vector-scale ( temp 4-component vector of float)
0:39 Convert int to float ( temp float)
0:39 'd' ( temp int)
0:39 'input' ( in 4-component vector of float)
0:41 Branch: Return with expression
0:40 add ( temp 4-component vector of float)
0:40 add ( temp 4-component vector of float)
0:40 add ( temp 4-component vector of float)
0:40 add ( temp 4-component vector of float)
0:40 vector-scale ( temp 4-component vector of float)
0:40 Convert int to float ( temp float)
0:40 'e' ( temp int)
0:40 'ret' ( temp 4-component vector of float)
0:40 'f' ( temp 4-component vector of float)
0:40 Function Call: vectorCond( ( temp 4-component vector of float)
0:40 Function Call: scalarCond( ( temp 4-component vector of float)
0:? Construct vec4 ( temp 4-component vector of float) 0:? Construct vec4 ( temp 4-component vector of float)
0:34 Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float) 0:41 Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
0:? Constant: 0:? Constant:
0:? true (const bool) 0:? true (const bool)
0:? false (const bool) 0:? false (const bool)
...@@ -186,19 +239,19 @@ gl_FragCoord origin is upper left ...@@ -186,19 +239,19 @@ gl_FragCoord origin is upper left
0:? Constant: 0:? Constant:
0:? 3.000000 0:? 3.000000
0:? 4.000000 0:? 4.000000
0:34 Constant: 0:41 Constant:
0:34 10.000000 0:41 10.000000
0:34 Constant: 0:41 Constant:
0:34 10.000000 0:41 10.000000
0:20 Function Definition: PixelShaderFunction( ( temp void) 0:27 Function Definition: PixelShaderFunction( ( temp void)
0:20 Function Parameters: 0:27 Function Parameters:
0:? Sequence 0:? Sequence
0:20 move second child to first child ( temp 4-component vector of float) 0:27 move second child to first child ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float) 0:? 'input' (layout( location=0) in 4-component vector of float)
0:20 move second child to first child ( temp 4-component vector of float) 0:27 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:20 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) 0:27 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float)
0:? Linker Objects 0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
...@@ -215,178 +268,231 @@ gl_FragCoord origin is upper left ...@@ -215,178 +268,231 @@ gl_FragCoord origin is upper left
0:8 Function Definition: vectorCond( ( temp 4-component vector of float) 0:8 Function Definition: vectorCond( ( temp 4-component vector of float)
0:8 Function Parameters: 0:8 Function Parameters:
0:? Sequence 0:? Sequence
0:11 Branch: Return with expression 0:12 Branch: Return with expression
0:10 add ( temp 4-component vector of float) 0:11 add ( temp 4-component vector of float)
0:9 add ( temp 4-component vector of float) 0:10 add ( temp 4-component vector of float)
0:9 mix ( temp 4-component vector of float) 0:9 add ( temp 4-component vector of float)
0:9 f4: direct index for structure ( uniform 4-component vector of float) 0:9 mix ( temp 4-component vector of float)
0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:9 f4: direct index for structure ( uniform 4-component vector of float)
0:9 Constant:
0:9 2 (const uint)
0:9 t4: direct index for structure ( uniform 4-component vector of float)
0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:9 Constant:
0:9 1 (const uint)
0:9 Convert float to bool ( temp 4-component vector of bool)
0:9 c4: direct index for structure ( uniform 4-component vector of float)
0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:9 Constant: 0:9 Constant:
0:9 0 (const uint) 0:9 2 (const uint)
0:10 mix ( temp 4-component vector of float) 0:9 t4: direct index for structure ( uniform 4-component vector of float)
0:10 Construct vec4 ( temp 4-component vector of float) 0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:10 f: direct index for structure ( uniform float) 0:9 Constant:
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:9 1 (const uint)
0:10 Constant: 0:9 Convert float to bool ( temp 4-component vector of bool)
0:10 4 (const uint) 0:9 c4: direct index for structure ( uniform 4-component vector of float)
0:10 Construct vec4 ( temp 4-component vector of float) 0:9 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:10 t: direct index for structure ( uniform float) 0:9 Constant:
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:9 0 (const uint)
0:10 Constant: 0:10 mix ( temp 4-component vector of float)
0:10 3 (const uint) 0:10 Construct vec4 ( temp 4-component vector of float)
0:10 Convert float to bool ( temp 4-component vector of bool) 0:10 f: direct index for structure ( uniform float)
0:10 c4: direct index for structure ( uniform 4-component vector of float) 0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:10 Constant:
0:10 Constant: 0:10 4 (const uint)
0:10 0 (const uint) 0:10 Construct vec4 ( temp 4-component vector of float)
0:11 mix ( temp 4-component vector of float) 0:10 t: direct index for structure ( uniform float)
0:11 f4: direct index for structure ( uniform 4-component vector of float) 0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:10 Constant:
0:11 Constant: 0:10 3 (const uint)
0:11 2 (const uint) 0:10 Convert float to bool ( temp 4-component vector of bool)
0:11 t4: direct index for structure ( uniform 4-component vector of float) 0:10 c4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant: 0:10 Constant:
0:11 1 (const uint) 0:10 0 (const uint)
0:11 Compare Less Than ( temp 4-component vector of bool) 0:11 mix ( temp 4-component vector of float)
0:11 t4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant:
0:11 1 (const uint)
0:11 f4: direct index for structure ( uniform 4-component vector of float) 0:11 f4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant: 0:11 Constant:
0:11 2 (const uint) 0:11 2 (const uint)
0:15 Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float) 0:11 t4: direct index for structure ( uniform 4-component vector of float)
0:15 Function Parameters: 0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:15 'cnd' ( in 2-component vector of bool) 0:11 Constant:
0:15 'src0' ( in 2-component vector of float) 0:11 1 (const uint)
0:15 'src1' ( in 2-component vector of float) 0:11 Compare Less Than ( temp 4-component vector of bool)
0:11 t4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant:
0:11 1 (const uint)
0:11 f4: direct index for structure ( uniform 4-component vector of float)
0:11 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:11 Constant:
0:11 2 (const uint)
0:12 mix ( temp 4-component vector of float)
0:12 f4: direct index for structure ( uniform 4-component vector of float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:12 Constant:
0:12 2 (const uint)
0:12 Construct vec4 ( temp 4-component vector of float)
0:12 t: direct index for structure ( uniform float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:12 Constant:
0:12 3 (const uint)
0:12 Convert float to bool ( temp 4-component vector of bool)
0:12 c4: direct index for structure ( uniform 4-component vector of float)
0:12 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:12 Constant:
0:12 0 (const uint)
0:16 Function Definition: scalarCond( ( temp 4-component vector of float)
0:16 Function Parameters:
0:? Sequence 0:? Sequence
0:16 Branch: Return with expression 0:17 Sequence
0:16 mix ( temp 2-component vector of float) 0:17 move second child to first child ( temp 4-component vector of float)
0:16 'src1' ( in 2-component vector of float) 0:17 'ret' ( temp 4-component vector of float)
0:16 'src0' ( in 2-component vector of float) 0:17 Test condition and select ( temp 4-component vector of float)
0:16 'cnd' ( in 2-component vector of bool) 0:17 Condition
0:20 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float) 0:17 Compare Not Equal ( temp bool)
0:20 Function Parameters: 0:17 t: direct index for structure ( uniform float)
0:20 'input' ( in 4-component vector of float) 0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:17 Constant:
0:17 3 (const uint)
0:17 f: direct index for structure ( uniform float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:17 Constant:
0:17 4 (const uint)
0:17 true case
0:17 vector-scale ( temp 4-component vector of float)
0:17 t: direct index for structure ( uniform float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:17 Constant:
0:17 3 (const uint)
0:17 f4: direct index for structure ( uniform 4-component vector of float)
0:17 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
0:17 Constant:
0:17 2 (const uint)
0:17 false case
0:17 Constant:
0:17 1.000000
0:17 1.000000
0:17 1.000000
0:17 1.000000
0:18 Branch: Return with expression
0:18 'ret' ( temp 4-component vector of float)
0:22 Function Definition: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
0:22 Function Parameters:
0:22 'cnd' ( in 2-component vector of bool)
0:22 'src0' ( in 2-component vector of float)
0:22 'src1' ( in 2-component vector of float)
0:? Sequence 0:? Sequence
0:21 Sequence 0:23 Branch: Return with expression
0:21 move second child to first child ( temp int) 0:23 mix ( temp 2-component vector of float)
0:21 'a' ( temp int) 0:23 'src1' ( in 2-component vector of float)
0:21 Constant: 0:23 'src0' ( in 2-component vector of float)
0:21 5 (const int) 0:23 'cnd' ( in 2-component vector of bool)
0:22 Sequence 0:27 Function Definition: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
0:22 move second child to first child ( temp int) 0:27 Function Parameters:
0:22 'b' ( temp int) 0:27 'input' ( in 4-component vector of float)
0:22 Constant: 0:? Sequence
0:22 6 (const int) 0:28 Sequence
0:23 Sequence 0:28 move second child to first child ( temp int)
0:23 move second child to first child ( temp int) 0:28 'a' ( temp int)
0:23 'c' ( temp int) 0:28 Constant:
0:23 Constant: 0:28 5 (const int)
0:23 7 (const int) 0:29 Sequence
0:24 Sequence 0:29 move second child to first child ( temp int)
0:24 move second child to first child ( temp int) 0:29 'b' ( temp int)
0:24 'd' ( temp int) 0:29 Constant:
0:24 Constant: 0:29 6 (const int)
0:24 7 (const int) 0:30 Sequence
0:25 Sequence
0:25 move second child to first child ( temp 4-component vector of float)
0:25 'ret' ( temp 4-component vector of float)
0:27 add ( temp 4-component vector of float)
0:26 add ( temp 4-component vector of float)
0:25 add ( temp 4-component vector of float)
0:25 vector-scale ( temp 4-component vector of float)
0:25 Convert int to float ( temp float)
0:25 'a' ( temp int)
0:25 'input' ( in 4-component vector of float)
0:26 vector-scale ( temp 4-component vector of float)
0:26 Convert int to float ( temp float)
0:26 'b' ( temp int)
0:26 'input' ( in 4-component vector of float)
0:27 vector-scale ( temp 4-component vector of float)
0:27 Convert int to float ( temp float)
0:27 'c' ( temp int)
0:27 'input' ( in 4-component vector of float)
0:28 vector-scale ( temp 4-component vector of float)
0:28 Convert int to float ( temp float)
0:28 'd' ( temp int)
0:28 'input' ( in 4-component vector of float)
0:30 Comma ( temp int)
0:30 move second child to first child ( temp int)
0:30 'e' ( temp int)
0:30 move second child to first child ( temp int)
0:30 'a' ( temp int)
0:30 Test condition and select ( temp int)
0:30 Condition
0:30 Convert int to bool ( temp bool)
0:30 'b' ( temp int)
0:30 true case
0:30 move second child to first child ( temp int)
0:30 'c' ( temp int)
0:30 'd' ( temp int)
0:30 false case
0:30 Constant:
0:30 10 (const int)
0:30 move second child to first child ( temp int) 0:30 move second child to first child ( temp int)
0:30 'b' ( temp int) 0:30 'c' ( temp int)
0:30 Test condition and select ( temp int) 0:30 Constant:
0:30 Condition 0:30 7 (const int)
0:30 Convert int to bool ( temp bool) 0:31 Sequence
0:30 'a' ( temp int) 0:31 move second child to first child ( temp int)
0:30 true case 0:31 'd' ( temp int)
0:30 move second child to first child ( temp int) 0:31 Constant:
0:30 'd' ( temp int) 0:31 7 (const int)
0:30 'c' ( temp int) 0:32 Sequence
0:30 false case 0:32 move second child to first child ( temp 4-component vector of float)
0:30 Constant: 0:32 'ret' ( temp 4-component vector of float)
0:30 11 (const int) 0:34 add ( temp 4-component vector of float)
0:32 move second child to first child ( temp 4-component vector of float)
0:32 'f' ( temp 4-component vector of float)
0:32 Test condition and select ( temp 4-component vector of float)
0:32 Condition
0:32 Compare Less Than ( temp bool)
0:32 direct index ( temp float)
0:32 'ret' ( temp 4-component vector of float)
0:32 Constant:
0:32 0 (const int)
0:32 direct index ( temp float)
0:32 'input' ( in 4-component vector of float)
0:32 Constant:
0:32 1 (const int)
0:32 true case
0:32 vector-scale ( temp 4-component vector of float)
0:32 Convert int to float ( temp float)
0:32 'c' ( temp int)
0:32 'input' ( in 4-component vector of float)
0:32 false case
0:32 vector-scale ( temp 4-component vector of float)
0:32 Convert int to float ( temp float)
0:32 'd' ( temp int)
0:32 'input' ( in 4-component vector of float)
0:34 Branch: Return with expression
0:33 add ( temp 4-component vector of float)
0:33 add ( temp 4-component vector of float)
0:33 add ( temp 4-component vector of float) 0:33 add ( temp 4-component vector of float)
0:33 vector-scale ( temp 4-component vector of float) 0:32 add ( temp 4-component vector of float)
0:33 Convert int to float ( temp float) 0:32 vector-scale ( temp 4-component vector of float)
0:33 'e' ( temp int) 0:32 Convert int to float ( temp float)
0:33 'ret' ( temp 4-component vector of float) 0:32 'a' ( temp int)
0:33 'f' ( temp 4-component vector of float) 0:32 'input' ( in 4-component vector of float)
0:33 Function Call: vectorCond( ( temp 4-component vector of float) 0:33 vector-scale ( temp 4-component vector of float)
0:33 Convert int to float ( temp float)
0:33 'b' ( temp int)
0:33 'input' ( in 4-component vector of float)
0:34 vector-scale ( temp 4-component vector of float)
0:34 Convert int to float ( temp float)
0:34 'c' ( temp int)
0:34 'input' ( in 4-component vector of float)
0:35 vector-scale ( temp 4-component vector of float)
0:35 Convert int to float ( temp float)
0:35 'd' ( temp int)
0:35 'input' ( in 4-component vector of float)
0:37 Comma ( temp int)
0:37 move second child to first child ( temp int)
0:37 'e' ( temp int)
0:37 move second child to first child ( temp int)
0:37 'a' ( temp int)
0:37 Test condition and select ( temp int)
0:37 Condition
0:37 Convert int to bool ( temp bool)
0:37 'b' ( temp int)
0:37 true case
0:37 move second child to first child ( temp int)
0:37 'c' ( temp int)
0:37 'd' ( temp int)
0:37 false case
0:37 Constant:
0:37 10 (const int)
0:37 move second child to first child ( temp int)
0:37 'b' ( temp int)
0:37 Test condition and select ( temp int)
0:37 Condition
0:37 Convert int to bool ( temp bool)
0:37 'a' ( temp int)
0:37 true case
0:37 move second child to first child ( temp int)
0:37 'd' ( temp int)
0:37 'c' ( temp int)
0:37 false case
0:37 Constant:
0:37 11 (const int)
0:39 move second child to first child ( temp 4-component vector of float)
0:39 'f' ( temp 4-component vector of float)
0:39 Test condition and select ( temp 4-component vector of float)
0:39 Condition
0:39 Compare Less Than ( temp bool)
0:39 direct index ( temp float)
0:39 'ret' ( temp 4-component vector of float)
0:39 Constant:
0:39 0 (const int)
0:39 direct index ( temp float)
0:39 'input' ( in 4-component vector of float)
0:39 Constant:
0:39 1 (const int)
0:39 true case
0:39 vector-scale ( temp 4-component vector of float)
0:39 Convert int to float ( temp float)
0:39 'c' ( temp int)
0:39 'input' ( in 4-component vector of float)
0:39 false case
0:39 vector-scale ( temp 4-component vector of float)
0:39 Convert int to float ( temp float)
0:39 'd' ( temp int)
0:39 'input' ( in 4-component vector of float)
0:41 Branch: Return with expression
0:40 add ( temp 4-component vector of float)
0:40 add ( temp 4-component vector of float)
0:40 add ( temp 4-component vector of float)
0:40 add ( temp 4-component vector of float)
0:40 vector-scale ( temp 4-component vector of float)
0:40 Convert int to float ( temp float)
0:40 'e' ( temp int)
0:40 'ret' ( temp 4-component vector of float)
0:40 'f' ( temp 4-component vector of float)
0:40 Function Call: vectorCond( ( temp 4-component vector of float)
0:40 Function Call: scalarCond( ( temp 4-component vector of float)
0:? Construct vec4 ( temp 4-component vector of float) 0:? Construct vec4 ( temp 4-component vector of float)
0:34 Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float) 0:41 Function Call: fbSelect(vb2;vf2;vf2; ( temp 2-component vector of float)
0:? Constant: 0:? Constant:
0:? true (const bool) 0:? true (const bool)
0:? false (const bool) 0:? false (const bool)
...@@ -396,19 +502,19 @@ gl_FragCoord origin is upper left ...@@ -396,19 +502,19 @@ gl_FragCoord origin is upper left
0:? Constant: 0:? Constant:
0:? 3.000000 0:? 3.000000
0:? 4.000000 0:? 4.000000
0:34 Constant: 0:41 Constant:
0:34 10.000000 0:41 10.000000
0:34 Constant: 0:41 Constant:
0:34 10.000000 0:41 10.000000
0:20 Function Definition: PixelShaderFunction( ( temp void) 0:27 Function Definition: PixelShaderFunction( ( temp void)
0:20 Function Parameters: 0:27 Function Parameters:
0:? Sequence 0:? Sequence
0:20 move second child to first child ( temp 4-component vector of float) 0:27 move second child to first child ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float)
0:? 'input' (layout( location=0) in 4-component vector of float) 0:? 'input' (layout( location=0) in 4-component vector of float)
0:20 move second child to first child ( temp 4-component vector of float) 0:27 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) 0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float)
0:20 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float) 0:27 Function Call: @PixelShaderFunction(vf4; ( temp 4-component vector of float)
0:? 'input' ( temp 4-component vector of float) 0:? 'input' ( temp 4-component vector of float)
0:? Linker Objects 0:? Linker Objects
0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f}) 0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float c4, uniform 4-component vector of float t4, uniform 4-component vector of float f4, uniform float t, uniform float f})
...@@ -417,270 +523,313 @@ gl_FragCoord origin is upper left ...@@ -417,270 +523,313 @@ gl_FragCoord origin is upper left
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 186 // Id's are bound by 220
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction" 179 182 EntryPoint Fragment 4 "PixelShaderFunction" 213 216
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "PixelShaderFunction" Name 4 "PixelShaderFunction"
Name 9 "vectorCond(" Name 9 "vectorCond("
Name 20 "fbSelect(vb2;vf2;vf2;" Name 11 "scalarCond("
Name 17 "cnd" Name 22 "fbSelect(vb2;vf2;vf2;"
Name 18 "src0" Name 19 "cnd"
Name 19 "src1" Name 20 "src0"
Name 25 "@PixelShaderFunction(vf4;" Name 21 "src1"
Name 24 "input" Name 27 "@PixelShaderFunction(vf4;"
Name 27 "$Global" Name 26 "input"
MemberName 27($Global) 0 "c4" Name 29 "$Global"
MemberName 27($Global) 1 "t4" MemberName 29($Global) 0 "c4"
MemberName 27($Global) 2 "f4" MemberName 29($Global) 1 "t4"
MemberName 27($Global) 3 "t" MemberName 29($Global) 2 "f4"
MemberName 27($Global) 4 "f" MemberName 29($Global) 3 "t"
Name 29 "" MemberName 29($Global) 4 "f"
Name 80 "a" Name 31 ""
Name 82 "b" Name 85 "ret"
Name 84 "c" Name 113 "a"
Name 86 "d" Name 115 "b"
Name 87 "ret" Name 117 "c"
Name 107 "e" Name 119 "d"
Name 128 "f" Name 120 "ret"
Name 166 "param" Name 140 "e"
Name 167 "param" Name 161 "f"
Name 168 "param" Name 200 "param"
Name 177 "input" Name 201 "param"
Name 179 "input" Name 202 "param"
Name 182 "@entryPointOutput" Name 211 "input"
Name 183 "param" Name 213 "input"
MemberDecorate 27($Global) 0 Offset 0 Name 216 "@entryPointOutput"
MemberDecorate 27($Global) 1 Offset 16 Name 217 "param"
MemberDecorate 27($Global) 2 Offset 32 MemberDecorate 29($Global) 0 Offset 0
MemberDecorate 27($Global) 3 Offset 48 MemberDecorate 29($Global) 1 Offset 16
MemberDecorate 27($Global) 4 Offset 52 MemberDecorate 29($Global) 2 Offset 32
Decorate 27($Global) Block MemberDecorate 29($Global) 3 Offset 48
Decorate 29 DescriptorSet 0 MemberDecorate 29($Global) 4 Offset 52
Decorate 179(input) Location 0 Decorate 29($Global) Block
Decorate 182(@entryPointOutput) Location 0 Decorate 31 DescriptorSet 0
Decorate 213(input) Location 0
Decorate 216(@entryPointOutput) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
7: TypeVector 6(float) 4 7: TypeVector 6(float) 4
8: TypeFunction 7(fvec4) 8: TypeFunction 7(fvec4)
11: TypeBool 13: TypeBool
12: TypeVector 11(bool) 2 14: TypeVector 13(bool) 2
13: TypePointer Function 12(bvec2) 15: TypePointer Function 14(bvec2)
14: TypeVector 6(float) 2 16: TypeVector 6(float) 2
15: TypePointer Function 14(fvec2) 17: TypePointer Function 16(fvec2)
16: TypeFunction 14(fvec2) 13(ptr) 15(ptr) 15(ptr) 18: TypeFunction 16(fvec2) 15(ptr) 17(ptr) 17(ptr)
22: TypePointer Function 7(fvec4) 24: TypePointer Function 7(fvec4)
23: TypeFunction 7(fvec4) 22(ptr) 25: TypeFunction 7(fvec4) 24(ptr)
27($Global): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) 6(float) 6(float) 29($Global): TypeStruct 7(fvec4) 7(fvec4) 7(fvec4) 6(float) 6(float)
28: TypePointer Uniform 27($Global) 30: TypePointer Uniform 29($Global)
29: 28(ptr) Variable Uniform 31: 30(ptr) Variable Uniform
30: TypeInt 32 1 32: TypeInt 32 1
31: 30(int) Constant 2 33: 32(int) Constant 2
32: TypePointer Uniform 7(fvec4) 34: TypePointer Uniform 7(fvec4)
35: 30(int) Constant 1 37: 32(int) Constant 1
38: 30(int) Constant 0 40: 32(int) Constant 0
41: TypeVector 11(bool) 4 43: TypeVector 13(bool) 4
42: 6(float) Constant 0 44: 6(float) Constant 0
43: 7(fvec4) ConstantComposite 42 42 42 42 45: 7(fvec4) ConstantComposite 44 44 44 44
46: 30(int) Constant 4 48: 32(int) Constant 4
47: TypePointer Uniform 6(float) 49: TypePointer Uniform 6(float)
51: 30(int) Constant 3 53: 32(int) Constant 3
79: TypePointer Function 30(int) 100: 6(float) Constant 1065353216
81: 30(int) Constant 5 101: 7(fvec4) ConstantComposite 100 100 100 100
83: 30(int) Constant 6 112: TypePointer Function 32(int)
85: 30(int) Constant 7 114: 32(int) Constant 5
110: TypeInt 32 0 116: 32(int) Constant 6
111: 110(int) Constant 0 118: 32(int) Constant 7
117: 30(int) Constant 10 143: TypeInt 32 0
126: 30(int) Constant 11 144: 143(int) Constant 0
130: TypePointer Function 6(float) 150: 32(int) Constant 10
133: 110(int) Constant 1 159: 32(int) Constant 11
157: 11(bool) ConstantTrue 163: TypePointer Function 6(float)
158: 11(bool) ConstantFalse 166: 143(int) Constant 1
159: 12(bvec2) ConstantComposite 157 158 192: 13(bool) ConstantTrue
160: 6(float) Constant 1065353216 193: 13(bool) ConstantFalse
161: 6(float) Constant 1073741824 194: 14(bvec2) ConstantComposite 192 193
162: 14(fvec2) ConstantComposite 160 161 195: 6(float) Constant 1073741824
163: 6(float) Constant 1077936128 196: 16(fvec2) ConstantComposite 100 195
164: 6(float) Constant 1082130432 197: 6(float) Constant 1077936128
165: 14(fvec2) ConstantComposite 163 164 198: 6(float) Constant 1082130432
170: 6(float) Constant 1092616192 199: 16(fvec2) ConstantComposite 197 198
178: TypePointer Input 7(fvec4) 204: 6(float) Constant 1092616192
179(input): 178(ptr) Variable Input 212: TypePointer Input 7(fvec4)
181: TypePointer Output 7(fvec4) 213(input): 212(ptr) Variable Input
182(@entryPointOutput): 181(ptr) Variable Output 215: TypePointer Output 7(fvec4)
216(@entryPointOutput): 215(ptr) Variable Output
4(PixelShaderFunction): 2 Function None 3 4(PixelShaderFunction): 2 Function None 3
5: Label 5: Label
177(input): 22(ptr) Variable Function 211(input): 24(ptr) Variable Function
183(param): 22(ptr) Variable Function 217(param): 24(ptr) Variable Function
180: 7(fvec4) Load 179(input) 214: 7(fvec4) Load 213(input)
Store 177(input) 180 Store 211(input) 214
184: 7(fvec4) Load 177(input) 218: 7(fvec4) Load 211(input)
Store 183(param) 184 Store 217(param) 218
185: 7(fvec4) FunctionCall 25(@PixelShaderFunction(vf4;) 183(param) 219: 7(fvec4) FunctionCall 27(@PixelShaderFunction(vf4;) 217(param)
Store 182(@entryPointOutput) 185 Store 216(@entryPointOutput) 219
Return Return
FunctionEnd FunctionEnd
9(vectorCond(): 7(fvec4) Function None 8 9(vectorCond(): 7(fvec4) Function None 8
10: Label 10: Label
33: 32(ptr) AccessChain 29 31 35: 34(ptr) AccessChain 31 33
34: 7(fvec4) Load 33 36: 7(fvec4) Load 35
36: 32(ptr) AccessChain 29 35 38: 34(ptr) AccessChain 31 37
37: 7(fvec4) Load 36 39: 7(fvec4) Load 38
39: 32(ptr) AccessChain 29 38 41: 34(ptr) AccessChain 31 40
40: 7(fvec4) Load 39 42: 7(fvec4) Load 41
44: 41(bvec4) FOrdNotEqual 40 43 46: 43(bvec4) FOrdNotEqual 42 45
45: 7(fvec4) Select 44 37 34 47: 7(fvec4) Select 46 39 36
48: 47(ptr) AccessChain 29 46 50: 49(ptr) AccessChain 31 48
49: 6(float) Load 48 51: 6(float) Load 50
50: 7(fvec4) CompositeConstruct 49 49 49 49 52: 7(fvec4) CompositeConstruct 51 51 51 51
52: 47(ptr) AccessChain 29 51 54: 49(ptr) AccessChain 31 53
53: 6(float) Load 52 55: 6(float) Load 54
54: 7(fvec4) CompositeConstruct 53 53 53 53 56: 7(fvec4) CompositeConstruct 55 55 55 55
55: 32(ptr) AccessChain 29 38 57: 34(ptr) AccessChain 31 40
56: 7(fvec4) Load 55 58: 7(fvec4) Load 57
57: 41(bvec4) FOrdNotEqual 56 43 59: 43(bvec4) FOrdNotEqual 58 45
58: 7(fvec4) Select 57 54 50 60: 7(fvec4) Select 59 56 52
59: 7(fvec4) FAdd 45 58 61: 7(fvec4) FAdd 47 60
60: 32(ptr) AccessChain 29 31 62: 34(ptr) AccessChain 31 33
61: 7(fvec4) Load 60
62: 32(ptr) AccessChain 29 35
63: 7(fvec4) Load 62 63: 7(fvec4) Load 62
64: 32(ptr) AccessChain 29 35 64: 34(ptr) AccessChain 31 37
65: 7(fvec4) Load 64 65: 7(fvec4) Load 64
66: 32(ptr) AccessChain 29 31 66: 34(ptr) AccessChain 31 37
67: 7(fvec4) Load 66 67: 7(fvec4) Load 66
68: 41(bvec4) FOrdLessThan 65 67 68: 34(ptr) AccessChain 31 33
69: 7(fvec4) Select 68 63 61 69: 7(fvec4) Load 68
70: 7(fvec4) FAdd 59 69 70: 43(bvec4) FOrdLessThan 67 69
ReturnValue 70 71: 7(fvec4) Select 70 65 63
72: 7(fvec4) FAdd 61 71
73: 34(ptr) AccessChain 31 33
74: 7(fvec4) Load 73
75: 49(ptr) AccessChain 31 53
76: 6(float) Load 75
77: 7(fvec4) CompositeConstruct 76 76 76 76
78: 34(ptr) AccessChain 31 40
79: 7(fvec4) Load 78
80: 43(bvec4) FOrdNotEqual 79 45
81: 7(fvec4) Select 80 77 74
82: 7(fvec4) FAdd 72 81
ReturnValue 82
FunctionEnd
11(scalarCond(): 7(fvec4) Function None 8
12: Label
85(ret): 24(ptr) Variable Function
86: 24(ptr) Variable Function
87: 49(ptr) AccessChain 31 53
88: 6(float) Load 87
89: 49(ptr) AccessChain 31 48
90: 6(float) Load 89
91: 13(bool) FOrdNotEqual 88 90
SelectionMerge 93 None
BranchConditional 91 92 99
92: Label
94: 49(ptr) AccessChain 31 53
95: 6(float) Load 94
96: 34(ptr) AccessChain 31 33
97: 7(fvec4) Load 96
98: 7(fvec4) VectorTimesScalar 97 95
Store 86 98
Branch 93
99: Label
Store 86 101
Branch 93
93: Label
102: 7(fvec4) Load 86
Store 85(ret) 102
103: 7(fvec4) Load 85(ret)
ReturnValue 103
FunctionEnd FunctionEnd
20(fbSelect(vb2;vf2;vf2;): 14(fvec2) Function None 16 22(fbSelect(vb2;vf2;vf2;): 16(fvec2) Function None 18
17(cnd): 13(ptr) FunctionParameter 19(cnd): 15(ptr) FunctionParameter
18(src0): 15(ptr) FunctionParameter 20(src0): 17(ptr) FunctionParameter
19(src1): 15(ptr) FunctionParameter 21(src1): 17(ptr) FunctionParameter
21: Label 23: Label
73: 14(fvec2) Load 19(src1) 106: 16(fvec2) Load 21(src1)
74: 14(fvec2) Load 18(src0) 107: 16(fvec2) Load 20(src0)
75: 12(bvec2) Load 17(cnd) 108: 14(bvec2) Load 19(cnd)
76: 14(fvec2) Select 75 74 73 109: 16(fvec2) Select 108 107 106
ReturnValue 76 ReturnValue 109
FunctionEnd FunctionEnd
25(@PixelShaderFunction(vf4;): 7(fvec4) Function None 23 27(@PixelShaderFunction(vf4;): 7(fvec4) Function None 25
24(input): 22(ptr) FunctionParameter 26(input): 24(ptr) FunctionParameter
26: Label 28: Label
80(a): 79(ptr) Variable Function 113(a): 112(ptr) Variable Function
82(b): 79(ptr) Variable Function 115(b): 112(ptr) Variable Function
84(c): 79(ptr) Variable Function 117(c): 112(ptr) Variable Function
86(d): 79(ptr) Variable Function 119(d): 112(ptr) Variable Function
87(ret): 22(ptr) Variable Function 120(ret): 24(ptr) Variable Function
107(e): 79(ptr) Variable Function 140(e): 112(ptr) Variable Function
108: 79(ptr) Variable Function 141: 112(ptr) Variable Function
119: 79(ptr) Variable Function 152: 112(ptr) Variable Function
128(f): 22(ptr) Variable Function 161(f): 24(ptr) Variable Function
129: 22(ptr) Variable Function 162: 24(ptr) Variable Function
166(param): 13(ptr) Variable Function 200(param): 15(ptr) Variable Function
167(param): 15(ptr) Variable Function 201(param): 17(ptr) Variable Function
168(param): 15(ptr) Variable Function 202(param): 17(ptr) Variable Function
Store 80(a) 81 Store 113(a) 114
Store 82(b) 83 Store 115(b) 116
Store 84(c) 85 Store 117(c) 118
Store 86(d) 85 Store 119(d) 118
88: 30(int) Load 80(a) 121: 32(int) Load 113(a)
89: 6(float) ConvertSToF 88 122: 6(float) ConvertSToF 121
90: 7(fvec4) Load 24(input) 123: 7(fvec4) Load 26(input)
91: 7(fvec4) VectorTimesScalar 90 89 124: 7(fvec4) VectorTimesScalar 123 122
92: 30(int) Load 82(b) 125: 32(int) Load 115(b)
93: 6(float) ConvertSToF 92 126: 6(float) ConvertSToF 125
94: 7(fvec4) Load 24(input) 127: 7(fvec4) Load 26(input)
95: 7(fvec4) VectorTimesScalar 94 93 128: 7(fvec4) VectorTimesScalar 127 126
96: 7(fvec4) FAdd 91 95 129: 7(fvec4) FAdd 124 128
97: 30(int) Load 84(c) 130: 32(int) Load 117(c)
98: 6(float) ConvertSToF 97 131: 6(float) ConvertSToF 130
99: 7(fvec4) Load 24(input) 132: 7(fvec4) Load 26(input)
100: 7(fvec4) VectorTimesScalar 99 98 133: 7(fvec4) VectorTimesScalar 132 131
101: 7(fvec4) FAdd 96 100 134: 7(fvec4) FAdd 129 133
102: 30(int) Load 86(d) 135: 32(int) Load 119(d)
103: 6(float) ConvertSToF 102 136: 6(float) ConvertSToF 135
104: 7(fvec4) Load 24(input) 137: 7(fvec4) Load 26(input)
105: 7(fvec4) VectorTimesScalar 104 103 138: 7(fvec4) VectorTimesScalar 137 136
106: 7(fvec4) FAdd 101 105 139: 7(fvec4) FAdd 134 138
Store 87(ret) 106 Store 120(ret) 139
109: 30(int) Load 82(b) 142: 32(int) Load 115(b)
112: 11(bool) INotEqual 109 111 145: 13(bool) INotEqual 142 144
SelectionMerge 114 None SelectionMerge 147 None
BranchConditional 112 113 116 BranchConditional 145 146 149
113: Label 146: Label
115: 30(int) Load 86(d) 148: 32(int) Load 119(d)
Store 84(c) 115 Store 117(c) 148
Store 108 115 Store 141 148
Branch 114 Branch 147
116: Label 149: Label
Store 108 117 Store 141 150
Branch 114 Branch 147
114: Label 147: Label
118: 30(int) Load 108 151: 32(int) Load 141
Store 80(a) 118 Store 113(a) 151
Store 107(e) 118 Store 140(e) 151
120: 30(int) Load 80(a) 153: 32(int) Load 113(a)
121: 11(bool) INotEqual 120 111 154: 13(bool) INotEqual 153 144
SelectionMerge 123 None SelectionMerge 156 None
BranchConditional 121 122 125 BranchConditional 154 155 158
122: Label 155: Label
124: 30(int) Load 84(c) 157: 32(int) Load 117(c)
Store 86(d) 124 Store 119(d) 157
Store 119 124 Store 152 157
Branch 123 Branch 156
125: Label 158: Label
Store 119 126 Store 152 159
Branch 123 Branch 156
123: Label 156: Label
127: 30(int) Load 119 160: 32(int) Load 152
Store 82(b) 127 Store 115(b) 160
131: 130(ptr) AccessChain 87(ret) 111 164: 163(ptr) AccessChain 120(ret) 144
132: 6(float) Load 131 165: 6(float) Load 164
134: 130(ptr) AccessChain 24(input) 133 167: 163(ptr) AccessChain 26(input) 166
135: 6(float) Load 134 168: 6(float) Load 167
136: 11(bool) FOrdLessThan 132 135 169: 13(bool) FOrdLessThan 165 168
SelectionMerge 138 None SelectionMerge 171 None
BranchConditional 136 137 143 BranchConditional 169 170 176
137: Label 170: Label
139: 30(int) Load 84(c) 172: 32(int) Load 117(c)
140: 6(float) ConvertSToF 139 173: 6(float) ConvertSToF 172
141: 7(fvec4) Load 24(input) 174: 7(fvec4) Load 26(input)
142: 7(fvec4) VectorTimesScalar 141 140 175: 7(fvec4) VectorTimesScalar 174 173
Store 129 142 Store 162 175
Branch 138 Branch 171
143: Label 176: Label
144: 30(int) Load 86(d) 177: 32(int) Load 119(d)
145: 6(float) ConvertSToF 144 178: 6(float) ConvertSToF 177
146: 7(fvec4) Load 24(input) 179: 7(fvec4) Load 26(input)
147: 7(fvec4) VectorTimesScalar 146 145 180: 7(fvec4) VectorTimesScalar 179 178
Store 129 147 Store 162 180
Branch 138 Branch 171
138: Label 171: Label
148: 7(fvec4) Load 129 181: 7(fvec4) Load 162
Store 128(f) 148 Store 161(f) 181
149: 30(int) Load 107(e) 182: 32(int) Load 140(e)
150: 6(float) ConvertSToF 149 183: 6(float) ConvertSToF 182
151: 7(fvec4) Load 87(ret) 184: 7(fvec4) Load 120(ret)
152: 7(fvec4) VectorTimesScalar 151 150 185: 7(fvec4) VectorTimesScalar 184 183
153: 7(fvec4) Load 128(f) 186: 7(fvec4) Load 161(f)
154: 7(fvec4) FAdd 152 153 187: 7(fvec4) FAdd 185 186
155: 7(fvec4) FunctionCall 9(vectorCond() 188: 7(fvec4) FunctionCall 9(vectorCond()
156: 7(fvec4) FAdd 154 155 189: 7(fvec4) FAdd 187 188
Store 166(param) 159 190: 7(fvec4) FunctionCall 11(scalarCond()
Store 167(param) 162 191: 7(fvec4) FAdd 189 190
Store 168(param) 165 Store 200(param) 194
169: 14(fvec2) FunctionCall 20(fbSelect(vb2;vf2;vf2;) 166(param) 167(param) 168(param) Store 201(param) 196
171: 6(float) CompositeExtract 169 0 Store 202(param) 199
172: 6(float) CompositeExtract 169 1 203: 16(fvec2) FunctionCall 22(fbSelect(vb2;vf2;vf2;) 200(param) 201(param) 202(param)
173: 7(fvec4) CompositeConstruct 171 172 170 170 205: 6(float) CompositeExtract 203 0
174: 7(fvec4) FAdd 156 173 206: 6(float) CompositeExtract 203 1
ReturnValue 174 207: 7(fvec4) CompositeConstruct 205 206 204 204
208: 7(fvec4) FAdd 191 207
ReturnValue 208
FunctionEnd FunctionEnd
...@@ -8,7 +8,14 @@ float4 vectorCond() ...@@ -8,7 +8,14 @@ float4 vectorCond()
{ {
return (c4 ? t4 : f4) + return (c4 ? t4 : f4) +
(c4 ? t : f ) + (c4 ? t : f ) +
(t4 < f4 ? t4 : f4); (t4 < f4 ? t4 : f4) +
(c4 ? t : f4);
}
float4 scalarCond()
{
float4 ret = t != f ? t * f4 : 1;
return ret;
} }
float2 fbSelect(bool2 cnd, float2 src0, float2 src1) float2 fbSelect(bool2 cnd, float2 src0, float2 src1)
...@@ -30,6 +37,6 @@ float4 PixelShaderFunction(float4 input) : COLOR0 ...@@ -30,6 +37,6 @@ float4 PixelShaderFunction(float4 input) : COLOR0
e = a = b ? c = d : 10, b = a ? d = c : 11; e = a = b ? c = d : 10, b = a ? d = c : 11;
float4 f; float4 f;
f = ret.x < input.y ? c * input : d * input; f = ret.x < input.y ? c * input : d * input;
return e * ret + f + vectorCond() + return e * ret + f + vectorCond() + scalarCond() +
float4(fbSelect(bool2(true, false), float2(1.0, 2.0), float2(3.0, 4.0)), 10.0, 10.0); float4(fbSelect(bool2(true, false), float2(1.0, 2.0), float2(3.0, 4.0)), 10.0, 10.0);
} }
...@@ -836,6 +836,9 @@ TIntermTyped* TIntermediate::addUniShapeConversion(TOperator op, const TType& ty ...@@ -836,6 +836,9 @@ TIntermTyped* TIntermediate::addUniShapeConversion(TOperator op, const TType& ty
case EOpAssign: case EOpAssign:
break; break;
case EOpMix:
break;
default: default:
return node; return node;
} }
...@@ -911,6 +914,8 @@ void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, T ...@@ -911,6 +914,8 @@ void TIntermediate::addBiShapeConversion(TOperator op, TIntermTyped*& lhsNode, T
case EOpAnd: case EOpAnd:
case EOpInclusiveOr: case EOpInclusiveOr:
case EOpExclusiveOr: case EOpExclusiveOr:
case EOpMix:
break; break;
default: default:
...@@ -1422,19 +1427,17 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true ...@@ -1422,19 +1427,17 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
return nullptr; return nullptr;
} }
// After conversion, types have to match.
if (falseBlock->getType() != trueBlock->getType())
return nullptr;
// Handle a vector condition as a mix // Handle a vector condition as a mix
if (!cond->getType().isScalarOrVec1()) { if (!cond->getType().isScalarOrVec1()) {
TType targetVectorType(trueBlock->getType().getBasicType(), EvqTemporary, TType targetVectorType(trueBlock->getType().getBasicType(), EvqTemporary,
cond->getType().getVectorSize()); cond->getType().getVectorSize());
// smear true/false operations if needed // smear true/false operands as needed
if (trueBlock->getType().isScalarOrVec1()) trueBlock = addUniShapeConversion(EOpMix, targetVectorType, trueBlock);
trueBlock = addShapeConversion(targetVectorType, trueBlock); falseBlock = addUniShapeConversion(EOpMix, targetVectorType, falseBlock);
if (falseBlock->getType().isScalarOrVec1())
falseBlock = addShapeConversion(targetVectorType, falseBlock); // After conversion, types have to match.
if (falseBlock->getType() != trueBlock->getType())
return nullptr;
// make the mix operation // make the mix operation
TIntermAggregate* mix = makeAggregate(loc); TIntermAggregate* mix = makeAggregate(loc);
...@@ -1449,6 +1452,13 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true ...@@ -1449,6 +1452,13 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true
// Now have a scalar condition... // Now have a scalar condition...
// Convert true and false expressions to matching types
addBiShapeConversion(EOpMix, trueBlock, falseBlock);
// After conversion, types have to match.
if (falseBlock->getType() != trueBlock->getType())
return nullptr;
// Eliminate the selection when the condition is a scalar and all operands are constant. // Eliminate the selection when the condition is a scalar and all operands are constant.
if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) { if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) {
if (cond->getAsConstantUnion()->getConstArray()[0].getBConst()) if (cond->getAsConstantUnion()->getConstArray()[0].getBConst())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment