Clean up a little bit of API code. Fix an issue with missing operator. Port random semi complex shader.

This commit is contained in:
2025-08-21 22:22:00 +02:00
parent 01ffe9c73d
commit 45f67e16a8
5 changed files with 197 additions and 20 deletions

View File

@@ -400,22 +400,7 @@ type_variable_to_field :: (checker : *Semantic_Checker, variable : *Type_Variabl
return type_variable_to_field(checker.result_file.type_variables, checker.result_file.scope_stack, variable);
}
compile_file :: (compiler : *Shader_Compiler, paths : []string) -> Compile_Result {
result : Compile_Result;
for path : paths {
add_file(*result, path);
}
lex(*result);
parse(*result);
check(*result);
codegen(*result);
if result.had_error {
return result;
}
generate_output_data :: (result : *Compile_Result) {
for *file : result.files {
if file.vertex_entry_point.node {
file.vertex_entry_point.name = file.vertex_entry_point.node.name;
@@ -498,6 +483,27 @@ compile_file :: (compiler : *Shader_Compiler, paths : []string) -> Compile_Resul
file.pixel_entry_point.return_value = field;
}
}
}
compile_file :: (compiler : *Shader_Compiler, paths : []string) -> Compile_Result {
result : Compile_Result;
for path : paths {
add_file(*result, path);
}
lex(*result);
parse(*result);
check(*result);
codegen(*result);
if result.had_error {
return result;
}
generate_output_data(*result);
return result;
}