We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a701ba4 commit 116881bCopy full SHA for 116881b
1 file changed
src/vulkan/swapchain.c
@@ -708,8 +708,7 @@ static bool vk_sw_image_init(pl_swapchain sw, int idx)
708
709
pl_assert(current->vkimages.elem[idx] != VK_NULL_HANDLE);
710
711
- char name[32];
712
- snprintf(name, sizeof(name), "swapchain #%d", idx);
+ char *name = pl_asprintf(NULL, "swapchain #%d", idx);
713
pl_tex tex = pl_vulkan_wrap(gpu, pl_vulkan_wrap_params(
714
.image = current->vkimages.elem[idx],
715
.width = p->protoInfo.imageExtent.width,
@@ -719,8 +718,11 @@ static bool vk_sw_image_init(pl_swapchain sw, int idx)
719
718
.debug_tag = name,
720
));
721
722
- if (!tex)
+ if (!tex) {
+ pl_free(name);
723
goto error;
724
+ }
725
+ pl_steal((void *) tex, name);
726
727
current->images.elem[idx] = tex;
728
current->vkimages.elem[idx] = VK_NULL_HANDLE;
0 commit comments