From 9b18e8438f5225b62dc631a3306d2205be247ce7 Mon Sep 17 00:00:00 2001 From: Edu Garcia <28616+Arcnor@users.noreply.github.com> Date: Tue, 11 Feb 2025 11:18:23 +0000 Subject: [PATCH] [GPU] D3D12 backend debug markers were being cut Code used wcslen that return number of characters, but D3D12 debug layer uses bytes + wide chars --- src/gpu/d3d12/SDL_gpu_d3d12.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c index aa5dc6ca77..f4fa85bfdb 100644 --- a/src/gpu/d3d12/SDL_gpu_d3d12.c +++ b/src/gpu/d3d12/SDL_gpu_d3d12.c @@ -2028,7 +2028,7 @@ static void D3D12_InsertDebugLabel( d3d12CommandBuffer->graphicsCommandList, 0, wchar_text, - (UINT)SDL_wcslen(wchar_text)); + (UINT)SDL_wcslen(wchar_text) * sizeof(WCHAR)); SDL_free(wchar_text); } @@ -2044,7 +2044,7 @@ static void D3D12_PushDebugGroup( d3d12CommandBuffer->graphicsCommandList, 0, wchar_text, - (UINT)SDL_wcslen(wchar_text)); + (UINT)SDL_wcslen(wchar_text) * sizeof(WCHAR)); SDL_free(wchar_text); }