r.FastVRam.GBufferA

r.FastVRam.GBufferA

#Overview

name: r.FastVRam.GBufferA

This variable is created as a Console Variable (cvar).

It is referenced in 54 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.FastVRam.GBufferA is to control the allocation of the GBufferA texture in fast VRAM (Video RAM) on supported GPU architectures. This setting is part of Unreal Engine’s rendering system, specifically related to the deferred shading pipeline and G-Buffer management.

Key points about r.FastVRam.GBufferA:

  1. It’s used by the renderer subsystem, particularly in the deferred shading pipeline.

  2. The value of this variable is set through a console variable (CVar) system, with a default value of 0.

  3. It interacts with other similar variables for other G-Buffer textures (GBufferB, GBufferC, etc.).

  4. The variable is used to add additional flags when creating the GBufferA texture.

  5. Developers should be aware that enabling this option may impact VRAM usage and potentially affect performance on some hardware.

  6. Best practices include carefully considering the trade-offs between performance and memory usage when adjusting this setting.

The associated variable GBufferA is used throughout the engine to refer to the actual texture resource for the first G-Buffer. It’s used in various rendering passes, including:

  1. Deferred shading
  2. Post-processing effects
  3. Global illumination
  4. Decal rendering
  5. Pixel inspection tools

GBufferA typically stores surface normals and other material properties, depending on the specific G-Buffer layout used in the project.

When working with GBufferA, developers should:

  1. Understand the data stored in this texture and how it’s used in the rendering pipeline.
  2. Be cautious when modifying or accessing this texture, as it’s a critical part of the deferred rendering process.
  3. Consider the performance implications of reading from or writing to this texture in custom shaders.
  4. Be aware of the format and precision of the data stored in GBufferA, as it can affect rendering quality and performance.

In summary, r.FastVRam.GBufferA and GBufferA are important components of Unreal Engine’s rendering system, particularly for deferred shading. Proper understanding and use of these variables can help optimize rendering performance and quality in your projects.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:459

Scope: file

Source code excerpt:

#define FASTVRAM_CVAR(Name,DefaultValue) static TAutoConsoleVariable<int32> CVarFastVRam_##Name(TEXT("r.FastVRam."#Name), DefaultValue, TEXT(""))

FASTVRAM_CVAR(GBufferA, 0);
FASTVRAM_CVAR(GBufferB, 1);
FASTVRAM_CVAR(GBufferC, 0);
FASTVRAM_CVAR(GBufferD, 0);
FASTVRAM_CVAR(GBufferE, 0);
FASTVRAM_CVAR(GBufferF, 0);
FASTVRAM_CVAR(GBufferVelocity, 0);

#Associated Variable and Callsites

This variable is associated with another variable named GBufferA. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/TextureShare/Source/TextureShare/Private/Game/ViewExtension/TextureShareSceneViewExtension.cpp:148

Scope (from outer to inner):

file
function     void FTextureShareSceneViewExtension::ShareSceneViewColors_RenderThread

Source code excerpt:

	AddShareTexturePass(UE::TextureShareStrings::SceneTextures::SmallDepthZ, SceneTextures.SmallDepth, &SmallDepthRect);

	AddShareTexturePass(UE::TextureShareStrings::SceneTextures::GBufferA, SceneTextures.GBufferA);
	AddShareTexturePass(UE::TextureShareStrings::SceneTextures::GBufferB, SceneTextures.GBufferB);
	AddShareTexturePass(UE::TextureShareStrings::SceneTextures::GBufferC, SceneTextures.GBufferC);
	AddShareTexturePass(UE::TextureShareStrings::SceneTextures::GBufferD, SceneTextures.GBufferD);
	AddShareTexturePass(UE::TextureShareStrings::SceneTextures::GBufferE, SceneTextures.GBufferE);
	AddShareTexturePass(UE::TextureShareStrings::SceneTextures::GBufferF, SceneTextures.GBufferF);
}

#Loc: <Workspace>/Engine/Plugins/VirtualProduction/TextureShare/Source/TextureShare/Private/Misc/TextureShareStrings.h:16

Scope (from outer to inner):

file
namespace    UE::TextureShareStrings::SceneTextures

Source code excerpt:

	static constexpr auto SceneDepth = TEXT("SceneDepth");
	static constexpr auto SmallDepthZ = TEXT("SmallDepthZ");
	static constexpr auto GBufferA = TEXT("GBufferA");
	static constexpr auto GBufferB = TEXT("GBufferB");
	static constexpr auto GBufferC = TEXT("GBufferC");
	static constexpr auto GBufferD = TEXT("GBufferD");
	static constexpr auto GBufferE = TEXT("GBufferE");
	static constexpr auto GBufferF = TEXT("GBufferF");

#Loc: <Workspace>/Engine/Source/Editor/PixelInspector/Private/PixelInspector.h:131

Scope (from outer to inner):

file
namespace    PixelInspector
class        class SPixelInspector : public SCompoundWidget, public FNotifyHook

Source code excerpt:

		/** 
		 * Create the necessary rendertarget buffers for a request and set the render scene data.
		 * First created buffer (1x1) is for the normal (GBufferA) which can be of the following format: PF_FloatRGBA PF_B8G8R8A8 or PF_A2B10G10R10, depending on the precision settings
		 * Second created buffer (1x4) is for the other data (GBuffer B, C, D and E) which can be of the following format: PF_FloatRGBA or PF_B8G8R8A8, depending on the precision settings
		 *
		 * GBufferFormat: 0(Low RGB8), 1 (default), 5(float)
		 *
		 * Return a unique Index to allow the request to know how to find them in the FPixelInspectorData at the post process time when sending the read buffer graphic commands.
		 */
		int32 CreateRequestBuffer(FSceneInterface *SceneInterface, const int32 GBufferFormat, bool bInGameViewMode);

		/**
		 * Release all Ubuffer with the BufferIndex so the garbage collector will destroy them.
		 */
		void ReleaseBuffers(int32 BufferIndex);

		void OnLevelActorDeleted(AActor* Actor);

