diff --git a/Sources/integrations/kope.c b/Sources/integrations/kope.c index 2d6667d..995619c 100644 --- a/Sources/integrations/kope.c +++ b/Sources/integrations/kope.c @@ -621,6 +621,7 @@ void kope_export(char *directory, api_kind api) { fprintf(output, "void %s_buffer_create(kope_g5_device *device, kope_g5_buffer *buffer);\n", name); fprintf(output, "void %s_buffer_destroy(kope_g5_buffer *buffer);\n", name); fprintf(output, "%s *%s_buffer_lock(kope_g5_buffer *buffer);\n", name, name); + fprintf(output, "%s *%s_buffer_try_to_lock(kope_g5_buffer *buffer);\n", name, name); fprintf(output, "void %s_buffer_unlock(kope_g5_buffer *buffer);\n", name); } } @@ -723,6 +724,7 @@ void kope_export(char *directory, api_kind api) { fprintf(output, "void kong_create_buffer_%s(kope_g5_device * device, size_t count, %s_buffer *buffer);\n", get_name(t->name), get_name(t->name)); fprintf(output, "%s *kong_%s_buffer_lock(%s_buffer *buffer);\n", get_name(t->name), get_name(t->name), get_name(t->name)); + fprintf(output, "%s *kong_%s_buffer_try_to_lock(%s_buffer *buffer);\n", get_name(t->name), get_name(t->name), get_name(t->name)); fprintf(output, "void kong_%s_buffer_unlock(%s_buffer *buffer);\n", get_name(t->name), get_name(t->name)); fprintf(output, "void kong_set_vertex_buffer_%s(kope_g5_command_list *list, %s_buffer *buffer);\n\n", get_name(t->name), get_name(t->name)); } @@ -824,6 +826,10 @@ void kope_export(char *directory, api_kind api) { fprintf(output, "\treturn (%s *)kope_d3d12_buffer_lock(&buffer->buffer);\n", get_name(t->name)); fprintf(output, "}\n\n"); + fprintf(output, "%s *kong_%s_buffer_try_to_lock(%s_buffer *buffer) {\n", get_name(t->name), get_name(t->name), get_name(t->name)); + fprintf(output, "\treturn (%s *)kope_d3d12_buffer_try_to_lock(&buffer->buffer);\n", get_name(t->name)); + fprintf(output, "}\n\n"); + fprintf(output, "void kong_%s_buffer_unlock(%s_buffer *buffer) {\n", get_name(t->name), get_name(t->name)); fprintf(output, "\tkope_d3d12_buffer_unlock(&buffer->buffer);\n"); fprintf(output, "}\n\n"); @@ -898,6 +904,10 @@ void kope_export(char *directory, api_kind api) { fprintf(output, "\treturn (%s *)kope_g5_buffer_lock(buffer);\n", type_name); fprintf(output, "}\n\n"); + fprintf(output, "%s *%s_buffer_try_to_lock(kope_g5_buffer *buffer) {\n", type_name, type_name); + fprintf(output, "\treturn (%s *)kope_g5_buffer_try_to_lock(buffer);\n", type_name); + fprintf(output, "}\n\n"); + fprintf(output, "void %s_buffer_unlock(kope_g5_buffer *buffer) {\n", type_name); if (api != API_OPENGL) { bool has_matrices = false;