103 lines
2.9 KiB
HLSL
103 lines
2.9 KiB
HLSL
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "../Common.ush"
|
|
#include "../ShaderPrint.ush"
|
|
#include "LumenRadianceCacheUpdate.ush"
|
|
|
|
uint MaxNumProbes;
|
|
StructuredBuffer<uint> PriorityHistogram;
|
|
StructuredBuffer<uint> MaxUpdateBucket;
|
|
StructuredBuffer<uint> MaxTracesFromMaxUpdateBucket;
|
|
StructuredBuffer<uint> ProbesToUpdateTraceCost;
|
|
StructuredBuffer<uint> MinNewProbeTraceCost;
|
|
Buffer<uint> ProbeTraceAllocator;
|
|
Buffer<uint> ProbeTraceTileAllocator;
|
|
Buffer<uint> ProbeFreeListAllocator;
|
|
Buffer<uint> ProbeAllocator;
|
|
|
|
/**
|
|
* Print out various stats for debugging radiance cache probe updates
|
|
*/
|
|
[numthreads(THREADGROUP_SIZE, 1, 1)]
|
|
void RadianceCacheUpdateStatsCS(
|
|
uint3 GroupId : SV_GroupID,
|
|
uint3 GroupThreadId : SV_GroupThreadID,
|
|
uint3 DispatchThreadId : SV_DispatchThreadID)
|
|
{
|
|
if (all(DispatchThreadId == 0))
|
|
{
|
|
FShaderPrintContext Context = InitShaderPrintContext(true, float2(0.1, 0.1));
|
|
Newline(Context);
|
|
|
|
LOOP
|
|
for (uint BucketIndex = 0; BucketIndex < PRIORITY_HISTOGRAM_SIZE; ++BucketIndex)
|
|
{
|
|
Print(Context, PriorityHistogram[BucketIndex]);
|
|
|
|
if ((BucketIndex + 1) % 8 == 0)
|
|
{
|
|
Newline(Context);
|
|
}
|
|
else
|
|
{
|
|
PrintSymbol(Context, _SPC_);
|
|
}
|
|
}
|
|
|
|
const uint MaxUpdateBucketIndex = MaxUpdateBucket[0];
|
|
const uint LocalMaxTracesFromMaxUpdateBucket = MaxTracesFromMaxUpdateBucket[0];
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT("MaxBucket "));
|
|
Print(Context, MaxUpdateBucketIndex);
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT("MaxTracesFromMaxUpdateBucket "));
|
|
Print(Context, LocalMaxTracesFromMaxUpdateBucket);
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT("Out "));
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT(" TraceCost "));
|
|
Print(Context, ProbesToUpdateTraceCost[0],
|
|
Select(ProbesToUpdateTraceCost[0] > 2 * GetProbeTraceCostBudget(), FontRed,
|
|
Select(ProbesToUpdateTraceCost[0] > GetProbeTraceCostBudget(), FontYellow, FontWhite)));
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT(" TraceCostFromMaxUpdateBucket: "));
|
|
Print(Context, ProbesToUpdateTraceCost[1]);
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT(" Min New Probe Trace Cost: "));
|
|
Print(Context, MinNewProbeTraceCost[0]);
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT(" Traced Probes: "));
|
|
Print(Context, ProbeTraceAllocator[0]);
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT(" Traced tiles/4: "));
|
|
Print(Context, ProbeTraceTileAllocator[0] / 4, Select(ProbeTraceTileAllocator[0] > GetProbeTraceCostBudget(), FontRed, FontWhite));
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT(" Traced tiles: "));
|
|
Print(Context, ProbeTraceTileAllocator[0]);
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT("MaxProbesInAtlas "));
|
|
Print(Context, MaxNumProbes);
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT("ProbesInAtlas "));
|
|
Print(Context, ProbeAllocator[0] - ProbeFreeListAllocator[0]);
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT("Allocator "));
|
|
Print(Context, ProbeAllocator[0]);
|
|
|
|
Newline(Context);
|
|
Print(Context, TEXT("FreeList "));
|
|
Print(Context, ProbeFreeListAllocator[0]);
|
|
}
|
|
} |