#Loc: <Workspace>/Engine/Source/Editor/PixelInspector/Private/PixelInspector.h:179

Scope (from outer to inner):

file
namespace    PixelInspector
class        class SPixelInspector : public SCompoundWidget, public FNotifyHook

Source code excerpt:

		UTextureRenderTarget2D* Buffer_SceneColorBeforePost_Float[2];
		UTextureRenderTarget2D* Buffer_SceneColorBeforeToneMap_Float[2];
		//GBufferA RenderTarget
		UTextureRenderTarget2D* Buffer_A_Float[2];
		UTextureRenderTarget2D* Buffer_A_RGB8[2];
		UTextureRenderTarget2D* Buffer_A_RGB10[2];
		//GBuffer BCDE RenderTarget
		UTextureRenderTarget2D* Buffer_BCDEF_Float[2];
		UTextureRenderTarget2D* Buffer_BCDEF_RGB8[2];

#Loc: <Workspace>/Engine/Source/Editor/PixelInspector/Private/PixelInspectorResult.h:94

Scope (from outer to inner):

file
namespace    PixelInspector
class        class PixelInspectorResult

Source code excerpt:

		//////////////////////////////////////////////////////////////////////////
		//Buffers value
		FVector Normal; //GBufferA RGB
		float PerObjectGBufferData; //GBufferA A
		float Metallic; //GBufferB R
		float Specular; //GBufferB G
		float Roughness; //GBufferB B
		EMaterialShadingModel ShadingModel; //GBufferB A encode
		int32 SelectiveOutputMask; //GBufferB A encode
		FLinearColor BaseColor; //GBufferC RGB

#Loc: <Workspace>/Engine/Source/Editor/PixelInspector/Private/PixelInspectorView.h:45

Scope (from outer to inner):

file
class        class UPixelInspectorView : public UObject

Source code excerpt:

	float LuminanceBeforeTonemap;

	/** From the GBufferA RGB Channels. */
	UPROPERTY(VisibleAnywhere, category = GBufferA)
	FVector Normal;

	/** From the GBufferA A Channel. */
	UPROPERTY(VisibleAnywhere, category = GBufferA)
	float PerObjectGBufferData;

	/** From the GBufferB R Channel. */
	UPROPERTY(VisibleAnywhere, category = GBufferB)
	float Metallic;

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneTexturesConfig.cpp:234

Scope (from outer to inner):

file
function     static void SetupMobileGBufferFlags

Source code excerpt:

		FGBufferBindings& Bindings = GBufferBindings[Layout];

		Bindings.GBufferA.Flags |= AddFlags;
		Bindings.GBufferB.Flags |= AddFlags;
		Bindings.GBufferC.Flags |= AddFlags;
		Bindings.GBufferD.Flags |= AddFlags;
		Bindings.GBufferE.Flags |= AddFlags;
		
		Bindings.GBufferA.Flags &= (~RemoveFlags);
		Bindings.GBufferB.Flags &= (~RemoveFlags);
		Bindings.GBufferC.Flags &= (~RemoveFlags);
		Bindings.GBufferD.Flags &= (~RemoveFlags);
		Bindings.GBufferE.Flags &= (~RemoveFlags);

		// Input attachments with PF_R8G8B8A8 has better support on mobile than PF_B8G8R8A8
		auto OverrideB8G8R8A8 = [](FGBufferBinding& Binding) { if (Binding.Format == PF_B8G8R8A8) Binding.Format = PF_R8G8B8A8; };
		OverrideB8G8R8A8(Bindings.GBufferA);
		OverrideB8G8R8A8(Bindings.GBufferB);
		OverrideB8G8R8A8(Bindings.GBufferC);
		OverrideB8G8R8A8(Bindings.GBufferD);
		OverrideB8G8R8A8(Bindings.GBufferE);
	}
}

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneTexturesConfig.cpp:296

Scope (from outer to inner):

file
function     void FSceneTexturesConfig::Init

Source code excerpt:

				const FGBufferInfo GBufferInfo = FetchFullGBufferInfo(GBufferParams[Layout]);

				BindingCache.Bindings[Layout].GBufferA = FindGBufferBindingByName(GBufferInfo, TEXT("GBufferA"), ShaderPlatform);
				BindingCache.Bindings[Layout].GBufferB = FindGBufferBindingByName(GBufferInfo, TEXT("GBufferB"), ShaderPlatform);
				BindingCache.Bindings[Layout].GBufferC = FindGBufferBindingByName(GBufferInfo, TEXT("GBufferC"), ShaderPlatform);
				BindingCache.Bindings[Layout].GBufferD = FindGBufferBindingByName(GBufferInfo, TEXT("GBufferD"), ShaderPlatform);
				BindingCache.Bindings[Layout].GBufferE = FindGBufferBindingByName(GBufferInfo, TEXT("GBufferE"), ShaderPlatform);
				BindingCache.Bindings[Layout].GBufferVelocity = FindGBufferBindingByName(GBufferInfo, TEXT("Velocity"), ShaderPlatform);

#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneTexturesConfig.cpp:361

Scope (from outer to inner):

file
function     uint32 FSceneTexturesConfig::GetGBufferRenderTargetsInfo

