HLSL: Add all int/float/bool/uint matrix types, void for functions, and a few others.

This commit is contained in:
John Kessenich
2016-06-08 12:50:56 -06:00
parent 5022d681d1
commit 71351de879
8 changed files with 307 additions and 22 deletions

View File

@@ -144,12 +144,12 @@ ERROR: node is still EOpNull!
0:32 Branch: Return with expression
0:32 Constant:
0:32 0.000000
0:44 Function Definition: PixelShaderFunction(vf1;vf1;vf1;i1; (temp 1-component vector of float)
0:44 Function Definition: PixelShaderFunction(vf1;vf1;vf1;vi1; (temp 1-component vector of float)
0:36 Function Parameters:
0:36 'inF0' (temp 1-component vector of float)
0:36 'inF1' (temp 1-component vector of float)
0:36 'inF2' (temp 1-component vector of float)
0:36 'inI0' (temp int)
0:36 'inI0' (temp 1-component vector of int)
0:? Sequence
0:39 Constant:
0:39 0.000000
@@ -448,12 +448,12 @@ ERROR: node is still EOpNull!
0:32 Branch: Return with expression
0:32 Constant:
0:32 0.000000
0:44 Function Definition: PixelShaderFunction(vf1;vf1;vf1;i1; (temp 1-component vector of float)
0:44 Function Definition: PixelShaderFunction(vf1;vf1;vf1;vi1; (temp 1-component vector of float)
0:36 Function Parameters:
0:36 'inF0' (temp 1-component vector of float)
0:36 'inF1' (temp 1-component vector of float)
0:36 'inF2' (temp 1-component vector of float)
0:36 'inI0' (temp int)
0:36 'inI0' (temp 1-component vector of int)
0:? Sequence
0:39 Constant:
0:39 0.000000

View File

@@ -236,12 +236,12 @@ ERROR: node is still EOpNull!
0:46 Branch: Return with expression
0:46 Constant:
0:46 0.000000
0:58 Function Definition: VertexShaderFunction(vf1;vf1;vf1;i1; (temp 1-component vector of float)
0:58 Function Definition: VertexShaderFunction(vf1;vf1;vf1;vi1; (temp 1-component vector of float)
0:50 Function Parameters:
0:50 'inF0' (temp 1-component vector of float)
0:50 'inF1' (temp 1-component vector of float)
0:50 'inF2' (temp 1-component vector of float)
0:50 'inI0' (temp int)
0:50 'inI0' (temp 1-component vector of int)
0:? Sequence
0:53 Constant:
0:53 0.000000
@@ -681,12 +681,12 @@ ERROR: node is still EOpNull!
0:46 Branch: Return with expression
0:46 Constant:
0:46 0.000000
0:58 Function Definition: VertexShaderFunction(vf1;vf1;vf1;i1; (temp 1-component vector of float)
0:58 Function Definition: VertexShaderFunction(vf1;vf1;vf1;vi1; (temp 1-component vector of float)
0:50 Function Parameters:
0:50 'inF0' (temp 1-component vector of float)
0:50 'inF1' (temp 1-component vector of float)
0:50 'inF2' (temp 1-component vector of float)
0:50 'inI0' (temp int)
0:50 'inI0' (temp 1-component vector of int)
0:? Sequence
0:53 Constant:
0:53 0.000000

View File

@@ -0,0 +1,64 @@
hlsl.void.frag
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:2 Function Definition: foo1( (temp void)
0:1 Function Parameters:
0:4 Function Definition: foo2( (temp void)
0:2 Function Parameters:
0:8 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
0:5 Function Parameters:
0:5 'input' (temp 4-component vector of float)
0:? Sequence
0:6 Function Call: foo1( (temp void)
0:7 Function Call: foo2( (temp void)
0:? Linker Objects
Linked fragment stage:
Shader version: 450
gl_FragCoord origin is upper left
0:? Sequence
0:2 Function Definition: foo1( (temp void)
0:1 Function Parameters:
0:4 Function Definition: foo2( (temp void)
0:2 Function Parameters:
0:8 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float)
0:5 Function Parameters:
0:5 'input' (temp 4-component vector of float)
0:? Sequence
0:6 Function Call: foo1( (temp void)
0:7 Function Call: foo2( (temp void)
0:? Linker Objects
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 12
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "PixelShaderFunction"
ExecutionMode 4 OriginUpperLeft
Source HLSL 450
Name 4 "PixelShaderFunction"
Name 6 "foo1("
Name 8 "foo2("
2: TypeVoid
3: TypeFunction 2
4(PixelShaderFunction): 2 Function None 3
5: Label
10: 2 FunctionCall 6(foo1()
11: 2 FunctionCall 8(foo2()
Return
FunctionEnd
6(foo1(): 2 Function None 3
7: Label
Return
FunctionEnd
8(foo2(): 2 Function None 3
9: Label
Return
FunctionEnd

8
Test/hlsl.void.frag Normal file
View File

@@ -0,0 +1,8 @@
void foo1() {}
void foo2(void) {}
float4 PixelShaderFunction(float4 input) : COLOR0
{
foo1();
foo2();
}