HLSL: Hook up constructor expressions through the AST.

This commit is contained in:
John Kessenich
2016-03-13 11:24:20 -06:00
parent 87142c71fb
commit d016be19fb
7 changed files with 139 additions and 29 deletions

View File

@@ -1,8 +1,50 @@
hlsl.frag
Shader version: 100
gl_FragCoord origin is upper left
0:? Sequence
0:5 move second child to first child (temp 4-component vector of float)
0:5 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:6 move second child to first child (temp float)
0:6 'AmbientIntensity' (temp float)
0:6 Constant:
0:6 0.100000
0:? Linker Objects
0:? 'World' (temp 4X4 matrix of float)
0:? 'View' (temp 4X4 matrix of float)
0:? 'Projection' (temp 4X4 matrix of float)
0:? 'AmbientColor' (temp 4-component vector of float)
0:? 'AmbientIntensity' (temp float)
Linked fragment stage:
Shader version: 100
gl_FragCoord origin is upper left
0:? Sequence
0:5 move second child to first child (temp 4-component vector of float)
0:5 'AmbientColor' (temp 4-component vector of float)
0:? Constant:
0:? 1.000000
0:? 0.500000
0:? 0.000000
0:? 1.000000
0:6 move second child to first child (temp float)
0:6 'AmbientIntensity' (temp float)
0:6 Constant:
0:6 0.100000
0:? Linker Objects
0:? 'World' (temp 4X4 matrix of float)
0:? 'View' (temp 4X4 matrix of float)
0:? 'Projection' (temp 4X4 matrix of float)
0:? 'AmbientColor' (temp 4-component vector of float)
0:? 'AmbientIntensity' (temp float)
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 17

View File

@@ -2,7 +2,7 @@ float4x4 World;
float4x4 View;
float4x4 Projection;
float4 AmbientColor = float4(1, 1, 1, 1);
float4 AmbientColor = float4(1, 0.5, 0, 1);
float AmbientIntensity = 0.1;
//float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0

View File

@@ -66,7 +66,7 @@ while read t; do
*)
echo Running HLSL-to-SPIR-V $t...
b=`basename $t`
$EXE -D -e PixelShaderFunction -H $t > $TARGETDIR/$b.out
$EXE -D -e PixelShaderFunction -H -i $t > $TARGETDIR/$b.out
diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1
;;
esac