Source code excerpt:


		const FGBufferBindings& Bindings = GBufferBindings[Layout];
		IncludeBindingIfValid(Bindings.GBufferA);
		IncludeBindingIfValid(Bindings.GBufferB);
		IncludeBindingIfValid(Bindings.GBufferC);
		IncludeBindingIfValid(Bindings.GBufferD);
		IncludeBindingIfValid(Bindings.GBufferE);
		IncludeBindingIfValid(Bindings.GBufferVelocity);
	}

#Loc: <Workspace>/Engine/Source/Runtime/RHI/Private/RHIValidation.cpp:44

Scope (from outer to inner):

file
namespace    RHIValidation

Source code excerpt:

	// Returns an array of resource names parsed from the "-RHIValidationLog" command line switch.
	// RHI validation logging is automatically enabled for resources whose debug names match those in this list.
	// Multiple values are comma separated, e.g. -RHIValidationLog="SceneDepthZ,GBufferA"
	static TArray<FString> const& GetAutoLogResourceNames()
	{
		struct FInit
		{
			TArray<FString> Strings;

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/GBufferInfo.cpp:202

Scope: file

Source code excerpt:

 * if (SrcGlobal.GBUFFER_HAS_VELOCITY == 0 && SrcGlobal.GBUFFER_HAS_TANGENT == 0)
 *    0: Lighting
 *    1: GBufferA
 *    2: GBufferB
 *    3: GBufferC
 *    4: GBufferD
 *    if (GBUFFER_HAS_PRECSHADOWFACTOR)
 *        5: GBufferE
 * else if (SrcGlobal.GBUFFER_HAS_VELOCITY == 1 && SrcGlobal.GBUFFER_HAS_TANGENT == 0)
 *    0: Lighting
 *    1: GBufferA
 *    2: GBufferB
 *    3: GBufferC
 *    4: Velocity (NOTE!)
 *    5: GBufferD
 *    if (GBUFFER_HAS_PRECSHADOWFACTOR)
 *        6: GBufferE
 * else if (SrcGlobal.GBUFFER_HAS_VELOCITY == 0 && SrcGlobal.GBUFFER_HAS_TANGENT == 1)
 *    0: Lighting
 *    1: GBufferA
 *    2: GBufferB
 *    3: GBufferC
 *    4: GBufferF (NOTE!)
 *    5: GBufferD
 *    if (GBUFFER_HAS_PRECSHADOWFACTOR)
 *        6: GBufferE
 * else if (SrcGlobal.GBUFFER_HAS_VELOCITY == 1 && SrcGlobal.GBUFFER_HAS_TANGENT == 1)
 *    assert(0)
 *
*/

/*
 * LegacyFormatIndex: EGBufferFormat enum. Going forward, we will have better granularity on choosing precision, so thes
 *    are just being maintained for the transition.
 *
 * bUsesVelocityDepth: Normal velocity format is half16 for RG. But when enabled, it changes to half16 RGBA with
 *    alpha storing depth and blue unused.
 *
 */

FGBufferInfo RENDERCORE_API FetchLegacyGBufferInfo(const FGBufferParams& Params)
{
	FGBufferInfo Info = {};

	check(!Params.bHasVelocity || !Params.bHasTangent);

	bool bStaticLighting = Params.bHasPrecShadowFactor;

	int32 TargetLighting = 0;
	int32 TargetGBufferA = 1;
	int32 TargetGBufferB = 2;
	int32 TargetGBufferC = 3;
	int32 TargetGBufferD = -1;
	int32 TargetGBufferE = -1;
	int32 TargetGBufferF = -1;
	int32 TargetVelocity = -1;
	int32 TargetSeparatedMainDirLight = -1;

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/GBufferInfo.cpp:356

Scope (from outer to inner):

file
function     FGBufferInfo FetchLegacyGBufferInfo

Source code excerpt:


	Info.Targets[0].Init(GBT_Unorm_11_11_10,  TEXT("Lighting"), false,  true,  true,  true);
	Info.Targets[1].Init(NormalGBufferFormatTarget,TEXT("GBufferA"), false,  true,  true,  true);
	Info.Targets[2].Init(DiffuseAndSpecularGBufferFormat,   TEXT("GBufferB"), false,  true,  true,  true);
	
	const bool bLegacyAlbedoSrgb = true;
	Info.Targets[3].Init(DiffuseAndSpecularGBufferFormat,  TEXT("GBufferC"), bLegacyAlbedoSrgb && !bHighPrecisionGBuffers,  true,  true,  true);

	// This code should match TBasePassPS

#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Public/GBufferInfo.h:271

Scope: file

Source code excerpt:

struct FGBufferBindings
{
	FGBufferBinding GBufferA;
	FGBufferBinding GBufferB;
	FGBufferBinding GBufferC;
	FGBufferBinding GBufferD;
	FGBufferBinding GBufferE;
	FGBufferBinding GBufferVelocity;
};

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Internal/SceneTextures.h:70

Scope: file

Source code excerpt:


	// (Deferred) Textures containing geometry information for deferred shading.
	FRDGTextureRef GBufferA{};
	FRDGTextureRef GBufferB{};
	FRDGTextureRef GBufferC{};
	FRDGTextureRef GBufferD{};
	FRDGTextureRef GBufferE{};
	FRDGTextureRef GBufferF{};

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:133

Scope (from outer to inner):

file
function     static FSSAOCommonParameters GetSSAOCommonParameters

Source code excerpt:


	CommonParameters.HZBInput = FScreenPassTexture(View.HZB);
	CommonParameters.GBufferA = bAllowGBufferRead ? FScreenPassTexture(SceneTextureParameters.GBufferATexture, View.ViewRect) : FScreenPassTexture();
	CommonParameters.SceneDepth = FScreenPassTexture(SceneTextureParameters.SceneDepthTexture, View.ViewRect);

	CommonParameters.Levels = Levels;
	CommonParameters.ShaderQuality = FSSAOHelper::GetAmbientOcclusionShaderLevel(View);
	CommonParameters.DownscaleType = GetDownscaleSSAOType(View);
	CommonParameters.FullscreenType = GetFullscreenSSAOType(View, Levels);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/CompositionLighting.cpp:470

Scope (from outer to inner):

file
function     static FScreenPassTexture AddPostProcessingAmbientOcclusion

Source code excerpt:

	}

	FScreenPassTexture SetupTexture = CommonParameters.GBufferA;
	if (Substrate::IsSubstrateEnabled())
	{
		// For Substrate, we invalidate the setup texture for the final pass:
		//	- We do not need GBufferA, the Substrate TopLayer texture will fill in for that.
		//	- Setting it to nullptr will make the AddAmbientOcclusionPass use a valid viewport from SceneTextures.
		SetupTexture.Texture = nullptr;
	}

	FScreenPassTexture FinalOutput =
		AddAmbientOcclusionFinalPass(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessAmbientOcclusion.h:113

Scope: file

Source code excerpt:


	FScreenPassTexture HZBInput;
	FScreenPassTexture GBufferA;
	FScreenPassTexture SceneDepth;

	uint32 Levels = 1;
	int32 ShaderQuality = 4;
	ESSAOType DownscaleType = ESSAOType::EPS;
	ESSAOType FullscreenType = ESSAOType::EPS;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.cpp:87

Scope (from outer to inner):

file
function     FDeferredDecalPassTextures GetDeferredDecalPassTextures

Source code excerpt:

	else
	{
		TextureReadAccess = ESceneTextureSetupMode::GBufferA | ESceneTextureSetupMode::SceneDepth | ESceneTextureSetupMode::CustomDepth;
	}

	SetupSceneTextureUniformParameters(GraphBuilder, &SceneTextures, View.FeatureLevel, TextureReadAccess, Parameters->SceneTextures);
	SetupMobileSceneTextureUniformParameters(GraphBuilder, &SceneTextures, MobileTextureReadAccess, Parameters->MobileSceneTextures);
	Parameters->EyeAdaptationBuffer = GraphBuilder.CreateSRV(GetEyeAdaptationBuffer(GraphBuilder, View));
	PassTextures.DecalPassUniformBuffer = GraphBuilder.CreateUniformBuffer(Parameters);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.cpp:101

Scope (from outer to inner):

file
function     FDeferredDecalPassTextures GetDeferredDecalPassTextures

Source code excerpt:

	if (!bIsMobile)
	{
		PassTextures.GBufferA = (*SceneTextures.UniformBuffer)->GBufferATexture;
		PassTextures.GBufferB = (*SceneTextures.UniformBuffer)->GBufferBTexture;
		PassTextures.GBufferC = (*SceneTextures.UniformBuffer)->GBufferCTexture;
		PassTextures.GBufferE = (*SceneTextures.UniformBuffer)->GBufferETexture;
	}

	PassTextures.DBufferTextures = DBufferTextures;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.cpp:123

Scope (from outer to inner):

file
function     void GetDeferredDecalRenderTargetsInfo

Source code excerpt:

	case EDecalRenderTargetMode::SceneColorAndGBuffer:
		AddRenderTargetInfo(Config.ColorFormat, Config.ColorCreateFlags, RenderTargetsInfo);
		AddRenderTargetInfo(Bindings.GBufferA.Format, Bindings.GBufferA.Flags, RenderTargetsInfo);
		AddRenderTargetInfo(Bindings.GBufferB.Format, Bindings.GBufferB.Flags, RenderTargetsInfo);
		AddRenderTargetInfo(Bindings.GBufferC.Format, Bindings.GBufferC.Flags, RenderTargetsInfo);
		break;
	case EDecalRenderTargetMode::SceneColorAndGBufferNoNormal:
		AddRenderTargetInfo(Config.ColorFormat, Config.ColorCreateFlags, RenderTargetsInfo);
		AddRenderTargetInfo(Bindings.GBufferB.Format, Bindings.GBufferB.Flags, RenderTargetsInfo);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.cpp:194

Scope (from outer to inner):

file
function     void GetDeferredDecalPassParameters

Source code excerpt:

	case EDecalRenderTargetMode::SceneColorAndGBuffer:
		AddColorTarget(Textures.Color);
		AddColorTarget(Textures.GBufferA);
		AddColorTarget(Textures.GBufferB);
		AddColorTarget(Textures.GBufferC);
		break;
	case EDecalRenderTargetMode::SceneColorAndGBufferNoNormal:
		AddColorTarget(Textures.Color);
		AddColorTarget(Textures.GBufferB);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.cpp:250

Scope (from outer to inner):

file
function     TUniformBufferRef<FDeferredDecalUniformParameters> CreateDeferredDecalUniformBuffer

Source code excerpt:

{
	const bool bIsMotionInDepth = FVelocityRendering::DepthPassCanOutputVelocity(View.GetFeatureLevel());
	// if we have early motion vectors (bIsMotionInDepth) and the cvar is enabled and we actually have a buffer from the previous frame (View.PrevViewInfo.GBufferA.IsValid())
	const bool bIsNormalReprojectionEnabled = (bIsMotionInDepth && CVarDBufferDecalNormalReprojectionEnabled.GetValueOnRenderThread() && View.PrevViewInfo.GBufferA.IsValid());

	FDeferredDecalUniformParameters UniformParameters;
	UniformParameters.NormalReprojectionThresholdLow  = CVarDBufferDecalNormalReprojectionThresholdLow .GetValueOnRenderThread();
	UniformParameters.NormalReprojectionThresholdHigh = CVarDBufferDecalNormalReprojectionThresholdHigh.GetValueOnRenderThread();
	UniformParameters.NormalReprojectionEnabled = bIsNormalReprojectionEnabled ? 1 : 0;
	

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.cpp:267

Scope (from outer to inner):

file
function     TUniformBufferRef<FDeferredDecalUniformParameters> CreateDeferredDecalUniformBuffer

Source code excerpt:

	UniformParameters.NormalReprojectionThresholdScaleHelper = 1.0f / Denom;

	UniformParameters.PreviousFrameNormal = (bIsNormalReprojectionEnabled) ? View.PrevViewInfo.GBufferA->GetRHI() : GSystemTextures.BlackDummy->GetRHI();

	UniformParameters.NormalReprojectionJitter = FVector2f(View.PrevViewInfo.ViewMatrices.GetTemporalAAJitter());

	return TUniformBufferRef<FDeferredDecalUniformParameters>::CreateUniformBufferImmediate(UniformParameters, UniformBuffer_SingleFrame);
}

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.cpp:748

Scope (from outer to inner):

file
function     void ExtractNormalsForNextFrameReprojection

Source code excerpt:

				if (Views[Index].bStatePrevViewInfoIsReadOnly == false)
				{
					GraphBuilder.QueueTextureExtraction(SceneTextures.GBufferA, &Views[Index].ViewState->PrevFrameViewInfo.GBufferA);
				}
			}
		}
	}
}

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.h:33

