From f44dde89db5508b1f6426de18b2d55c64f48c545 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 18 Jan 2026 16:24:15 +0100 Subject: [PATCH] Fix missing vertex counting in draws (use index count to approx) --- Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp | 2 +- Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp | 2 +- Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp index 5e273304d..b3b15ab40 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp @@ -541,7 +541,7 @@ void GPUContextDX11::DrawIndexedInstanced(uint32 indicesCount, uint32 instanceCo { onDrawCall(); _context->DrawIndexedInstanced(indicesCount, instanceCount, startIndex, startVertex, startInstance); - RENDER_STAT_DRAW_CALL(0, indicesCount / 3 * instanceCount); + RENDER_STAT_DRAW_CALL(indicesCount * instanceCount, indicesCount / 3 * instanceCount); } void GPUContextDX11::DrawInstancedIndirect(GPUBuffer* bufferForArgs, uint32 offsetForArgs) diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp index eb654bb07..3ab774964 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUContextDX12.cpp @@ -1246,7 +1246,7 @@ void GPUContextDX12::DrawIndexedInstanced(uint32 indicesCount, uint32 instanceCo { OnDrawCall(); _commandList->DrawIndexedInstanced(indicesCount, instanceCount, startIndex, startVertex, startInstance); - RENDER_STAT_DRAW_CALL(0, indicesCount / 3 * instanceCount); + RENDER_STAT_DRAW_CALL(indicesCount * instanceCount, indicesCount / 3 * instanceCount); } void GPUContextDX12::DrawInstancedIndirect(GPUBuffer* bufferForArgs, uint32 offsetForArgs) diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp index cd11ef534..961672f23 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp @@ -1277,7 +1277,7 @@ void GPUContextVulkan::DrawIndexedInstanced(uint32 indicesCount, uint32 instance OnDrawCall(); const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer(); vkCmdDrawIndexed(cmdBuffer->GetHandle(), indicesCount, instanceCount, startIndex, startVertex, startInstance); - RENDER_STAT_DRAW_CALL(0, indicesCount / 3 * instanceCount); + RENDER_STAT_DRAW_CALL(indicesCount * instanceCount, indicesCount / 3 * instanceCount); } void GPUContextVulkan::DrawInstancedIndirect(GPUBuffer* bufferForArgs, uint32 offsetForArgs)