Skip to content

Commit

Permalink
Add label for SokolTexture2D for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
IonAgorria committed Feb 12, 2024
1 parent ea41eed commit 54089f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/Render/sokol/SokolResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ void SokolTexture2D::update() {
dirty = false;

if (desc) {
#ifdef PERIMETER_DEBUG
if (desc->label) {
label = desc->label;
}
#endif
xassert(desc->usage == SG_USAGE_IMMUTABLE || data);
image = sg_make_image(desc);
if (desc->usage == SG_USAGE_IMMUTABLE) {
Expand Down
3 changes: 3 additions & 0 deletions Source/Render/sokol/SokolResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ struct SokolBuffer {
};

struct SokolTexture2D : MemoryResource {
#ifdef PERIMETER_DEBUG
std::string label;
#endif
sg_pixel_format pixel_format;
sg_image_desc* desc = nullptr;
sg_image image = {};
Expand Down

0 comments on commit 54089f4

Please sign in to comment.