Add Graphics.TestValue general purpose utility for A/B testing features and perf in shaders during development

This commit is contained in:
Wojtek Figat
2026-01-16 12:48:05 +01:00
parent 593646061e
commit baf068330c
4 changed files with 18 additions and 1 deletions

View File

@@ -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);