Fixed some sem check init.

This commit is contained in:
2025-01-05 22:38:08 +01:00
parent d08529a3eb
commit d65c6359db

View File

@@ -684,6 +684,12 @@ add_child :: (checker : *Semantic_Checker, handle : Type_Variable_Handle, child
} }
init_semantic_checker :: (checker : *Semantic_Checker, root : *AST_Node, path : string) { init_semantic_checker :: (checker : *Semantic_Checker, root : *AST_Node, path : string) {
checker.current_buffer_index = 0;
checker.current_sampler_index = 0;
checker.current_texture_index = 0;
array_reserve(*checker.result.messages, 16);
checker.program_root = root; checker.program_root = root;
checker.path = path; checker.path = path;
@@ -1663,6 +1669,9 @@ check :: (result : *Compile_Result) {
checker.current_sampler_index = 0; checker.current_sampler_index = 0;
checker.current_texture_index = 0; checker.current_texture_index = 0;
array_reserve(*checker.result.messages, 16); array_reserve(*checker.result.messages, 16);
init_semantic_checker(*checker, file.ast_root, file.file.path);
add_hlsl_builtins(*checker); add_hlsl_builtins(*checker);
type_check(*checker, file.ast_root); type_check(*checker, file.ast_root);