Add Graphics::SpreadWorkload to disable graphics workloads amortization over several frames when debugging graphics perf

This commit is contained in:
Wojtek Figat
2024-06-19 14:03:55 +02:00
parent 0d48ac8fc2
commit 9c161121b3
6 changed files with 24 additions and 4 deletions

View File

@@ -22,6 +22,7 @@ bool Graphics::AllowCSMBlending = false;
Quality Graphics::GlobalSDFQuality = Quality::High;
Quality Graphics::GIQuality = Quality::High;
PostProcessSettings Graphics::PostProcessSettings;
bool Graphics::SpreadWorkload = true;
#if GRAPHICS_API_NULL
extern GPUDevice* CreateGPUDeviceNull();

View File

@@ -69,9 +69,22 @@ public:
/// </summary>
API_FIELD() static PostProcessSettings PostProcessSettings;
public:
/// <summary>
/// Debug utility to toggle graphics workloads amortization over several frames by systems such as shadows mapping, global illumination or surface atlas. Can be used to test performance in the worst-case scenario (eg. camera-cut).
/// </summary>
API_FIELD() static bool SpreadWorkload;
public:
/// <summary>
/// Disposes the device.
/// </summary>
static void DisposeDevice();
};
// Skip disabling workload spreading in Release builds
#if BUILD_RELEASE
#define GPU_SPREAD_WORKLOAD true
#else
#define GPU_SPREAD_WORKLOAD Graphics::SpreadWorkload
#endif