Skip to content

Commit 9479ac0

Browse files
kgslouken
authored andcommitted
If VULKAN_Submit fails during VULKAN_INTERNAL_CreateTexture, destroy the texture and return NULL
1 parent 7c110cb commit 9479ac0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gpu/vulkan/SDL_gpu_vulkan.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5886,7 +5886,10 @@ static VulkanTexture *VULKAN_INTERNAL_CreateTexture(
58865886
VULKAN_TEXTURE_USAGE_MODE_UNINITIALIZED,
58875887
texture);
58885888
VULKAN_INTERNAL_TrackTexture(barrierCommandBuffer, texture);
5889-
VULKAN_Submit((SDL_GPUCommandBuffer *)barrierCommandBuffer);
5889+
if (!VULKAN_Submit((SDL_GPUCommandBuffer *)barrierCommandBuffer)) {
5890+
VULKAN_INTERNAL_DestroyTexture(renderer, texture);
5891+
return NULL;
5892+
}
58905893
}
58915894

58925895
return texture;

0 commit comments

Comments
 (0)