Add Graphics.TestValue general purpose utility for A/B testing features and perf in shaders during development
This commit is contained in:
@@ -29,6 +29,9 @@ bool Graphics::GICascadesBlending = false;
|
||||
PostProcessSettings Graphics::PostProcessSettings;
|
||||
bool Graphics::GammaColorSpace = true;
|
||||
bool Graphics::SpreadWorkload = true;
|
||||
#if !BUILD_RELEASE && !USE_EDITOR
|
||||
float Graphics::TestValue = 0.0f;
|
||||
#endif
|
||||
bool Graphics::PostProcessing::ColorGradingVolumeLUT = true;
|
||||
|
||||
#if GRAPHICS_API_NULL
|
||||
|
||||
@@ -90,6 +90,16 @@ public:
|
||||
/// </summary>
|
||||
API_FIELD() static bool SpreadWorkload;
|
||||
|
||||
#if BUILD_RELEASE && !USE_EDITOR
|
||||
/// <summary>Unused.</summary>
|
||||
API_FIELD() static constexpr float TestValue = 0.0f;
|
||||
#else
|
||||
/// <summary>
|
||||
/// Debug utility to control visual or rendering features during development. For example, can be used to branch different code paths in shaders for A/B testing (perf or quality).
|
||||
/// </summary>
|
||||
API_FIELD() static float TestValue;
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Post Processing effects rendering configuration.
|
||||
API_CLASS(Static, Attributes = "DebugCommand") class FLAXENGINE_API PostProcessing
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "Engine/Serialization/MemoryReadStream.h"
|
||||
#include "Engine/Level/LargeWorlds.h"
|
||||
#include "Engine/Renderer/RenderList.h"
|
||||
#include "Engine/Graphics/Graphics.h"
|
||||
#include "Engine/Graphics/RenderTask.h"
|
||||
#include "Engine/Graphics/GPUDevice.h"
|
||||
#include "Engine/Graphics/GPUContext.h"
|
||||
@@ -38,6 +39,7 @@ GPU_CB_STRUCT(MaterialShaderDataPerView {
|
||||
Float3 LargeWorldsChunkIndex;
|
||||
float LargeWorldsChunkSize;
|
||||
Float3 ViewPadding0;
|
||||
float TestValue;
|
||||
float ScaledTimeParam;
|
||||
});
|
||||
|
||||
@@ -89,6 +91,7 @@ void IMaterial::BindParameters::BindViewData()
|
||||
cb.TemporalAAJitter = view.TemporalAAJitter;
|
||||
cb.LargeWorldsChunkIndex = LargeWorlds::Enable ? (Float3)Int3(view.Origin / LargeWorlds::ChunkSize) : Float3::Zero;
|
||||
cb.LargeWorldsChunkSize = LargeWorlds::ChunkSize;
|
||||
cb.TestValue = Graphics::TestValue;
|
||||
|
||||
// Update constants
|
||||
GPUContext->UpdateCB(PerViewConstants, &cb);
|
||||
|
||||
Reference in New Issue
Block a user