SDL: Fixed bug #4671 - D3D_QueueGeometry: use "count / 3" (Thanks alittlesail!)

From e426bb80cb8c9c04737c980552a6cc3126b694b7 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Fri, 20 Aug 2021 07:50:30 +0200
Subject: [PATCH] Fixed bug #4671 - D3D_QueueGeometry: use "count / 3" (Thanks
 alittlesail!)

---
 src/render/direct3d/SDL_render_d3d.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c
index f4d06f5a76..f57598bd0d 100644
--- a/src/render/direct3d/SDL_render_d3d.c
+++ b/src/render/direct3d/SDL_render_d3d.c
@@ -1493,10 +1493,10 @@ D3D_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *verti
                 const size_t first = cmd->data.draw.first;
                 SetDrawState(data, cmd);
                 if (vbo) {
-                    IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLELIST, (UINT) (first / sizeof (Vertex)), (UINT) count);
+                    IDirect3DDevice9_DrawPrimitive(data->device, D3DPT_TRIANGLELIST, (UINT) (first / sizeof (Vertex)), (UINT) count / 3);
                 } else {
                     const Vertex* verts = (Vertex*)(((Uint8*)vertices) + first);
-                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLELIST, (UINT) count, verts, sizeof(Vertex));
+                    IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLELIST, (UINT) count / 3, verts, sizeof(Vertex));
                 }
 #endif
                 break;