Scope: file

Source code excerpt:

	FRDGTextureRef Color = nullptr;
	FRDGTextureRef ScreenSpaceAO = nullptr;
	FRDGTextureRef GBufferA = nullptr;
	FRDGTextureRef GBufferB = nullptr;
	FRDGTextureRef GBufferC = nullptr;
	FRDGTextureRef GBufferE = nullptr;
	FDBufferTextures* DBufferTextures = nullptr;
};

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.cpp:2499

Scope (from outer to inner):

file
function     void FDeferredShadingSceneRenderer::Render

Source code excerpt:

		if (bUseGBuffer)
		{
			// mark GBufferA for saving for next frame if it's needed
			ExtractNormalsForNextFrameReprojection(GraphBuilder, SceneTextures, Views);
		}

		// Rebuild scene textures to include GBuffers.
		SceneTextures.SetupMode |= ESceneTextureSetupMode::GBuffers;
		if (bShouldRenderVelocities && (bBasePassCanOutputVelocity || Scene->EarlyZPassMode == DDM_AllOpaqueNoVelocity))

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.h:245

Scope (from outer to inner):

file
class        class FGlobalIlluminationPluginResources : public FRenderResource

Source code excerpt:

{
public:
	FRDGTextureRef GBufferA;
	FRDGTextureRef GBufferB;
	FRDGTextureRef GBufferC;
	FRDGTextureRef SceneDepthZ;
	FRDGTextureRef SceneColor;
	FRDGTextureRef LightingChannelsTexture;
};

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HairStrands/HairStrandsComposition.cpp:638

