bRequiresExplicit128bitRT

bRequiresExplicit128bitRT

#Overview

name: bRequiresExplicit128bitRT

The value of this variable can be defined or overridden in .ini config files. 2 .ini config files referencing this setting variable.

It is referenced in 7 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bRequiresExplicit128bitRT is to indicate whether the rendering system requires explicit 128-bit render targets. This setting is used in the rendering pipeline to determine the appropriate format and handling of render targets.

This setting variable is primarily used in the Unreal Engine’s rendering subsystem, specifically in the base pass rendering and tile rendering modules. It’s also referenced in the RHI (Rendering Hardware Interface) module, which suggests its importance in low-level graphics operations.

The value of this variable is set in multiple places:

  1. In the FCanvasTileRendererItem::Render_GameThread function, it’s determined based on the format of the canvas render target texture.
  2. In the FGenericDataDrivenShaderPlatformInfo class, it’s parsed from data-driven shader information.
  3. In the FBasePassMeshProcessor constructor, it’s set based on input flags.

This variable interacts with other rendering-related variables and functions, such as CanvasRenderTarget, PlatformRequires128bitRT, and various shader and material-related settings.

Developers must be aware that this setting can affect rendering performance and quality. Using 128-bit render targets increases memory usage and potentially impacts performance, but may be necessary for certain high-precision rendering scenarios.

Best practices when using this variable include:

  1. Only enable it when absolutely necessary for the desired visual quality or when required by the target hardware.
  2. Consider the performance implications, especially on lower-end devices.
  3. Test thoroughly on various hardware configurations to ensure compatibility and performance.
  4. Use in conjunction with other rendering settings to achieve the best balance between quality and performance.
  5. Be aware of the platform-specific requirements, as some platforms may always require or never support 128-bit render targets.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:90, section: [ShaderPlatform VULKAN_SM5]

Location: <Workspace>/Engine/Config/VulkanPC/DataDrivenPlatformInfo.ini:209, section: [ShaderPlatform VULKAN_SM6]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/TileRendering.cpp:286

Scope (from outer to inner):

file
function     bool FCanvasTileRendererItem::Render_GameThread

Source code excerpt:

		const bool bDeleteOnRender = Canvas->GetAllowedModes() & FCanvas::Allow_DeleteOnRender;

		bool bRequiresExplicit128bitRT = false;

		FTexture2DRHIRef CanvasRTTexture = CanvasRenderTarget->GetRenderTargetTexture();
		if (CanvasRTTexture)
		{
			bRequiresExplicit128bitRT = PlatformRequires128bitRT(CanvasRTTexture->GetFormat());
		}

		RenderScope.EnqueueRenderCommand(
			[LocalData = Data, View, bIsHitTesting, bRequiresExplicit128bitRT]
			(FCanvasRenderContext& RenderContext) mutable
		{
			FMeshPassProcessorRenderState DrawRenderState;

			// disable depth test & writes
			DrawRenderState.SetDepthStencilState(TStaticDepthStencilState<false, CF_Always>::GetRHI());

			LocalData->RenderTiles(RenderContext, DrawRenderState, *View, bIsHitTesting, bRequiresExplicit128bitRT);

			RenderContext.DeferredRelease(MoveTemp(LocalData));
			RenderContext.DeferredDelete(View->Family);
			RenderContext.DeferredDelete(View);
		});

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/DataDrivenShaderPlatformInfo.cpp:244

Scope (from outer to inner):

file
function     void FGenericDataDrivenShaderPlatformInfo::ParseDataDrivenShaderInfo

Source code excerpt:

	GET_SECTION_INT_HELPER(MinimumWaveSize);
	GET_SECTION_INT_HELPER(MaximumWaveSize);
	GET_SECTION_BOOL_HELPER(bRequiresExplicit128bitRT);
	GET_SECTION_BOOL_HELPER(bSupportsGen5TemporalAA);
	GET_SECTION_BOOL_HELPER(bTargetsTiledGPU);
	GET_SECTION_BOOL_HELPER(bNeedsOfflineCompiler);
	GET_SECTION_BOOL_HELPER(bSupportsComputeFramework);
	GET_SECTION_BOOL_HELPER(bSupportsAnisotropicMaterials);
	GET_SECTION_BOOL_HELPER(bSupportsDualSourceBlending);

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:68

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo

