HLSL: Add scoping operator, accept static member functions, and support calling them.

This commit is contained in:
John Kessenich
2017-03-11 14:13:00 -07:00
parent 5f12d2f752
commit 54ee28f4d0
11 changed files with 424 additions and 50 deletions

View File

@@ -0,0 +1,22 @@
struct Test
{
float4 memVar;
static float4 staticMemFun(float4 a) : SV_Position
{
return 2 * a;
}
static int staticMemFun(int a) : SV_Position
{
return 2 + a;
}
int i;
};
float4 main() : SV_Target0
{
Test test;
float4 f4 = float4(1.0,1.0,1.0,1.0);
f4 += Test::staticMemFun(float4(5.0f,5.0f,5.0f,5.0f));
f4 += Test::staticMemFun(7);
return f4;
}