HLSL: Add basic declaration syntax and AST generation.

This commit is contained in:
John Kessenich
2016-03-12 20:24:24 -07:00
parent e01a9bc8c0
commit 87142c71fb
4 changed files with 335 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 6
// Id's are bound by 17
Capability Shader
1: ExtInstImport "GLSL.std.450"
@@ -14,8 +14,24 @@ Linked fragment stage:
ExecutionMode 4 OriginUpperLeft
Source HLSL 100
Name 4 "PixelShaderFunction"
Name 10 "World"
Name 11 "View"
Name 12 "Projection"
Name 14 "AmbientColor"
Name 16 "AmbientIntensity"
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
8: TypeMatrix 7(fvec4) 4
9: TypePointer Function 8
13: TypePointer Function 7(fvec4)
15: TypePointer Function 6(float)
4(PixelShaderFunction): 2 Function None 3
5: Label
10(World): 9(ptr) Variable Function
11(View): 9(ptr) Variable Function
12(Projection): 9(ptr) Variable Function
14(AmbientColor): 13(ptr) Variable Function
16(AmbientIntensity): 15(ptr) Variable Function
FunctionEnd

View File

@@ -1,11 +1,11 @@
//float4x4 World;
//float4x4 View;
//float4x4 Projection;
//
//float4 AmbientColor = float4(1, 1, 1, 1);
//float AmbientIntensity = 0.1;
//
//float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
//{
// return AmbientColor * AmbientIntensity;
//}
float4x4 World;
float4x4 View;
float4x4 Projection;
float4 AmbientColor = float4(1, 1, 1, 1);
float AmbientIntensity = 0.1;
//float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
//{
// return AmbientColor * AmbientIntensity;
//}