Scope (from outer to inner):

file
function     static void InternalRenderHairComposition

Source code excerpt:

		{
			const FSceneTextures& SceneTextures = View.GetSceneTextures();
			const FRDGTextureRef GBufferATexture = SceneTextures.GBufferA;
			const FRDGTextureRef GBufferBTexture = SceneTextures.GBufferB;
			const FRDGTextureRef GBufferCTexture = SceneTextures.GBufferC;
			const FRDGTextureRef GBufferDTexture = SceneTextures.GBufferD;
			const FRDGTextureRef GBufferETexture = SceneTextures.GBufferE;
			if (bWritePartialGBuffer && GBufferATexture && GBufferBTexture)
			{

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/HairStrands/HairStrandsRendering.cpp:186

Scope (from outer to inner):

file
function     void RenderHairBasePass

Source code excerpt:

				Scene, 
				View, 
				SceneTextures.GBufferA,
				SceneTextures.GBufferB,
				SceneTextures.GBufferC,
				SceneTextures.GBufferD,
				SceneTextures.GBufferE,
				SceneTextures.Color.Resolve,
				SceneTextures.Depth.Resolve,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IndirectLightRendering.cpp:1116

Scope (from outer to inner):

file
function     void FDeferredShadingSceneRenderer::RenderDiffuseIndirectAndAmbientOcclusion

Source code excerpt:

			// Get the resources and call the GI plugin's rendering function delegate
			FGlobalIlluminationPluginResources GIPluginResources;
			GIPluginResources.GBufferA = SceneTextures.GBufferA;
			GIPluginResources.GBufferB = SceneTextures.GBufferB;
			GIPluginResources.GBufferC = SceneTextures.GBufferC;
			GIPluginResources.LightingChannelsTexture = LightingChannelsTexture;
			GIPluginResources.SceneDepthZ = SceneTextures.Depth.Target;
			GIPluginResources.SceneColor = SceneTextures.Color.Target;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/IndirectLightRendering.cpp:2228

Scope (from outer to inner):

file
function     void FDeferredShadingSceneRenderer::RenderGlobalIlluminationPluginVisualizations

Source code excerpt:

	// Get the resources passed to GI plugins
	FGlobalIlluminationPluginResources GIPluginResources;
	GIPluginResources.GBufferA = SceneTextures.GBufferA;
	GIPluginResources.GBufferB = SceneTextures.GBufferB;
	GIPluginResources.GBufferC = SceneTextures.GBufferC;
	GIPluginResources.LightingChannelsTexture = LightingChannelsTexture;
	GIPluginResources.SceneDepthZ = SceneTextures.Depth.Target;
	GIPluginResources.SceneColor = SceneTextures.Color.Target;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/MobileShadingRenderer.cpp:1850

Scope (from outer to inner):

file
function     FColorTargets FMobileSceneRenderer::GetColorTargets_Deferred

Source code excerpt:

	{
		ColorTargets.Add(SceneTextures.Color.Target);
		ColorTargets.Add(SceneTextures.GBufferA);
		ColorTargets.Add(SceneTextures.GBufferB);
		ColorTargets.Add(SceneTextures.GBufferC);
		
		if (MobileUsesExtenedGBuffer(ShaderPlatform))
		{
			ColorTargets.Add(SceneTextures.GBufferD);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessBufferInspector.cpp:9

Scope: file

Source code excerpt:


BEGIN_SHADER_PARAMETER_STRUCT(FPixelInspectorParameters, )
	RDG_TEXTURE_ACCESS(GBufferA, ERHIAccess::CopySrc)
	RDG_TEXTURE_ACCESS(GBufferB, ERHIAccess::CopySrc)
	RDG_TEXTURE_ACCESS(GBufferC, ERHIAccess::CopySrc)
	RDG_TEXTURE_ACCESS(GBufferD, ERHIAccess::CopySrc)
	RDG_TEXTURE_ACCESS(GBufferE, ERHIAccess::CopySrc)
	RDG_TEXTURE_ACCESS(GBufferF, ERHIAccess::CopySrc)
	RDG_TEXTURE_ACCESS(SceneColor, ERHIAccess::CopySrc)

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessBufferInspector.cpp:168

Scope: file

Source code excerpt:


				const FTexture2DRHIRef &DestinationBufferA = PixelInspectorData.RenderTargetBufferA[PixelInspectorRequest->BufferIndex]->GetRenderTargetTexture();
				if (DestinationBufferA.IsValid() && Parameters.GBufferA)
				{
					FRHITexture* SourceBufferA = Parameters.GBufferA->GetRHI();
					if (DestinationBufferA->GetFormat() == SourceBufferA->GetFormat())
					{
						FRHICopyTextureInfo CopyInfo;
						CopyInfo.SourcePosition = SourcePoint;
						CopyInfo.Size = FIntVector(1, 1, 1);
						RHICmdList.CopyTexture(SourceBufferA, DestinationBufferA, CopyInfo);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessBufferInspector.cpp:289

Scope: file

Source code excerpt:


		FPixelInspectorParameters* PassParameters = GraphBuilder.AllocParameters<FPixelInspectorParameters>();
		PassParameters->GBufferA = SceneTextures.GBufferATexture;
		PassParameters->GBufferB = SceneTextures.GBufferBTexture;
		PassParameters->GBufferC = SceneTextures.GBufferCTexture;
		PassParameters->GBufferD = SceneTextures.GBufferDTexture;
		PassParameters->GBufferE = SceneTextures.GBufferETexture;
		PassParameters->GBufferF = SceneTextures.GBufferFTexture;
		PassParameters->SceneColor = Inputs.SceneColor.Texture;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RendererScene.cpp:859

Scope: file

Source code excerpt:

	uint64 TotalSize =
		GetRenderTargetGPUSizeBytes(DepthBuffer, bLogSizes) +
		GetRenderTargetGPUSizeBytes(GBufferA, bLogSizes) +
		GetRenderTargetGPUSizeBytes(GBufferB, bLogSizes) +
		GetRenderTargetGPUSizeBytes(GBufferC, bLogSizes) +
		GetRenderTargetGPUSizeBytes(HZB, bLogSizes) +
		GetRenderTargetGPUSizeBytes(NaniteHZB, bLogSizes) +
		GetRenderTargetGPUSizeBytes(CompressedDepthViewNormal, bLogSizes) +
		GetRenderTargetGPUSizeBytes(CompressedOpaqueDepth, bLogSizes) +

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:459

Scope: file

Source code excerpt:

#define FASTVRAM_CVAR(Name,DefaultValue) static TAutoConsoleVariable<int32> CVarFastVRam_##Name(TEXT("r.FastVRam."#Name), DefaultValue, TEXT(""))

FASTVRAM_CVAR(GBufferA, 0);
FASTVRAM_CVAR(GBufferB, 1);
FASTVRAM_CVAR(GBufferC, 0);
FASTVRAM_CVAR(GBufferD, 0);
FASTVRAM_CVAR(GBufferE, 0);
FASTVRAM_CVAR(GBufferF, 0);
FASTVRAM_CVAR(GBufferVelocity, 0);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:659

Scope (from outer to inner):

file
function     void FFastVramConfig::Update

Source code excerpt:

{
	bDirty = false;
	bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_GBufferA, GBufferA);
	bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_GBufferB, GBufferB);
	bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_GBufferC, GBufferC);
	bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_GBufferD, GBufferD);
	bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_GBufferE, GBufferE);
	bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_GBufferF, GBufferF);
	bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_GBufferVelocity, GBufferVelocity);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:5232

