SPV: Debug output: Include OpLine information for execution path.

Note that declaratives are not handled, only procedurals.
This commit is contained in:
John Kessenich
2017-05-31 18:50:53 -06:00
parent 121853f4df
commit e485c7af58
5 changed files with 310 additions and 70 deletions

View File

@@ -8,15 +8,45 @@ uniform ubuf {
S s;
};
uniform sampler2D s2d;
layout(location = 0) in vec4 inv;
layout(location = 0) out vec4 outv;
void foo(S s)
vec4 foo(S s)
{
outv = s.a * inv;
vec4 r = s.a * inv;
++r;
if (r.x > 3.0)
--r;
else
r *= 2;
return r;
}
void main()
{
foo(s);
outv = foo(s);
outv += texture(s2d, vec2(0.5));
switch (s.a) {
case 10:
++outv;
break;
case 20:
outv = 2 * outv;
++outv;
break;
default:
--outv;
break;
}
for (int i = 0; i < 10; ++i)
outv *= 3.0;
outv.x < 10.0 ?
outv = sin(outv) :
outv = cos(outv);
}