From 3296337f40d1dfe217f2baf1b4a398aa9e309d07 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Fri, 19 Jul 2024 14:26:19 +0200 Subject: [PATCH] Add `SetStablePowerState` for D3D12 when doing shaders profiling --- .../Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.cpp index 9f024136a..a33cd8194 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUDeviceDX12.cpp @@ -423,9 +423,12 @@ bool GPUDeviceDX12::Init() } } -#if BUILD_DEBUG && false +#if !BUILD_RELEASE // Prevent the GPU from overclocking or under-clocking to get consistent timings - _device->SetStablePowerState(TRUE); + if (CommandLine::Options.ShaderProfile) + { + _device->SetStablePowerState(TRUE); + } #endif // Setup resources