Scope (from outer to inner):

file
function     void FRendererModule::RenderPostOpaqueExtensions

Source code excerpt:

			RenderParameters.ColorTexture = SceneTextures.Color.Target;
			RenderParameters.DepthTexture = SceneTextures.Depth.Target;
			RenderParameters.NormalTexture = SceneTextures.GBufferA;
			RenderParameters.VelocityTexture = SceneTextures.Velocity;
			RenderParameters.SmallDepthTexture = SceneTextures.SmallDepth;
			RenderParameters.ViewUniformBuffer = View.ViewUniformBuffer;
			RenderParameters.SceneTexturesUniformParams = SceneTextures.UniformBuffer;
			RenderParameters.MobileSceneTexturesUniformParams = SceneTextures.MobileUniformBuffer;
			RenderParameters.GlobalDistanceFieldParams = &View.GlobalDistanceFieldInfo.ParameterData;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.h:1063

Scope: file

Source code excerpt:

	// Depth buffer and Normals of the previous frame generating this history entry for bilateral kernel rejection.
	TRefCountPtr<IPooledRenderTarget> DepthBuffer;
	TRefCountPtr<IPooledRenderTarget> GBufferA;
	TRefCountPtr<IPooledRenderTarget> GBufferB;
	TRefCountPtr<IPooledRenderTarget> GBufferC;

	TRefCountPtr<IPooledRenderTarget> HZB;
	TRefCountPtr<IPooledRenderTarget> NaniteHZB;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.h:2808

