init commit
This commit is contained in:
5
test/codegen/assign_arithmetic_expression.golden
Normal file
5
test/codegen/assign_arithmetic_expression.golden
Normal file
@@ -0,0 +1,5 @@
|
||||
void vs_main()
|
||||
{
|
||||
float x = 2.0f + 5.0f;
|
||||
}
|
||||
|
||||
15
test/codegen/basic_property_and_return_value.golden
Normal file
15
test/codegen/basic_property_and_return_value.golden
Normal file
@@ -0,0 +1,15 @@
|
||||
cbuffer __PROPERTIES : register(b0)
|
||||
{
|
||||
float4 color;
|
||||
}
|
||||
|
||||
float3 vs_main(float3 pos : POSITION) : SV_POSITION
|
||||
{
|
||||
return pos;
|
||||
}
|
||||
|
||||
float4 ps_main() : SV_TARGET
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
7
test/codegen/complicated_computation.golden
Normal file
7
test/codegen/complicated_computation.golden
Normal file
@@ -0,0 +1,7 @@
|
||||
void vs_main()
|
||||
{
|
||||
float x = 5.0f;
|
||||
float y = 3000.0f;
|
||||
float z = y * y + x;
|
||||
}
|
||||
|
||||
4
test/codegen/empty_struct.golden
Normal file
4
test/codegen/empty_struct.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
struct Foo;
|
||||
|
||||
struct Foo {}
|
||||
|
||||
4
test/codegen/empty_vertex_main.golden
Normal file
4
test/codegen/empty_vertex_main.golden
Normal file
@@ -0,0 +1,4 @@
|
||||
void vs_main()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
float3 vs_main(float3 pos : POSITION)
|
||||
{
|
||||
return pos;
|
||||
}
|
||||
|
||||
7
test/codegen/field_assignment.golden
Normal file
7
test/codegen/field_assignment.golden
Normal file
@@ -0,0 +1,7 @@
|
||||
float4 vs_main(float4 pos : POSITION) : SV_POSITION
|
||||
{
|
||||
float x = 5.0f;
|
||||
x = 7.0f;
|
||||
return pos;
|
||||
}
|
||||
|
||||
12
test/codegen/function_call.golden
Normal file
12
test/codegen/function_call.golden
Normal file
@@ -0,0 +1,12 @@
|
||||
int foo();
|
||||
|
||||
int foo()
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
void vs_main()
|
||||
{
|
||||
foo();
|
||||
}
|
||||
|
||||
11
test/codegen/function_call_out_of_order_declaration.golden
Normal file
11
test/codegen/function_call_out_of_order_declaration.golden
Normal file
@@ -0,0 +1,11 @@
|
||||
void foo();
|
||||
|
||||
void vs_main()
|
||||
{
|
||||
foo();
|
||||
}
|
||||
|
||||
void foo()
|
||||
{
|
||||
}
|
||||
|
||||
9
test/codegen/function_call_return.golden
Normal file
9
test/codegen/function_call_return.golden
Normal file
@@ -0,0 +1,9 @@
|
||||
void vs_main()
|
||||
{
|
||||
}
|
||||
|
||||
float4 ps_main() : SV_TARGET
|
||||
{
|
||||
return float4(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
15
test/codegen/meta_block.golden
Normal file
15
test/codegen/meta_block.golden
Normal file
@@ -0,0 +1,15 @@
|
||||
cbuffer __PROPERTIES : register(b0)
|
||||
{
|
||||
float4 color;
|
||||
}
|
||||
|
||||
float3 vs_main(float3 pos : POSITION, float2 uv) : SV_POSITION
|
||||
{
|
||||
return pos;
|
||||
}
|
||||
|
||||
float4 ps_main() : SV_TARGET
|
||||
{
|
||||
return color;
|
||||
}
|
||||
|
||||
19
test/codegen/multiple_functions.golden
Normal file
19
test/codegen/multiple_functions.golden
Normal file
@@ -0,0 +1,19 @@
|
||||
int foo();
|
||||
float bar();
|
||||
|
||||
int foo()
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
||||
float bar()
|
||||
{
|
||||
return 1235.0f * 500;
|
||||
}
|
||||
|
||||
void vs_main()
|
||||
{
|
||||
int x = foo();
|
||||
float y = bar();
|
||||
}
|
||||
|
||||
19
test/codegen/multiple_semicolons_everywhere.golden
Normal file
19
test/codegen/multiple_semicolons_everywhere.golden
Normal file
@@ -0,0 +1,19 @@
|
||||
float4 foo();
|
||||
|
||||
float3 vs_main(float3 pos : POSITION) : SV_POSITION
|
||||
{
|
||||
return pos;
|
||||
}
|
||||
|
||||
float4 foo()
|
||||
{
|
||||
return float4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
float4 ps_main() : SV_TARGET
|
||||
{
|
||||
float4 y = foo();
|
||||
float4 color = y;
|
||||
return color;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
struct Foo;
|
||||
|
||||
float foo(Foo f);
|
||||
|
||||
struct Foo
|
||||
{
|
||||
float some_data;
|
||||
}
|
||||
|
||||
float foo(Foo f)
|
||||
{
|
||||
return f.some_data * 2.0f;
|
||||
}
|
||||
|
||||
void vs_main()
|
||||
{
|
||||
Foo f;
|
||||
f.some_data = 4.0f;
|
||||
float d = foo(f);
|
||||
}
|
||||
|
||||
10
test/codegen/passthrough.golden
Normal file
10
test/codegen/passthrough.golden
Normal file
@@ -0,0 +1,10 @@
|
||||
float3 vs_main(float3 pos : POSITION) : SV_POSITION
|
||||
{
|
||||
return pos;
|
||||
}
|
||||
|
||||
float4 ps_main() : SV_TARGET
|
||||
{
|
||||
return float4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
8
test/codegen/precedence_test.golden
Normal file
8
test/codegen/precedence_test.golden
Normal file
@@ -0,0 +1,8 @@
|
||||
void vs_main()
|
||||
{
|
||||
float x = 2;
|
||||
float y = 5;
|
||||
float z = 10;
|
||||
float w = x * y + y * z - x / y * x;
|
||||
}
|
||||
|
||||
13
test/codegen/simple_struct_access.golden
Normal file
13
test/codegen/simple_struct_access.golden
Normal file
@@ -0,0 +1,13 @@
|
||||
struct Data;
|
||||
|
||||
struct Data
|
||||
{
|
||||
float4 color;
|
||||
}
|
||||
|
||||
void vs_main()
|
||||
{
|
||||
Data d;
|
||||
float4 x = d.color;
|
||||
}
|
||||
|
||||
20
test/codegen/struct_within_struct.golden
Normal file
20
test/codegen/struct_within_struct.golden
Normal file
@@ -0,0 +1,20 @@
|
||||
struct Foo;
|
||||
struct Bar;
|
||||
|
||||
struct Foo
|
||||
{
|
||||
float4 color;
|
||||
}
|
||||
|
||||
struct Bar
|
||||
{
|
||||
Foo t;
|
||||
}
|
||||
|
||||
void vs_main()
|
||||
{
|
||||
Foo f;
|
||||
Bar b;
|
||||
b.t = f;
|
||||
}
|
||||
|
||||
5
test/codegen/use_builtin_functions.golden
Normal file
5
test/codegen/use_builtin_functions.golden
Normal file
@@ -0,0 +1,5 @@
|
||||
void vs_main()
|
||||
{
|
||||
float4 f = float4(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user