Merge branch 'main' of git.nbross.com:nielsbross/Ink-Shader-Language

This commit is contained in:
2025-08-27 21:55:08 +02:00
2 changed files with 14 additions and 1 deletions

View File

@@ -755,7 +755,6 @@ field_declaration :: (parse_state : *Parse_State, identifier_token : *Token) ->
advance(parse_state); advance(parse_state);
} }
} }
} else if match(parse_state, .TOKEN_ASSIGN) { } else if match(parse_state, .TOKEN_ASSIGN) {
add_child(node, expression(parse_state)); add_child(node, expression(parse_state));
} }
@@ -1092,6 +1091,18 @@ constant_buffer :: (parse_state : *Parse_State, identifier_token : *Token = null
node : *AST_Node; node : *AST_Node;
source_location : Source_Range; source_location : Source_Range;
source_location.begin = parse_state.current; source_location.begin = parse_state.current;
if check(parse_state, .TOKEN_AT) {
while check(parse_state, .TOKEN_AT) {
advance(parse_state);
// @Incomplete(niels): this is a mapping
if check(parse_state, .TOKEN_IDENTIFIER) {
array_add(*node.hint_tokens, parse_state.current);
advance(parse_state);
}
}
}
consume(parse_state, .TOKEN_LEFTBRACE, "Expect '{' after 'constant_buffer' keyword"); consume(parse_state, .TOKEN_LEFTBRACE, "Expect '{' after 'constant_buffer' keyword");
buffer := field_list(parse_state, .Semicolon); buffer := field_list(parse_state, .Semicolon);

View File

@@ -119,6 +119,8 @@ Constant_Buffer :: struct {
fields : Static_Array(Property_Field, 16); fields : Static_Array(Property_Field, 16);
hint : Field_Hint; // optional hint...
buffer_index : u32; buffer_index : u32;
} }