Files
UnrealEngineUWP/Engine/Source/Runtime/Renderer/Private/SceneTextureReductions.h
yuriy odonnell 369f054047 Add CVar r.SceneDepthHZBAsyncCompute to run HZB generation on async compute
* This avoids GPU under-utilization in scenes where a very large number of individual occlusion queries is issued
* Possible r.SceneDepthHZBAsyncCompute values:
  * 0: Don't use async compute (default)
  * 1: Use async compute, start as soon as possible
  * 2: Use async compute, start after ComputeLightGrid.CompactLinks pass

#preflight 636c555f7c2b5051903a24ca
#rb Graham.Wihlidal

[CL 23072519 by yuriy odonnell in ue5-main branch]
2022-11-10 03:03:38 -05:00

42 lines
1.2 KiB
C

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ScenePrivate.h"
#include "RenderGraph.h"
#include "SceneTextureParameters.h"
struct FBuildHZBAsyncComputeParams
{
FRDGPassRef Prerequisite = nullptr;
};
static constexpr EPixelFormat BuildHZBDefaultPixelFormat = PF_R16F;
void BuildHZB(
FRDGBuilder& GraphBuilder,
FRDGTextureRef SceneDepth,
FRDGTextureRef VisBufferTexture,
const FIntRect ViewRect,
ERHIFeatureLevel::Type FeatureLevel,
EShaderPlatform ShaderPlatform,
const TCHAR* ClosestHZBName,
FRDGTextureRef* OutClosestHZBTexture,
const TCHAR* FurthestHZBName,
FRDGTextureRef* OutFurthestHZBTexture,
EPixelFormat Format = BuildHZBDefaultPixelFormat,
const FBuildHZBAsyncComputeParams* AsyncComputeParams = nullptr);
// Build only the furthest HZB
void BuildHZBFurthest(
FRDGBuilder& GraphBuilder,
FRDGTextureRef SceneDepth,
FRDGTextureRef VisBufferTexture,
const FIntRect ViewRect,
ERHIFeatureLevel::Type FeatureLevel,
EShaderPlatform ShaderPlatform,
const TCHAR* FurthestHZBName,
FRDGTextureRef* OutFurthestHZBTexture,
EPixelFormat Format = BuildHZBDefaultPixelFormat,
const FBuildHZBAsyncComputeParams* AsyncComputeParams = nullptr);