Skip to content

Commit

Permalink
Set more names
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 30, 2024
1 parent 2e0eda0 commit 86de08f
Show file tree
Hide file tree
Showing 12 changed files with 40 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

#include <kope/graphics5/buffer.h>

#include <kinc/backend/SystemMicrosoft.h>

void kope_d3d12_buffer_set_name(kope_g5_buffer *buffer, const char *name) {
wchar_t wstr[1024];
kinc_microsoft_convert_string(wstr, name, 1024);
buffer->d3d12.resource->SetName(wstr);
}

void kope_d3d12_buffer_destroy(kope_g5_buffer *buffer) {
buffer->d3d12.resource->Release();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
extern "C" {
#endif

void kope_d3d12_buffer_set_name(kope_g5_buffer *buffer, const char *name);
void kope_d3d12_buffer_destroy(kope_g5_buffer *buffer);
void *kope_d3d12_buffer_lock(kope_g5_buffer *buffer);
void kope_d3d12_buffer_unlock(kope_g5_buffer *buffer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
#include "d3d12unit.h"

#include <kope/graphics5/sampler.h>

void kope_d3d12_sampler_set_name(kope_g5_sampler *sampler, const char *name) {
// not supported I think
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
extern "C" {
#endif

void kope_d3d12_sampler_set_name(kope_g5_sampler *sampler, const char *name);

#ifdef __cplusplus
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
uint32_t kope_d3d12_texture_resource_state_index(kope_g5_texture *texture, uint32_t mip_level, uint32_t array_layer) {
return mip_level + (array_layer * texture->d3d12.mip_level_count);
}

void kope_d3d12_texture_set_name(kope_g5_texture *texture, const char *name) {
wchar_t wstr[1024];
kinc_microsoft_convert_string(wstr, name, 1024);
texture->d3d12.resource->SetName(wstr);
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ extern "C" {

uint32_t kope_d3d12_texture_resource_state_index(kope_g5_texture *texture, uint32_t mip_level, uint32_t array_layer);

void kope_d3d12_texture_set_name(kope_g5_texture *texture, const char *name);

#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 4 additions & 0 deletions Sources/kope/graphics5/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
#include <kope/vulkan/buffer_functions.h>
#endif

void kope_g5_buffer_set_name(kope_g5_buffer *buffer, const char *name) {
KOPE_G5_CALL2(buffer_set_name, buffer, name);
}

void kope_g5_buffer_destroy(kope_g5_buffer *buffer) {
KOPE_G5_CALL1(buffer_destroy, buffer);
}
Expand Down
1 change: 1 addition & 0 deletions Sources/kope/graphics5/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ typedef struct kope_g5_buffer {
KOPE_G5_IMPL(buffer);
} kope_g5_buffer;

void kope_g5_buffer_set_name(kope_g5_buffer *buffer, const char *name);
void kope_g5_buffer_destroy(kope_g5_buffer *buffer);
void *kope_g5_buffer_lock(kope_g5_buffer *buffer); // TODO
void kope_g5_buffer_unlock(kope_g5_buffer *buffer);
Expand Down
4 changes: 4 additions & 0 deletions Sources/kope/graphics5/sampler.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
#ifdef KOPE_VULKAN
#include <kope/vulkan/sampler_functions.h>
#endif

void kope_g5_sampler_set_name(kope_g5_sampler *sampler, const char *name) {
KOPE_G5_CALL2(sampler_set_name, sampler, name);
}
2 changes: 2 additions & 0 deletions Sources/kope/graphics5/sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ typedef struct kope_g5_sampler {
KOPE_G5_IMPL(sampler);
} kope_g5_sampler;

KOPE_FUNC void kope_g5_sampler_set_name(kope_g5_sampler *sampler, const char *name);

#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 4 additions & 0 deletions Sources/kope/graphics5/texture.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@
#ifdef KOPE_VULKAN
#include <kope/vulkan/texture_functions.h>
#endif

void kope_g5_texture_set_name(kope_g5_texture *texture, const char *name) {
KOPE_G5_CALL2(texture_set_name, texture, name);
}
2 changes: 2 additions & 0 deletions Sources/kope/graphics5/texture.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ typedef struct kope_g5_texture_view {
uint32_t array_layer_count;
} kope_g5_texture_view;

KOPE_FUNC void kope_g5_texture_set_name(kope_g5_texture *texture, const char *name);

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 86de08f

Please sign in to comment.