Skip to content

Commit

Permalink
Pass the buffers for dynamic offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Oct 9, 2024
1 parent 54b9b5c commit 4dc2b80
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/integrations/kope.c
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,8 @@ void kope_export(char *directory, api_kind api) {
}

if (dynamic_count > 0) {
fprintf(output, "\tkope_g5_buffer *dynamic_buffers[%i];\n", dynamic_count);

fprintf(output, "\tuint32_t dynamic_offsets[%i];\n", dynamic_count);

uint32_t dynamic_index = 0;
Expand All @@ -1142,6 +1144,7 @@ void kope_export(char *directory, api_kind api) {
switch (d.kind) {
case DEFINITION_CONST_CUSTOM:
if (has_attribute(&get_global(d.global)->attributes, add_name("indexed"))) {
fprintf(output, "\tdynamic_buffers[%i] = set->%s;\n", dynamic_index, get_name(get_global(d.global)->name));
fprintf(output, "\tdynamic_offsets[%i] = %s_index;\n", dynamic_index, get_name(get_global(d.global)->name));
dynamic_index += 1;
}
Expand All @@ -1152,10 +1155,10 @@ void kope_export(char *directory, api_kind api) {

fprintf(output, "\n\tkope_d3d12_command_list_set_descriptor_table(list, %i, &set->set", descriptor_table_index);
if (dynamic_count > 0) {
fprintf(output, ", dynamic_offsets");
fprintf(output, ", dynamic_buffers, dynamic_offsets");
}
else {
fprintf(output, ", NULL");
fprintf(output, ", NULL, NULL");
}
fprintf(output, ");\n");
fprintf(output, "}\n\n");
Expand Down

0 comments on commit 4dc2b80

Please sign in to comment.