Scope: file

Source code excerpt:

	void OnSceneRenderTargetsAllocated();

	ETextureCreateFlags GBufferA;
	ETextureCreateFlags GBufferB;
	ETextureCreateFlags GBufferC;
	ETextureCreateFlags GBufferD;
	ETextureCreateFlags GBufferE;
	ETextureCreateFlags GBufferF;
	ETextureCreateFlags GBufferVelocity;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneTextureParameters.cpp:24

Scope (from outer to inner):

file
function     FSceneTextureParameters GetSceneTextureParameters

Source code excerpt:

	// when a pass is trying to access a resource before any other pass actually created it.
	Parameters.GBufferVelocityTexture = GetIfProduced(SceneTextures.Velocity);
	Parameters.GBufferATexture = GetIfProduced(SceneTextures.GBufferA);
	Parameters.GBufferBTexture = GetIfProduced(SceneTextures.GBufferB);
	Parameters.GBufferCTexture = GetIfProduced(SceneTextures.GBufferC);
	Parameters.GBufferDTexture = GetIfProduced(SceneTextures.GBufferD);
	Parameters.GBufferETexture = GetIfProduced(SceneTextures.GBufferE);
	Parameters.GBufferFTexture = GetIfProduced(SceneTextures.GBufferF, SystemTextures.MidGrey);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneTextures.cpp:547

Scope (from outer to inner):

file
function     void FSceneTextures::InitializeViewFamily

