Expand implicit argument conversions to also include handling built-in function calls.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26080 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -136,4 +136,5 @@ void foo2()
|
||||
outFunRet(i, f, i, v4);
|
||||
float ret = outFunRet(i, f, i, v4);
|
||||
vec2 ret2 = outFunRet(i, v4, i, v4);
|
||||
bool b = any(lessThan(v4, attv4)); // tests aggregate arg to unary built-in
|
||||
}
|
||||
|
||||
@@ -26,3 +26,9 @@ layout(location=3) in vec4 vl; // ERROR
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location=4) in vec4 vl2;
|
||||
|
||||
void foo()
|
||||
{
|
||||
vec2 r1 = modf(v.xy, v.zw); // ERROR, v.zw not l-value
|
||||
vec2 r2 = modf(o.xy, o.zw);
|
||||
}
|
||||
|
||||
@@ -56,3 +56,9 @@ void foo23()
|
||||
|
||||
patch in vec4 patchIn; // ERROR
|
||||
patch out vec4 patchOut; // ERROR
|
||||
|
||||
void foo24()
|
||||
{
|
||||
dvec3 df, di;
|
||||
df = modf(outp.xyz, di);
|
||||
}
|
||||
@@ -148,7 +148,7 @@ ERROR: node is still EOpNull!
|
||||
0:98 Constant:
|
||||
0:98 0.000000
|
||||
0:100 Constant:
|
||||
0:100 0.000000
|
||||
0:100 0.841471
|
||||
0:101 Function Call: texture2D(s21;vf2; (4-component vector of float)
|
||||
0:101 's2D' (uniform sampler2D)
|
||||
0:101 Constant:
|
||||
@@ -157,16 +157,17 @@ ERROR: node is still EOpNull!
|
||||
0:102 clamp (4-component vector of float)
|
||||
0:102 'attv4' (in 4-component vector of float)
|
||||
0:102 Constant:
|
||||
0:102 0 (const int)
|
||||
0:102 0.000000
|
||||
0:102 Constant:
|
||||
0:102 1 (const int)
|
||||
0:102 1.000000
|
||||
0:103 clamp (4-component vector of float)
|
||||
0:103 Convert float to int (4-component vector of int)
|
||||
0:103 'attv4' (in 4-component vector of float)
|
||||
0:103 Convert int to float (4-component vector of float)
|
||||
0:103 Convert float to int (4-component vector of int)
|
||||
0:103 'attv4' (in 4-component vector of float)
|
||||
0:103 Constant:
|
||||
0:103 0 (const int)
|
||||
0:103 0.000000
|
||||
0:103 Constant:
|
||||
0:103 1 (const int)
|
||||
0:103 1.000000
|
||||
0:106 Constant:
|
||||
0:106 0.000000
|
||||
0:107 Constant:
|
||||
@@ -272,6 +273,13 @@ ERROR: node is still EOpNull!
|
||||
0:138 Convert int to float (4-component vector of float)
|
||||
0:138 'tempArg' (4-component vector of int)
|
||||
0:138 'tempReturn' (2-component vector of int)
|
||||
0:139 Sequence
|
||||
0:139 move second child to first child (bool)
|
||||
0:139 'b' (bool)
|
||||
0:139 any (bool)
|
||||
0:139 Compare Less Than (4-component vector of bool)
|
||||
0:139 'v4' (4-component vector of float)
|
||||
0:139 'attv4' (in 4-component vector of float)
|
||||
0:? Linker Objects
|
||||
0:? 'i' (in 4-component vector of float)
|
||||
0:? 'o' (smooth out 4-component vector of float)
|
||||
|
||||
@@ -5,7 +5,9 @@ ERROR: 0:17: '#error' : GL_ES is not set
|
||||
ERROR: 0:20: 'fragment-shader struct input' : not supported for this version or the enabled extensions
|
||||
ERROR: 0:24: 'location' : not supported for this version or the enabled extensions
|
||||
ERROR: 0:24: 'location qualifier on input' : not supported for this version or the enabled extensions
|
||||
ERROR: 4 compilation errors. No code generated.
|
||||
ERROR: 0:32: 'assign' : l-value required "v" (can't modify shader input)
|
||||
ERROR: 0:32: 'out' : Non-L-value cannot be passed for 'out' or 'inout' parameters.
|
||||
ERROR: 6 compilation errors. No code generated.
|
||||
|
||||
|
||||
ERROR: node is still EOpNull!
|
||||
@@ -24,6 +26,45 @@ ERROR: node is still EOpNull!
|
||||
0:22 'patch' (float)
|
||||
0:22 Constant:
|
||||
0:22 3.100000
|
||||
0:30 Function Definition: foo( (void)
|
||||
0:30 Function Parameters:
|
||||
0:32 Sequence
|
||||
0:32 Sequence
|
||||
0:32 move second child to first child (2-component vector of float)
|
||||
0:32 'r1' (2-component vector of float)
|
||||
0:32 modf (2-component vector of float)
|
||||
0:32 vector swizzle (2-component vector of float)
|
||||
0:32 'v' (smooth in 4-component vector of float)
|
||||
0:32 Sequence
|
||||
0:32 Constant:
|
||||
0:32 0 (const int)
|
||||
0:32 Constant:
|
||||
0:32 1 (const int)
|
||||
0:32 vector swizzle (2-component vector of float)
|
||||
0:32 'v' (smooth in 4-component vector of float)
|
||||
0:32 Sequence
|
||||
0:32 Constant:
|
||||
0:32 2 (const int)
|
||||
0:32 Constant:
|
||||
0:32 3 (const int)
|
||||
0:33 Sequence
|
||||
0:33 move second child to first child (2-component vector of float)
|
||||
0:33 'r2' (2-component vector of float)
|
||||
0:33 modf (2-component vector of float)
|
||||
0:33 vector swizzle (2-component vector of float)
|
||||
0:33 'o' (out 4-component vector of float)
|
||||
0:33 Sequence
|
||||
0:33 Constant:
|
||||
0:33 0 (const int)
|
||||
0:33 Constant:
|
||||
0:33 1 (const int)
|
||||
0:33 vector swizzle (2-component vector of float)
|
||||
0:33 'o' (out 4-component vector of float)
|
||||
0:33 Sequence
|
||||
0:33 Constant:
|
||||
0:33 2 (const int)
|
||||
0:33 Constant:
|
||||
0:33 3 (const int)
|
||||
0:? Linker Objects
|
||||
0:? 'v' (smooth in 4-component vector of float)
|
||||
0:? 'i' (smooth in 4-component vector of float)
|
||||
|
||||
@@ -190,6 +190,31 @@ ERROR: node is still EOpNull!
|
||||
0:54 Constant:
|
||||
0:54 -10 (const int)
|
||||
0:54 20 (const int)
|
||||
0:60 Function Definition: foo24( (void)
|
||||
0:60 Function Parameters:
|
||||
0:? Sequence
|
||||
0:63 move second child to first child (3-component vector of double)
|
||||
0:63 'df' (3-component vector of double)
|
||||
0:63 Convert float to double (3-component vector of double)
|
||||
0:63 Comma (3-component vector of float)
|
||||
0:63 move second child to first child (3-component vector of float)
|
||||
0:63 'tempReturn' (3-component vector of float)
|
||||
0:63 modf (3-component vector of float)
|
||||
0:63 vector swizzle (3-component vector of float)
|
||||
0:63 'outp' (out 4-component vector of float)
|
||||
0:63 Sequence
|
||||
0:63 Constant:
|
||||
0:63 0 (const int)
|
||||
0:63 Constant:
|
||||
0:63 1 (const int)
|
||||
0:63 Constant:
|
||||
0:63 2 (const int)
|
||||
0:63 'tempArg' (3-component vector of float)
|
||||
0:63 move second child to first child (3-component vector of double)
|
||||
0:63 'di' (3-component vector of double)
|
||||
0:63 Convert float to double (3-component vector of double)
|
||||
0:63 'tempArg' (3-component vector of float)
|
||||
0:63 'tempReturn' (3-component vector of float)
|
||||
0:? Linker Objects
|
||||
0:? 'c2D' (smooth in 2-component vector of float)
|
||||
0:? 'i' (flat in int)
|
||||
|
||||
@@ -2,170 +2,192 @@
|
||||
Warning, version 400 is not yet complete; some version-specific features are present, but many are missing.
|
||||
|
||||
0:? Sequence
|
||||
0:3 Function Definition: foo(i1;i1;i1;i1;i1;i1; (int)
|
||||
0:3 Function Parameters:
|
||||
0:3 'a' (in int)
|
||||
0:3 'b' (const (read only) int)
|
||||
0:3 'c' (in int)
|
||||
0:3 'd' (const (read only) int)
|
||||
0:3 'e' (out int)
|
||||
0:3 'f' (inout int)
|
||||
0:5 Sequence
|
||||
0:5 Sequence
|
||||
0:5 move second child to first child (int)
|
||||
0:5 'sum' (int)
|
||||
0:5 add (int)
|
||||
0:5 add (int)
|
||||
0:5 add (int)
|
||||
0:5 add (int)
|
||||
0:5 'a' (in int)
|
||||
0:5 'b' (const (read only) int)
|
||||
0:5 'c' (in int)
|
||||
0:5 'd' (const (read only) int)
|
||||
0:5 'f' (inout int)
|
||||
0:8 multiply second child into first child (int)
|
||||
0:8 'a' (in int)
|
||||
0:8 Constant:
|
||||
0:8 64 (const int)
|
||||
0:5 Function Definition: foo(i1;i1;i1;i1;i1;i1; (int)
|
||||
0:5 Function Parameters:
|
||||
0:5 'a' (in int)
|
||||
0:5 'b' (const (read only) int)
|
||||
0:5 'c' (in int)
|
||||
0:5 'd' (const (read only) int)
|
||||
0:5 'e' (out int)
|
||||
0:5 'f' (inout int)
|
||||
0:7 Sequence
|
||||
0:7 Sequence
|
||||
0:7 move second child to first child (int)
|
||||
0:7 'sum' (int)
|
||||
0:7 add (int)
|
||||
0:7 add (int)
|
||||
0:7 add (int)
|
||||
0:7 add (int)
|
||||
0:7 'a' (in int)
|
||||
0:7 'b' (const (read only) int)
|
||||
0:7 'c' (in int)
|
||||
0:7 'd' (const (read only) int)
|
||||
0:7 'f' (inout int)
|
||||
0:10 multiply second child into first child (int)
|
||||
0:10 'c' (in int)
|
||||
0:10 'a' (in int)
|
||||
0:10 Constant:
|
||||
0:10 64 (const int)
|
||||
0:12 move second child to first child (int)
|
||||
0:12 'e' (out int)
|
||||
0:12 multiply second child into first child (int)
|
||||
0:12 'c' (in int)
|
||||
0:12 Constant:
|
||||
0:12 1024 (const int)
|
||||
0:13 multiply second child into first child (int)
|
||||
0:13 'f' (inout int)
|
||||
0:13 Constant:
|
||||
0:13 64 (const int)
|
||||
0:15 add second child into first child (int)
|
||||
0:15 'sum' (int)
|
||||
0:15 add (int)
|
||||
0:15 add (int)
|
||||
0:15 add (int)
|
||||
0:15 add (int)
|
||||
0:15 add (int)
|
||||
0:15 'a' (in int)
|
||||
0:15 component-wise multiply (int)
|
||||
0:15 Constant:
|
||||
0:15 64 (const int)
|
||||
0:15 'b' (const (read only) int)
|
||||
0:15 'c' (in int)
|
||||
0:15 component-wise multiply (int)
|
||||
0:15 Constant:
|
||||
0:15 64 (const int)
|
||||
0:15 'd' (const (read only) int)
|
||||
0:15 'e' (out int)
|
||||
0:15 'f' (inout int)
|
||||
0:18 Branch: Return with expression
|
||||
0:18 'sum' (int)
|
||||
0:21 Function Definition: foo2(f1;vf3;i1; (int)
|
||||
0:21 Function Parameters:
|
||||
0:21 'a' (in float)
|
||||
0:21 'b' (in 3-component vector of float)
|
||||
0:21 'r' (out int)
|
||||
0:23 Sequence
|
||||
0:23 move second child to first child (int)
|
||||
0:23 'r' (out int)
|
||||
0:23 Convert float to int (int)
|
||||
0:23 component-wise multiply (float)
|
||||
0:23 Constant:
|
||||
0:23 3.000000
|
||||
0:23 'a' (in float)
|
||||
0:24 Branch: Return with expression
|
||||
0:24 Convert float to int (int)
|
||||
0:24 component-wise multiply (float)
|
||||
0:24 Constant:
|
||||
0:24 5.000000
|
||||
0:24 direct index (float)
|
||||
0:24 'b' (in 3-component vector of float)
|
||||
0:24 Constant:
|
||||
0:24 1 (const int)
|
||||
0:27 Function Definition: main( (void)
|
||||
0:27 Function Parameters:
|
||||
0:12 64 (const int)
|
||||
0:14 move second child to first child (int)
|
||||
0:14 'e' (out int)
|
||||
0:14 Constant:
|
||||
0:14 1024 (const int)
|
||||
0:15 multiply second child into first child (int)
|
||||
0:15 'f' (inout int)
|
||||
0:15 Constant:
|
||||
0:15 64 (const int)
|
||||
0:17 add second child into first child (int)
|
||||
0:17 'sum' (int)
|
||||
0:17 add (int)
|
||||
0:17 add (int)
|
||||
0:17 add (int)
|
||||
0:17 add (int)
|
||||
0:17 add (int)
|
||||
0:17 'a' (in int)
|
||||
0:17 component-wise multiply (int)
|
||||
0:17 Constant:
|
||||
0:17 64 (const int)
|
||||
0:17 'b' (const (read only) int)
|
||||
0:17 'c' (in int)
|
||||
0:17 component-wise multiply (int)
|
||||
0:17 Constant:
|
||||
0:17 64 (const int)
|
||||
0:17 'd' (const (read only) int)
|
||||
0:17 'e' (out int)
|
||||
0:17 'f' (inout int)
|
||||
0:20 Branch: Return with expression
|
||||
0:20 'sum' (int)
|
||||
0:23 Function Definition: foo2(f1;vf3;i1; (int)
|
||||
0:23 Function Parameters:
|
||||
0:23 'a' (in float)
|
||||
0:23 'b' (in 3-component vector of float)
|
||||
0:23 'r' (out int)
|
||||
0:25 Sequence
|
||||
0:25 move second child to first child (int)
|
||||
0:25 'r' (out int)
|
||||
0:25 Convert float to int (int)
|
||||
0:25 component-wise multiply (float)
|
||||
0:25 Constant:
|
||||
0:25 3.000000
|
||||
0:25 'a' (in float)
|
||||
0:26 Branch: Return with expression
|
||||
0:26 Convert float to int (int)
|
||||
0:26 component-wise multiply (float)
|
||||
0:26 Constant:
|
||||
0:26 5.000000
|
||||
0:26 direct index (float)
|
||||
0:26 'b' (in 3-component vector of float)
|
||||
0:26 Constant:
|
||||
0:26 1 (const int)
|
||||
0:29 Function Definition: foo3( (int)
|
||||
0:29 Function Parameters:
|
||||
0:31 Sequence
|
||||
0:31 Test condition and select (void)
|
||||
0:31 Condition
|
||||
0:31 Compare Greater Than (bool)
|
||||
0:31 'u' (uniform float)
|
||||
0:31 Constant:
|
||||
0:31 3.200000
|
||||
0:31 true case
|
||||
0:32 Sequence
|
||||
0:32 Branch: Kill
|
||||
0:33 Branch: Return with expression
|
||||
0:33 Constant:
|
||||
0:33 1000000 (const int)
|
||||
0:36 Branch: Return with expression
|
||||
0:36 Constant:
|
||||
0:36 2000000 (const int)
|
||||
0:39 Function Definition: main( (void)
|
||||
0:39 Function Parameters:
|
||||
0:? Sequence
|
||||
0:30 Sequence
|
||||
0:30 move second child to first child (int)
|
||||
0:30 't' (int)
|
||||
0:30 Constant:
|
||||
0:30 2 (const int)
|
||||
0:34 move second child to first child (int)
|
||||
0:34 direct index (int)
|
||||
0:34 t: direct index for structure (4-component vector of int)
|
||||
0:34 'f' (structure{4-component vector of int t})
|
||||
0:34 Constant:
|
||||
0:34 0 (const int)
|
||||
0:34 Constant:
|
||||
0:34 1 (const int)
|
||||
0:34 Constant:
|
||||
0:34 32 (const int)
|
||||
0:37 Sequence
|
||||
0:37 move second child to first child (int)
|
||||
0:37 'color' (int)
|
||||
0:37 Function Call: foo(i1;i1;i1;i1;i1;i1; (int)
|
||||
0:37 Constant:
|
||||
0:37 1 (const int)
|
||||
0:37 Constant:
|
||||
0:37 2 (const int)
|
||||
0:37 add (int)
|
||||
0:37 't' (int)
|
||||
0:37 't' (int)
|
||||
0:37 Constant:
|
||||
0:37 8 (const int)
|
||||
0:37 'e' (int)
|
||||
0:37 direct index (int)
|
||||
0:37 t: direct index for structure (4-component vector of int)
|
||||
0:37 'f' (structure{4-component vector of int t})
|
||||
0:37 Constant:
|
||||
0:37 0 (const int)
|
||||
0:37 Constant:
|
||||
0:37 1 (const int)
|
||||
0:39 add second child into first child (int)
|
||||
0:39 'color' (int)
|
||||
0:39 component-wise multiply (int)
|
||||
0:39 Constant:
|
||||
0:39 128 (const int)
|
||||
0:39 add (int)
|
||||
0:39 'e' (int)
|
||||
0:39 direct index (int)
|
||||
0:39 t: direct index for structure (4-component vector of int)
|
||||
0:39 'f' (structure{4-component vector of int t})
|
||||
0:39 Constant:
|
||||
0:39 0 (const int)
|
||||
0:39 Constant:
|
||||
0:39 1 (const int)
|
||||
0:45 move second child to first child (float)
|
||||
0:45 'ret' (float)
|
||||
0:45 Convert int to float (float)
|
||||
0:45 Comma (int)
|
||||
0:45 move second child to first child (int)
|
||||
0:45 'tempReturn' (int)
|
||||
0:45 Function Call: foo2(f1;vf3;i1; (int)
|
||||
0:45 Constant:
|
||||
0:45 4.000000
|
||||
0:45 Constant:
|
||||
0:45 1.000000
|
||||
0:45 2.000000
|
||||
0:45 3.000000
|
||||
0:45 'tempArg' (int)
|
||||
0:45 move second child to first child (float)
|
||||
0:45 'arg' (float)
|
||||
0:45 Convert int to float (float)
|
||||
0:45 'tempArg' (int)
|
||||
0:45 'tempReturn' (int)
|
||||
0:46 add second child into first child (int)
|
||||
0:46 'color' (int)
|
||||
0:46 Convert float to int (int)
|
||||
0:46 add (float)
|
||||
0:46 'ret' (float)
|
||||
0:46 'arg' (float)
|
||||
0:48 move second child to first child (4-component vector of float)
|
||||
0:48 'gl_FragColor' (fragColor 4-component vector of float)
|
||||
0:48 Construct vec4 (4-component vector of float)
|
||||
0:48 Convert int to float (float)
|
||||
0:48 'color' (int)
|
||||
0:42 Sequence
|
||||
0:42 move second child to first child (int)
|
||||
0:42 't' (int)
|
||||
0:42 Constant:
|
||||
0:42 2 (const int)
|
||||
0:46 move second child to first child (int)
|
||||
0:46 direct index (int)
|
||||
0:46 t: direct index for structure (4-component vector of int)
|
||||
0:46 'f' (structure{4-component vector of int t})
|
||||
0:46 Constant:
|
||||
0:46 0 (const int)
|
||||
0:46 Constant:
|
||||
0:46 1 (const int)
|
||||
0:46 Constant:
|
||||
0:46 32 (const int)
|
||||
0:49 Sequence
|
||||
0:49 move second child to first child (int)
|
||||
0:49 'color' (int)
|
||||
0:49 Function Call: foo(i1;i1;i1;i1;i1;i1; (int)
|
||||
0:49 Constant:
|
||||
0:49 1 (const int)
|
||||
0:49 Constant:
|
||||
0:49 2 (const int)
|
||||
0:49 add (int)
|
||||
0:49 't' (int)
|
||||
0:49 't' (int)
|
||||
0:49 Constant:
|
||||
0:49 8 (const int)
|
||||
0:49 'e' (int)
|
||||
0:49 direct index (int)
|
||||
0:49 t: direct index for structure (4-component vector of int)
|
||||
0:49 'f' (structure{4-component vector of int t})
|
||||
0:49 Constant:
|
||||
0:49 0 (const int)
|
||||
0:49 Constant:
|
||||
0:49 1 (const int)
|
||||
0:51 add second child into first child (int)
|
||||
0:51 'color' (int)
|
||||
0:51 component-wise multiply (int)
|
||||
0:51 Constant:
|
||||
0:51 128 (const int)
|
||||
0:51 add (int)
|
||||
0:51 'e' (int)
|
||||
0:51 direct index (int)
|
||||
0:51 t: direct index for structure (4-component vector of int)
|
||||
0:51 'f' (structure{4-component vector of int t})
|
||||
0:51 Constant:
|
||||
0:51 0 (const int)
|
||||
0:51 Constant:
|
||||
0:51 1 (const int)
|
||||
0:57 move second child to first child (float)
|
||||
0:57 'ret' (float)
|
||||
0:57 Convert int to float (float)
|
||||
0:57 Comma (int)
|
||||
0:57 move second child to first child (int)
|
||||
0:57 'tempReturn' (int)
|
||||
0:57 Function Call: foo2(f1;vf3;i1; (int)
|
||||
0:57 Constant:
|
||||
0:57 4.000000
|
||||
0:57 Constant:
|
||||
0:57 1.000000
|
||||
0:57 2.000000
|
||||
0:57 3.000000
|
||||
0:57 'tempArg' (int)
|
||||
0:57 move second child to first child (float)
|
||||
0:57 'arg' (float)
|
||||
0:57 Convert int to float (float)
|
||||
0:57 'tempArg' (int)
|
||||
0:57 'tempReturn' (int)
|
||||
0:58 add second child into first child (int)
|
||||
0:58 'color' (int)
|
||||
0:58 Convert float to int (int)
|
||||
0:58 add (float)
|
||||
0:58 'ret' (float)
|
||||
0:58 'arg' (float)
|
||||
0:60 add second child into first child (int)
|
||||
0:60 'color' (int)
|
||||
0:60 Function Call: foo3( (int)
|
||||
0:62 move second child to first child (4-component vector of float)
|
||||
0:62 'gl_FragColor' (fragColor 4-component vector of float)
|
||||
0:62 Construct vec4 (4-component vector of float)
|
||||
0:62 Convert int to float (float)
|
||||
0:62 'color' (int)
|
||||
0:? Linker Objects
|
||||
0:? 'u' (uniform float)
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
Reference in New Issue
Block a user