From 4053400152af2705d789709fcc16249fb66fcf0f Mon Sep 17 00:00:00 2001 From: Niels Bross Date: Wed, 8 Jan 2025 22:37:48 +0100 Subject: [PATCH] Added unary expressions to semcheck and codegen. --- AST.jai | 4 ++ Codegen.jai | 5 +- Semantic_Analysis.jai | 14 ++++ test/codegen/unary.golden | 10 +++ test/codegen_all.suite | 1 + test/compile_all.suite | 1 + test/lex/float_suffix.golden | 2 +- test/lex/unary.golden | 64 +++++++++++++++++++ test/lex_all.suite | 1 + .../parse/field_without_type_specifier.golden | 2 +- test/parse/unary.golden | 8 +++ test/parse_all.suite | 1 + test/semant/functions_with_same_name.golden | 4 +- test/semant/redeclared_variable.golden | 4 +- .../struct_access_primitive_type.golden | 2 +- test/semant/type_as_variable_name.golden | 2 +- test/semant/unary.golden | 10 +++ test/semant/undeclared_function.golden | 2 +- test/semant/undeclared_symbol.golden | 2 +- test/semant/unknown_overload.golden | 10 +-- test/semant/wrong_argument_count.golden | 8 +-- test/semant/wrong_multiply.golden | 2 +- test/semant/wrong_type_for_function.golden | 6 +- test/semant_all.suite | 1 + test/unary.ink | 7 ++ 25 files changed, 149 insertions(+), 24 deletions(-) create mode 100644 test/codegen/unary.golden create mode 100644 test/lex/unary.golden create mode 100644 test/parse/unary.golden create mode 100644 test/semant/unary.golden create mode 100644 test/unary.ink diff --git a/AST.jai b/AST.jai index 2f16603..57993a4 100644 --- a/AST.jai +++ b/AST.jai @@ -211,7 +211,11 @@ pretty_print_binary :: (node : *AST_Node, indentation : int, builder : *String_B } pretty_print_unary :: (node : *AST_Node, indentation : int, builder : *String_Builder) { + indent(builder, indentation); + op := node.token; + print_to_builder(builder, op_to_string(op)); + pretty_print_children(node, 0, builder, flags = 0); } print_return_node :: (node : *AST_Node, indentation : int, builder : *String_Builder) { diff --git a/Codegen.jai b/Codegen.jai index cfd569d..8fe0512 100644 --- a/Codegen.jai +++ b/Codegen.jai @@ -420,7 +420,10 @@ emit_node :: (state : *Codegen_State, node : *AST_Node, indentation : int) { } } case .Unary; { - assert(false, "Not implemented yet: unary"); + indent(*state.builder, indentation); + + emit_operator(state, node.token.kind); + emit_node(state, node.children[0], 0); } case .Expression_Statement; { emit_node(state, node.children[0], indentation); diff --git a/Semantic_Analysis.jai b/Semantic_Analysis.jai index b631e29..6beebca 100644 --- a/Semantic_Analysis.jai +++ b/Semantic_Analysis.jai @@ -330,6 +330,7 @@ no_matching_overload_found :: (checker : *Semantic_Checker, call : *AST_Node, ov record_error(checker, message, locations, false); } + not_all_control_paths_return_value :: (checker : *Semantic_Checker, node : *AST_Node) { builder : String_Builder; init_string_builder(*builder,, temp); @@ -1374,6 +1375,19 @@ check_node :: (checker : *Semantic_Checker, node : *AST_Node) -> Type_Variable_H field_var := create_field(checker, node); return field_var; } + case .Unary; { + var := check_node(checker, node.children[0]); + variable, handle := new_type_variable(checker); + type := from_handle(checker, var); + variable.type = type.type; + variable.typename = type.typename; + variable.scope = type.scope; + variable.source_node = node; + node.type_variable = handle; + add_child(variable, var); + + return handle; + } case .Binary; { lhs_var := check_node(checker, node.children[0]); if lhs_var == 0 { diff --git a/test/codegen/unary.golden b/test/codegen/unary.golden new file mode 100644 index 0000000..9c73d21 --- /dev/null +++ b/test/codegen/unary.golden @@ -0,0 +1,10 @@ +float4 vs_vs_main(float3 position : POSITION) : SV_POSITION +{ + return float4(position.x, position.y, position.z, 1.0f); +} + +float4 ps_ps_main(float4 position : SV_POSITION) : SV_TARGET +{ + return float4(0.5f, -1, 0, 1); +} + diff --git a/test/codegen_all.suite b/test/codegen_all.suite index c1d2088..87c48e9 100644 --- a/test/codegen_all.suite +++ b/test/codegen_all.suite @@ -17,4 +17,5 @@ test/passthrough.ink codegen test/property_rename.ink codegen test/simple_struct_access.ink codegen test/struct_within_struct.ink codegen +test/unary.ink codegen test/use_builtin_functions.ink codegen diff --git a/test/compile_all.suite b/test/compile_all.suite index d2e4495..b17e326 100644 --- a/test/compile_all.suite +++ b/test/compile_all.suite @@ -17,4 +17,5 @@ test/pass_and_access_struct_fields_in_functions.ink compile test/passthrough.ink compile test/simple_struct_access.ink compile test/struct_within_struct.ink compile +test/unary.ink compile test/use_builtin_functions.ink compile \ No newline at end of file diff --git a/test/lex/float_suffix.golden b/test/lex/float_suffix.golden index de8d3af..94acbd1 100644 --- a/test/lex/float_suffix.golden +++ b/test/lex/float_suffix.golden @@ -1,4 +1,4 @@ -test/float_suffix.inx:2,12: error: We don't use 'f' suffixes for floating point values. +test/float_suffix.ink:2,12: error: We don't use 'f' suffixes for floating point values.  x : float = 2.0f ^^^^  \ No newline at end of file diff --git a/test/lex/unary.golden b/test/lex/unary.golden new file mode 100644 index 0000000..51d8753 --- /dev/null +++ b/test/lex/unary.golden @@ -0,0 +1,64 @@ +{kind = TOKEN_VERTEX; ; index = 0 ; length = 6 line = 1 ; column = 0 ; value ='vertex'; } +{kind = TOKEN_IDENTIFIER; ; index = 7 ; length = 7 line = 1 ; column = 7 ; value ='vs_main'; } +{kind = TOKEN_DOUBLECOLON; ; index = 15 ; length = 2 line = 1 ; column = 15 ; value ='::'; } +{kind = TOKEN_LEFTPAREN; ; index = 18 ; length = 1 line = 1 ; column = 18 ; value ='('; } +{kind = TOKEN_IDENTIFIER; ; index = 19 ; length = 8 line = 1 ; column = 19 ; value ='position'; } +{kind = TOKEN_COLON; ; index = 28 ; length = 1 line = 1 ; column = 28 ; value =':'; } +{kind = TOKEN_IDENTIFIER; ; index = 30 ; length = 6 line = 1 ; column = 30 ; value ='float3'; } +{kind = TOKEN_AT; ; index = 37 ; length = 1 line = 1 ; column = 37 ; value ='@'; } +{kind = TOKEN_IDENTIFIER; ; index = 38 ; length = 8 line = 1 ; column = 38 ; value ='position'; } +{kind = TOKEN_RIGHTPAREN; ; index = 46 ; length = 1 line = 1 ; column = 46 ; value =')'; } +{kind = TOKEN_ARROW; ; index = 48 ; length = 2 line = 1 ; column = 48 ; value ='->'; } +{kind = TOKEN_IDENTIFIER; ; index = 51 ; length = 6 line = 1 ; column = 51 ; value ='float4'; } +{kind = TOKEN_AT; ; index = 58 ; length = 1 line = 1 ; column = 58 ; value ='@'; } +{kind = TOKEN_IDENTIFIER; ; index = 59 ; length = 8 line = 1 ; column = 59 ; value ='position'; } +{kind = TOKEN_LEFTBRACE; ; index = 68 ; length = 1 line = 1 ; column = 68 ; value ='{'; } +{kind = TOKEN_RETURN; ; index = 75 ; length = 6 line = 2 ; column = 3 ; value ='return'; } +{kind = TOKEN_IDENTIFIER; ; index = 82 ; length = 6 line = 2 ; column = 10 ; value ='float4'; } +{kind = TOKEN_LEFTPAREN; ; index = 88 ; length = 1 line = 2 ; column = 16 ; value ='('; } +{kind = TOKEN_IDENTIFIER; ; index = 89 ; length = 8 line = 2 ; column = 17 ; value ='position'; } +{kind = TOKEN_DOT; ; index = 97 ; length = 1 line = 2 ; column = 25 ; value ='.'; } +{kind = TOKEN_IDENTIFIER; ; index = 98 ; length = 1 line = 2 ; column = 26 ; value ='x'; } +{kind = TOKEN_COMMA; ; index = 99 ; length = 1 line = 2 ; column = 27 ; value =','; } +{kind = TOKEN_IDENTIFIER; ; index = 101 ; length = 8 line = 2 ; column = 29 ; value ='position'; } +{kind = TOKEN_DOT; ; index = 109 ; length = 1 line = 2 ; column = 37 ; value ='.'; } +{kind = TOKEN_IDENTIFIER; ; index = 110 ; length = 1 line = 2 ; column = 38 ; value ='y'; } +{kind = TOKEN_COMMA; ; index = 111 ; length = 1 line = 2 ; column = 39 ; value =','; } +{kind = TOKEN_IDENTIFIER; ; index = 113 ; length = 8 line = 2 ; column = 41 ; value ='position'; } +{kind = TOKEN_DOT; ; index = 121 ; length = 1 line = 2 ; column = 49 ; value ='.'; } +{kind = TOKEN_IDENTIFIER; ; index = 122 ; length = 1 line = 2 ; column = 50 ; value ='z'; } +{kind = TOKEN_COMMA; ; index = 123 ; length = 1 line = 2 ; column = 51 ; value =','; } +{kind = TOKEN_FLOATLITERAL; ; index = 125 ; length = 3 line = 2 ; column = 53 ; value ='1'; } +{kind = TOKEN_RIGHTPAREN; ; index = 128 ; length = 1 line = 2 ; column = 56 ; value =')'; } +{kind = TOKEN_SEMICOLON; ; index = 129 ; length = 1 line = 2 ; column = 57 ; value =';'; } +{kind = TOKEN_RIGHTBRACE; ; index = 132 ; length = 1 line = 3 ; column = 0 ; value ='}'; } +{kind = TOKEN_PIXEL; ; index = 137 ; length = 5 line = 5 ; column = 0 ; value ='pixel'; } +{kind = TOKEN_IDENTIFIER; ; index = 143 ; length = 7 line = 5 ; column = 6 ; value ='ps_main'; } +{kind = TOKEN_DOUBLECOLON; ; index = 151 ; length = 2 line = 5 ; column = 14 ; value ='::'; } +{kind = TOKEN_LEFTPAREN; ; index = 154 ; length = 1 line = 5 ; column = 17 ; value ='('; } +{kind = TOKEN_IDENTIFIER; ; index = 155 ; length = 8 line = 5 ; column = 18 ; value ='position'; } +{kind = TOKEN_COLON; ; index = 164 ; length = 1 line = 5 ; column = 27 ; value =':'; } +{kind = TOKEN_IDENTIFIER; ; index = 166 ; length = 6 line = 5 ; column = 29 ; value ='float4'; } +{kind = TOKEN_AT; ; index = 173 ; length = 1 line = 5 ; column = 36 ; value ='@'; } +{kind = TOKEN_IDENTIFIER; ; index = 174 ; length = 11 line = 5 ; column = 37 ; value ='outposition'; } +{kind = TOKEN_RIGHTPAREN; ; index = 185 ; length = 1 line = 5 ; column = 48 ; value =')'; } +{kind = TOKEN_ARROW; ; index = 187 ; length = 2 line = 5 ; column = 50 ; value ='->'; } +{kind = TOKEN_IDENTIFIER; ; index = 190 ; length = 6 line = 5 ; column = 53 ; value ='float4'; } +{kind = TOKEN_AT; ; index = 197 ; length = 1 line = 5 ; column = 60 ; value ='@'; } +{kind = TOKEN_IDENTIFIER; ; index = 198 ; length = 6 line = 5 ; column = 61 ; value ='target'; } +{kind = TOKEN_LEFTBRACE; ; index = 205 ; length = 1 line = 5 ; column = 68 ; value ='{'; } +{kind = TOKEN_RETURN; ; index = 211 ; length = 6 line = 6 ; column = 2 ; value ='return'; } +{kind = TOKEN_IDENTIFIER; ; index = 218 ; length = 6 line = 6 ; column = 9 ; value ='float4'; } +{kind = TOKEN_LEFTPAREN; ; index = 224 ; length = 1 line = 6 ; column = 15 ; value ='('; } +{kind = TOKEN_FLOATLITERAL; ; index = 225 ; length = 3 line = 6 ; column = 16 ; value ='0.5'; } +{kind = TOKEN_COMMA; ; index = 228 ; length = 1 line = 6 ; column = 19 ; value =','; } +{kind = TOKEN_MINUS; ; index = 230 ; length = 1 line = 6 ; column = 21 ; value ='-'; } +{kind = TOKEN_INTLITERAL; ; index = 231 ; length = 1 line = 6 ; column = 22 ; value ='1'; } +{kind = TOKEN_COMMA; ; index = 232 ; length = 1 line = 6 ; column = 23 ; value =','; } +{kind = TOKEN_INTLITERAL; ; index = 234 ; length = 1 line = 6 ; column = 25 ; value ='0'; } +{kind = TOKEN_COMMA; ; index = 235 ; length = 1 line = 6 ; column = 26 ; value =','; } +{kind = TOKEN_INTLITERAL; ; index = 237 ; length = 1 line = 6 ; column = 28 ; value ='1'; } +{kind = TOKEN_RIGHTPAREN; ; index = 238 ; length = 1 line = 6 ; column = 29 ; value =')'; } +{kind = TOKEN_SEMICOLON; ; index = 239 ; length = 1 line = 6 ; column = 30 ; value =';'; } +{kind = TOKEN_RIGHTBRACE; ; index = 242 ; length = 1 line = 7 ; column = 0 ; value ='}'; } +{kind = TOKEN_EOF; ; index = 243 ; length = 0 line = 7 ; column = 1 ; value =''; } diff --git a/test/lex_all.suite b/test/lex_all.suite index 03f71bb..852a8f3 100644 --- a/test/lex_all.suite +++ b/test/lex_all.suite @@ -24,6 +24,7 @@ test/simple_struct_access.ink lex test/struct_access_primitive_type.ink lex test/struct_within_struct.ink lex test/type_as_variable_name.ink lex +test/unary.ink lex test/undeclared_function.ink lex test/undeclared_symbol.ink lex test/unknown_overload.ink lex diff --git a/test/parse/field_without_type_specifier.golden b/test/parse/field_without_type_specifier.golden index 81d11ba..77cd077 100644 --- a/test/parse/field_without_type_specifier.golden +++ b/test/parse/field_without_type_specifier.golden @@ -1,4 +1,4 @@ -test/field_without_type_specifier.inx:2,0: error: Expected type specifier after field name. +test/field_without_type_specifier.ink:2,0: error: Expected type specifier after field name. x := 5.0; ^  \ No newline at end of file diff --git a/test/parse/unary.golden b/test/parse/unary.golden new file mode 100644 index 0000000..e246f2a --- /dev/null +++ b/test/parse/unary.golden @@ -0,0 +1,8 @@ +(program + (fun vertex vs_vs_main -> float4 (@position) + [(:= position float3 (@position))] + (return (float4 position.x position.y position.z 1))) + + (fun pixel ps_ps_main -> float4 (@target) + [(:= position float4 (@outposition))] + (return (float4 0.5 -1 0 1)))) \ No newline at end of file diff --git a/test/parse_all.suite b/test/parse_all.suite index 21b2e0f..14ae4ac 100644 --- a/test/parse_all.suite +++ b/test/parse_all.suite @@ -24,6 +24,7 @@ test/simple_struct_access.ink parse test/struct_access_primitive_type.ink parse test/struct_within_struct.ink parse test/type_as_variable_name.ink parse +test/unary.ink parse test/undeclared_function.ink parse test/undeclared_symbol.ink parse test/unknown_overload.ink parse diff --git a/test/semant/functions_with_same_name.golden b/test/semant/functions_with_same_name.golden index 9b9d09c..fcfc0cf 100644 --- a/test/semant/functions_with_same_name.golden +++ b/test/semant/functions_with_same_name.golden @@ -1,8 +1,8 @@ -test/functions_with_same_name.inx:2,0: error: Redeclaration of 'foo' +test/functions_with_same_name.ink:2,0: error: Redeclaration of 'foo'  foo :: () { ^^^ -test/functions_with_same_name.inx:1,0: info: Here is the first declaration of 'foo' +test/functions_with_same_name.ink:1,0: info: Here is the first declaration of 'foo'  foo :: () { ^^^  \ No newline at end of file diff --git a/test/semant/redeclared_variable.golden b/test/semant/redeclared_variable.golden index 72fd8d9..e1aca71 100644 --- a/test/semant/redeclared_variable.golden +++ b/test/semant/redeclared_variable.golden @@ -1,8 +1,8 @@ -test/redeclared_variable.inx:3,0: error: Redeclaration of 'x' +test/redeclared_variable.ink:3,0: error: Redeclaration of 'x'  x : float = 5.0 ^ -test/redeclared_variable.inx:2,0: info: Here is the first declaration of 'x' +test/redeclared_variable.ink:2,0: info: Here is the first declaration of 'x'  x : float = 1.0 ^  \ No newline at end of file diff --git a/test/semant/struct_access_primitive_type.golden b/test/semant/struct_access_primitive_type.golden index a77f4f9..abffb44 100644 --- a/test/semant/struct_access_primitive_type.golden +++ b/test/semant/struct_access_primitive_type.golden @@ -1,4 +1,4 @@ -test/struct_access_primitive_type.inx:3,0: error: Attempting to access a field on a primitive type 'int'. +test/struct_access_primitive_type.ink:3,0: error: Attempting to access a field on a primitive type 'int'. x.d = 4; ^ declaration: diff --git a/test/semant/type_as_variable_name.golden b/test/semant/type_as_variable_name.golden index bdb0bbc..59e7901 100644 --- a/test/semant/type_as_variable_name.golden +++ b/test/semant/type_as_variable_name.golden @@ -1,4 +1,4 @@ -test/type_as_variable_name.inx:2,0: error: Invalid variable name 'int' +test/type_as_variable_name.ink:2,0: error: Invalid variable name 'int'  int : float = 4.0 ^^^  \ No newline at end of file diff --git a/test/semant/unary.golden b/test/semant/unary.golden new file mode 100644 index 0000000..75a59f9 --- /dev/null +++ b/test/semant/unary.golden @@ -0,0 +1,10 @@ +scope (global) [ + [pixel__ps_ps_main] : (position : float4) -> float4 + [vertex__vs_vs_main] : (position : float3) -> float4 + scope (vertex__vs_vs_main) [ + [position] : float3 + ] + scope (pixel__ps_ps_main) [ + [position] : float4 + ] +] diff --git a/test/semant/undeclared_function.golden b/test/semant/undeclared_function.golden index ae521d4..296d548 100644 --- a/test/semant/undeclared_function.golden +++ b/test/semant/undeclared_function.golden @@ -1,4 +1,4 @@ -test/undeclared_function.inx:2,0: error: Attempt to call undeclared function 'foo'. +test/undeclared_function.ink:2,0: error: Attempt to call undeclared function 'foo'.  foo(); ^^^ diff --git a/test/semant/undeclared_symbol.golden b/test/semant/undeclared_symbol.golden index a9d7aa0..14ef641 100644 --- a/test/semant/undeclared_symbol.golden +++ b/test/semant/undeclared_symbol.golden @@ -1,4 +1,4 @@ -test/undeclared_symbol.inx:2,10: error: Use of undeclared symbol 'f' +test/undeclared_symbol.ink:2,10: error: Use of undeclared symbol 'f'  b : int = f; ^  \ No newline at end of file diff --git a/test/semant/unknown_overload.golden b/test/semant/unknown_overload.golden index 1c6273e..a317a2b 100644 --- a/test/semant/unknown_overload.golden +++ b/test/semant/unknown_overload.golden @@ -1,4 +1,4 @@ -test/unknown_overload.inx:6,0: error: Procedure call did not match any of the possible overloads for 'foo' +test/unknown_overload.ink:6,0: error: Procedure call did not match any of the possible overloads for 'foo'  found: foo(v, v); ^^^ @@ -7,10 +7,10 @@  foo(v, v); ^  Possible overloads: - foo :: (v1 : float3, v2 : float3) { (test/unknown_overload.inx:1) - foo :: (v1 : float2, v2 : float2, v3 : float2) { (test/unknown_overload.inx:2) + foo :: (v1 : float3, v2 : float3) { (test/unknown_overload.ink:1) + foo :: (v1 : float2, v2 : float2, v3 : float2) { (test/unknown_overload.ink:2) -test/unknown_overload.inx:6,4: error: Type mismatch. Expected float3 got float +test/unknown_overload.ink:6,4: error: Type mismatch. Expected float3 got float  found: foo(v, v); ^ @@ -20,7 +20,7 @@ got: v : float = 2.0 -test/unknown_overload.inx:6,7: error: Type mismatch. Expected float3 got float +test/unknown_overload.ink:6,7: error: Type mismatch. Expected float3 got float  found: foo(v, v); ^ diff --git a/test/semant/wrong_argument_count.golden b/test/semant/wrong_argument_count.golden index a81118d..562a3c4 100644 --- a/test/semant/wrong_argument_count.golden +++ b/test/semant/wrong_argument_count.golden @@ -1,15 +1,15 @@ -test/wrong_argument_count.inx:5,19: error: Use of undeclared symbol 'w' +test/wrong_argument_count.ink:5,19: error: Use of undeclared symbol 'w'  return x * y * z * w; ^ -test/wrong_argument_count.inx:9,0: error: Procedure call did not match any of the possible overloads for 'foo' +test/wrong_argument_count.ink:9,0: error: Procedure call did not match any of the possible overloads for 'foo'  found: foo(2.0, 3.0); ^^^  Possible overloads: - foo :: (x : float, y : float, z : float) -> float { (test/wrong_argument_count.inx:1) + foo :: (x : float, y : float, z : float) -> float { (test/wrong_argument_count.ink:1)  Not enough arguments: Wanted 3, got 2. - foo :: (x : float, y : float, z : float, w : float) -> float { (test/wrong_argument_count.inx:4) + foo :: (x : float, y : float, z : float, w : float) -> float { (test/wrong_argument_count.ink:4)  Not enough arguments: Wanted 4, got 2. diff --git a/test/semant/wrong_multiply.golden b/test/semant/wrong_multiply.golden index f2c948b..c92670d 100644 --- a/test/semant/wrong_multiply.golden +++ b/test/semant/wrong_multiply.golden @@ -1,4 +1,4 @@ -test/wrong_multiply.inx:4,34: error: Type mismatch. Expected float got float2 +test/wrong_multiply.ink:4,34: error: Type mismatch. Expected float got float2  found: result : float4 = float4(1.0, foo * res, 0.0, 1.0); ^ diff --git a/test/semant/wrong_type_for_function.golden b/test/semant/wrong_type_for_function.golden index e0c8330..7f42213 100644 --- a/test/semant/wrong_type_for_function.golden +++ b/test/semant/wrong_type_for_function.golden @@ -1,4 +1,4 @@ -test/wrong_type_for_function.inx:11,17: error: Procedure call did not match any of the possible overloads for 'float4' +test/wrong_type_for_function.ink:11,17: error: Procedure call did not match any of the possible overloads for 'float4'  found: color : float4 = float4(y, 1.0, 1.0, 1.0); ^^^^^^ @@ -7,9 +7,9 @@  color : float4 = float4(y, 1.0, 1.0, 1.0); ^  Possible overloads: - foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.inx:78) + foreign float4 :: (float, float, float, float) -> float4; (test/wrong_type_for_function.ink:78) -test/wrong_type_for_function.inx:11,24: error: Type mismatch. Expected float got float2 +test/wrong_type_for_function.ink:11,24: error: Type mismatch. Expected float got float2  found: color : float4 = float4(y, 1.0, 1.0, 1.0); ^ diff --git a/test/semant_all.suite b/test/semant_all.suite index 21f11dd..38a7c88 100644 --- a/test/semant_all.suite +++ b/test/semant_all.suite @@ -21,6 +21,7 @@ test/simple_struct_access.ink semant test/struct_access_primitive_type.ink semant test/struct_within_struct.ink semant test/type_as_variable_name.ink semant +test/unary.ink semant test/undeclared_function.ink semant test/undeclared_symbol.ink semant test/unknown_overload.ink semant diff --git a/test/unary.ink b/test/unary.ink new file mode 100644 index 0000000..74c8857 --- /dev/null +++ b/test/unary.ink @@ -0,0 +1,7 @@ +vertex vs_main :: (position : float3 @position) -> float4 @position { + return float4(position.x, position.y, position.z, 1.0); +} + +pixel ps_main :: (position : float4 @outposition) -> float4 @target { + return float4(0.5, -1, 0, 1); +} \ No newline at end of file