Source code excerpt:

		const FGBufferBindings& Bindings = Config.GBufferBindings[GBL_Default];

		if (Bindings.GBufferA.Index >= 0)
		{
			const FRDGTextureDesc Desc(FRDGTextureDesc::Create2D(Config.Extent, Bindings.GBufferA.Format, FClearValueBinding::Transparent, Bindings.GBufferA.Flags | FlagsToAdd | GFastVRamConfig.GBufferA));
			SceneTextures.GBufferA = GraphBuilder.CreateTexture(Desc, TEXT("GBufferA"));
		}

		if (Bindings.GBufferB.Index >= 0)
		{
			const FRDGTextureDesc Desc(FRDGTextureDesc::Create2D(Config.Extent, Bindings.GBufferB.Format, FClearValueBinding::Transparent, Bindings.GBufferB.Flags | FlagsToAdd | GFastVRamConfig.GBufferB));
			SceneTextures.GBufferB = GraphBuilder.CreateTexture(Desc, TEXT("GBufferB"));

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneTextures.cpp:667

Scope (from outer to inner):

file
function     uint32 FSceneTextures::GetGBufferRenderTargets

Source code excerpt:

		const FGBufferEntry GBufferEntries[] =
		{
			{ TEXT("GBufferA"), GBufferA, Bindings.GBufferA.Index },
			{ TEXT("GBufferB"), GBufferB, Bindings.GBufferB.Index },
			{ TEXT("GBufferC"), GBufferC, Bindings.GBufferC.Index },
			{ TEXT("GBufferD"), GBufferD, Bindings.GBufferD.Index },
			{ TEXT("GBufferE"), GBufferE, Bindings.GBufferE.Index },
			{ TEXT("Velocity"), Velocity, Bindings.GBufferVelocity.Index }
		};

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneTextures.cpp:787

Scope (from outer to inner):

file
function     FRDGTextureRef GetSceneTexture

Source code excerpt:

	case ESceneTexture::SmallDepth:     return SceneTextures.SmallDepth;
	case ESceneTexture::Velocity:       return SceneTextures.Velocity;
	case ESceneTexture::GBufferA:       return SceneTextures.GBufferA;
	case ESceneTexture::GBufferB:       return SceneTextures.GBufferB;
	case ESceneTexture::GBufferC:       return SceneTextures.GBufferC;
	case ESceneTexture::GBufferD:       return SceneTextures.GBufferD;
	case ESceneTexture::GBufferE:       return SceneTextures.GBufferE;
	case ESceneTexture::GBufferF:       return SceneTextures.GBufferF;
	case ESceneTexture::SSAO:           return SceneTextures.ScreenSpaceAO;

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneTextures.cpp:842

Scope (from outer to inner):

file
function     void SetupSceneTextureUniformParameters

Source code excerpt:

		if (IsUsingGBuffers(ShaderPlatform))
		{
			if (EnumHasAnyFlags(SetupMode, ESceneTextureSetupMode::GBufferA) && HasBeenProduced(SceneTextures->GBufferA))
			{
				SceneTextureParameters.GBufferATexture = SceneTextures->GBufferA;
			}

			if (EnumHasAnyFlags(SetupMode, ESceneTextureSetupMode::GBufferB) && HasBeenProduced(SceneTextures->GBufferB))
			{
				SceneTextureParameters.GBufferBTexture = SceneTextures->GBufferB;
			}

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneTextures.cpp:994

Scope (from outer to inner):

file
function     void SetupMobileSceneTextureUniformParameters

Source code excerpt:

		if (SceneTextures->Config.bIsUsingGBuffers)
		{
			if (HasBeenProduced(SceneTextures->GBufferA))
			{
				SceneTextureParameters.GBufferATexture = SceneTextures->GBufferA;
			}

			if (HasBeenProduced(SceneTextures->GBufferB))
			{
				SceneTextureParameters.GBufferBTexture = SceneTextures->GBufferB;
			}

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/ScreenSpaceDenoise.cpp:1248

Scope (from outer to inner):

file
function     void SetupSceneViewInfoPooledRenderTargets

Source code excerpt:


	OutViewInfoPooledRenderTargets->PrevDepthBuffer = PrevViewInfo.DepthBuffer;
	OutViewInfoPooledRenderTargets->PrevGBufferA = PrevViewInfo.GBufferA;
	OutViewInfoPooledRenderTargets->PrevGBufferB = PrevViewInfo.GBufferB;
	OutViewInfoPooledRenderTargets->PrevCompressedDepthViewNormal = PrevViewInfo.CompressedDepthViewNormal;

	OutViewInfoPooledRenderTargets->NextDepthBuffer = &PrevFrameViewInfo.DepthBuffer;
	OutViewInfoPooledRenderTargets->NextGBufferA = &PrevFrameViewInfo.GBufferA;
	OutViewInfoPooledRenderTargets->NextGBufferB = &PrevFrameViewInfo.GBufferB;
	OutViewInfoPooledRenderTargets->NextCompressedDepthViewNormal = &PrevFrameViewInfo.CompressedDepthViewNormal;
}

void Denoiser::SetupCommonShaderParameters(
	const FViewInfo& View,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Public/SceneRenderTargetParameters.h:14

Scope: file

Source code excerpt:

	SmallDepth,
	Velocity,
	GBufferA,
	GBufferB,
	GBufferC,
	GBufferD,
	GBufferE,
	GBufferF,
	SSAO,

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Public/SceneRenderTargetParameters.h:32

Scope: file

Source code excerpt:

	SceneDepth		= 1 << 1,
	SceneVelocity	= 1 << 2,
	GBufferA		= 1 << 3,
	GBufferB		= 1 << 4,
	GBufferC		= 1 << 5,
	GBufferD		= 1 << 6,
	GBufferE		= 1 << 7,
	GBufferF		= 1 << 8,
	SSAO			= 1 << 9,
	CustomDepth		= 1 << 10,
	GBuffers		= GBufferA | GBufferB | GBufferC | GBufferD | GBufferE | GBufferF,
	All				= SceneColor | SceneDepth | SceneVelocity | GBuffers | SSAO | CustomDepth
};
ENUM_CLASS_FLAGS(ESceneTextureSetupMode);

/** Fills the shader parameter struct. */
extern RENDERER_API void SetupSceneTextureUniformParameters(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Public/SceneRenderTargetParameters.h:72

Scope: file

Source code excerpt:

	SceneDepth		= 1 << 1,
	CustomDepth		= 1 << 2,
	GBufferA		= 1 << 3,
	GBufferB		= 1 << 4,
	GBufferC		= 1 << 5,
	GBufferD		= 1 << 6,
	SceneDepthAux	= 1 << 7,
	SceneVelocity	= 1 << 8,
	GBuffers		= GBufferA | GBufferB | GBufferC | GBufferD | SceneDepthAux,
	All				= SceneColor | SceneDepth | CustomDepth | GBuffers | SceneVelocity
};
ENUM_CLASS_FLAGS(EMobileSceneTextureSetupMode);

/** Fills the scene texture uniform buffer struct. */
extern RENDERER_API void SetupMobileSceneTextureUniformParameters(

#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanRenderpass.h:543

Scope (from outer to inner):

file
class        class FVulkanRenderPassBuilder
function     void BuildCreateInfo

Source code excerpt:

			//const VkAttachmentReference* ColorRef = RTLayout.GetColorAttachmentReferences();
			//uint32 NumColorAttachments = RTLayout.GetNumColorAttachments();
			//check(RTLayout.GetNumColorAttachments() == 5); //current layout is SceneColor, GBufferA/B/C/D

			// 1. Write to SceneColor and GBuffer, input DepthStencil
			{
				TSubpassDescriptionClass& SubpassDesc = SubpassDescriptions[NumSubpasses++];
				SubpassDesc.SetColorAttachments(ColorAttachmentReferences);
				SubpassDesc.SetDepthStencilAttachment(&DepthStencilAttachment);

#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanRenderpass.h:588

Scope (from outer to inner):

file
class        class FVulkanRenderPassBuilder
function     void BuildCreateInfo

Source code excerpt:

				InputAttachments2[1].SetAspect(0);

				// GBufferA/B/C/D as Input2/3/4/5
				int32 NumColorInputs = ColorAttachmentReferences.Num() - 1;
				for (int32 i = 2; i < (NumColorInputs + 2); ++i)
				{
					InputAttachments2[i].attachment = ColorAttachmentReferences[i - 1].attachment;
					InputAttachments2[i].layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
					InputAttachments2[i].SetAspect(VK_IMAGE_ASPECT_COLOR_BIT);