Fix function overload resolution. Add static array not working.

This commit is contained in:
2024-06-25 08:54:02 +02:00
parent d2614b3ba9
commit 3bbbc1d556
6 changed files with 161 additions and 89 deletions

View File

@@ -111,9 +111,19 @@ Properties :: struct {
buffer_index : u32;
}
Constant_Buffer :: struct {
register : int;
name : string;
fields : Property_Field;
}
Shader_Variant_Collection :: struct {
properties : Properties;
cbuffers : [..]Constant_Buffer;
variants : [..]Shader_Variant;
}
@@ -334,10 +344,10 @@ compile_file :: (compiler : *Shader_Compiler, path : string) -> Compilation_Resu
variant : Shader_Variant;
variant.text = codegen_result.result_text;
if checker.vertex_entry_point {
variant.vertex_entry_point.name = checker.vertex_entry_point.name;
if checker.result.vertex_entry_point {
variant.vertex_entry_point.name = checker.result.vertex_entry_point.name;
type_variable := h2tv(*checker, checker.vertex_entry_point.type_variable);
type_variable := h2tv(*checker, checker.result.vertex_entry_point.type_variable);
assert(type_variable.type == .Function);
node := type_variable.source_node;
@@ -354,6 +364,8 @@ compile_file :: (compiler : *Shader_Compiler, path : string) -> Compilation_Resu
}
}
find_result := find_symbol(*check_result.scope_stack, "properties", xx 1);
if find_result {
property_variable := h2tv(check_result.type_variables, find_result.type_variable);
@@ -368,13 +380,13 @@ compile_file :: (compiler : *Shader_Compiler, path : string) -> Compilation_Resu
result.collection.properties.buffer_index = property_variable.buffer_index;
}
if checker.pixel_entry_point {
variant.pixel_entry_point.name = checker.pixel_entry_point.name;
if checker.result.pixel_entry_point {
variant.pixel_entry_point.name = checker.result.pixel_entry_point.name;
type_variable := h2tv(*checker, checker.pixel_entry_point.type_variable);
type_variable := h2tv(*checker, checker.result.pixel_entry_point.type_variable);
assert(type_variable.type == .Function);
field := type_variable_to_field(*checker, type_variable.return_var);
field := type_variable_to_field(*checker, type_variable.return_type_variable);
for hint : type_variable.source_node.hint_tokens {
field_hint : Field_Hint;