From a982b8d20566e79350c5784d3c86a9db5a881d5b Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Thu, 3 Oct 2024 23:08:55 +0200 Subject: [PATCH] Change function signatures for dynamic offsets --- Sources/integrations/kope.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Sources/integrations/kope.c b/Sources/integrations/kope.c index abc3f8e..29c84e6 100644 --- a/Sources/integrations/kope.c +++ b/Sources/integrations/kope.c @@ -703,7 +703,17 @@ void kope_export(char *directory, api_kind api) { fprintf(output, "void kong_create_%s_set(kope_g5_device *device, const %s_parameters *parameters, %s_set *set);\n", get_name(set->name), get_name(set->name), get_name(set->name)); - fprintf(output, "void kong_set_descriptor_set_%s(kope_g5_command_list *list, %s_set *set);\n\n", get_name(set->name), get_name(set->name)); + + fprintf(output, "void kong_set_descriptor_set_%s(kope_g5_command_list *list, %s_set *set", get_name(set->name), get_name(set->name)); + for (size_t definition_index = 0; definition_index < set->definitions_count; ++definition_index) { + definition d = set->definitions[definition_index]; + switch (d.kind) { + case DEFINITION_CONST_CUSTOM: + fprintf(output, ", uint32_t %s_offset", get_name(get_global(d.global)->name)); + break; + } + } + fprintf(output, ");\n\n"); } fprintf(output, "\n"); @@ -1066,7 +1076,16 @@ void kope_export(char *directory, api_kind api) { } fprintf(output, "}\n\n"); - fprintf(output, "void kong_set_descriptor_set_%s(kope_g5_command_list *list, %s_set *set) {\n", get_name(set->name), get_name(set->name)); + fprintf(output, "void kong_set_descriptor_set_%s(kope_g5_command_list *list, %s_set *set", get_name(set->name), get_name(set->name)); + for (size_t definition_index = 0; definition_index < set->definitions_count; ++definition_index) { + definition d = set->definitions[definition_index]; + switch (d.kind) { + case DEFINITION_CONST_CUSTOM: + fprintf(output, ", uint32_t %s_offset", get_name(get_global(d.global)->name)); + break; + } + } + fprintf(output, ") {\n"); for (size_t descriptor_index = 0; descriptor_index < set->definitions_count; ++descriptor_index) { definition d = set->definitions[descriptor_index];