Source code excerpt:

	uint32 bSupportsIntrinsicWaveOnce : 1;
	uint32 bSupportsConservativeRasterization : 1;
	uint32 bRequiresExplicit128bitRT : 1;
	uint32 bSupportsGen5TemporalAA : 1;
	uint32 bTargetsTiledGPU : 1;
	uint32 bNeedsOfflineCompiler : 1;
	uint32 bSupportsComputeFramework : 1;
	uint32 bSupportsAnisotropicMaterials : 1;
	uint32 bSupportsDualSourceBlending : 1;

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/DataDrivenShaderPlatformInfo.h:461

Scope (from outer to inner):

file
class        class FGenericDataDrivenShaderPlatformInfo
function     static const bool GetRequiresExplicit128bitRT

Source code excerpt:

	{
		check(IsValid(Platform));
		return Infos[Platform].bRequiresExplicit128bitRT;
	}

	static FORCEINLINE_DEBUGGABLE const bool GetSupportsPrimitiveShaders(const FStaticShaderPlatform Platform)
	{
		check(IsValid(Platform));
		return Infos[Platform].bSupportsPrimitiveShaders;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.cpp:2454

Scope (from outer to inner):

file
function     FBasePassMeshProcessor::FBasePassMeshProcessor

Source code excerpt:

	, bEnableReceiveDecalOutput((Flags & EFlags::CanUseDepthStencil) == EFlags::CanUseDepthStencil)
	, EarlyZPassMode(Scene ? Scene->EarlyZPassMode : DDM_None)
	, bRequiresExplicit128bitRT((Flags & EFlags::bRequires128bitRT) == EFlags::bRequires128bitRT)
{
	if (InTranslucencyPassType != ETranslucencyPass::TPT_MAX && InViewIfDynamicMeshCommand && ViewIfDynamicMeshCommand->bIsViewInfo)
	{
		const FViewInfo* ViewInfo = (FViewInfo*)ViewIfDynamicMeshCommand;
		if (InTranslucencyPassType == ETranslucencyPass::TPT_TranslucencyStandard ||
			InTranslucencyPassType == ETranslucencyPass::TPT_TranslucencyAfterDOF ||

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.h:834

Scope (from outer to inner):

file
class        class FBasePassMeshProcessor : public FSceneRenderingAllocatorObject<FBasePassMeshProcessor>, public FMeshPassProcessor
function     void Set128BitRequirement

Source code excerpt:

	FORCEINLINE_DEBUGGABLE void Set128BitRequirement(const bool Required)
	{
		bRequiresExplicit128bitRT = Required;
	}

	FORCEINLINE_DEBUGGABLE bool Get128BitRequirement() const
	{
		return bRequiresExplicit128bitRT;
	}

	static ELightMapPolicyType GetUniformLightMapPolicyType(ERHIFeatureLevel::Type FeatureLevelconst, const FScene* Scene, const FLightCacheInterface* LCI, const FPrimitiveSceneProxy* RESTRICT PrimitiveSceneProxy, const FMaterial& Material);
	static TArray<ELightMapPolicyType, TInlineAllocator<2>> GetUniformLightMapPolicyTypeForPSOCollection(ERHIFeatureLevel::Type FeatureLevel, const FMaterial& Material);

	template<typename PassShadersType>

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/BasePassRendering.h:962

Scope (from outer to inner):

file
class        class FBasePassMeshProcessor : public FSceneRenderingAllocatorObject<FBasePassMeshProcessor>, public FMeshPassProcessor

Source code excerpt:

	const bool bEnableReceiveDecalOutput;
	EDepthDrawingMode EarlyZPassMode;
	bool bRequiresExplicit128bitRT;
	float AutoBeforeDOFTranslucencyBoundary = 0.0f;
};

ENUM_CLASS_FLAGS(FBasePassMeshProcessor::EFlags);

extern void SetupBasePassState(FExclusiveDepthStencil::Type BasePassDepthStencilAccess, const bool bShaderComplexity, FMeshPassProcessorRenderState& DrawRenderState);