SDL: GPU D3D12: Fix indirect buffers not being refcounted

From ff14a1781fd451d450ac7d78768334bf7f27136f Mon Sep 17 00:00:00 2001
From: cosmonaut <[EMAIL REDACTED]>
Date: Tue, 29 Oct 2024 10:34:54 -0700
Subject: [PATCH] GPU D3D12: Fix indirect buffers not being refcounted

---
 src/gpu/d3d12/SDL_gpu_d3d12.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gpu/d3d12/SDL_gpu_d3d12.c b/src/gpu/d3d12/SDL_gpu_d3d12.c
index 86d8dcc6c6d83..8243d02e1a9cc 100644
--- a/src/gpu/d3d12/SDL_gpu_d3d12.c
+++ b/src/gpu/d3d12/SDL_gpu_d3d12.c
@@ -4827,6 +4827,8 @@ static void D3D12_DrawPrimitivesIndirect(
         offset,
         NULL,
         0);
+
+    D3D12_INTERNAL_TrackBuffer(d3d12CommandBuffer, d3d12Buffer);
 }
 
 static void D3D12_DrawIndexedPrimitivesIndirect(
@@ -4848,6 +4850,8 @@ static void D3D12_DrawIndexedPrimitivesIndirect(
         offset,
         NULL,
         0);
+
+    D3D12_INTERNAL_TrackBuffer(d3d12CommandBuffer, d3d12Buffer);
 }
 
 static void D3D12_EndRenderPass(
@@ -5303,6 +5307,8 @@ static void D3D12_DispatchComputeIndirect(
         offset,
         NULL,
         0);
+
+    D3D12_INTERNAL_TrackBuffer(d3d12CommandBuffer, d3d12Buffer);
 }
 
 static void D3D12_EndComputePass(