r.FastVRam.DBufferA
r.FastVRam.DBufferA
#Overview
name: r.FastVRam.DBufferA
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 11
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.FastVRam.DBufferA is to control the texture creation flags for the DBufferA texture in Unreal Engine’s rendering system. This variable is part of the FastVRam configuration, which allows developers to optimize memory usage and performance for specific render targets.
-
The r.FastVRam.DBufferA setting is primarily used in the rendering system, specifically for the Deferred Decals (DBuffer) feature.
-
This setting is mainly utilized in the Renderer module of Unreal Engine. It affects the creation and handling of DBuffer textures, which are used in the deferred decal rendering process.
-
The value of this variable is set through the FASTVRAM_CVAR macro, which likely creates a console variable that can be adjusted at runtime or through configuration files.
-
This variable interacts closely with other DBuffer-related variables, such as r.FastVRam.DBufferB, r.FastVRam.DBufferC, and r.FastVRam.DBufferMask. Together, these variables control the memory allocation and performance characteristics of the DBuffer textures.
-
Developers should be aware that changing this variable affects the texture creation flags for DBufferA, which can impact rendering performance and memory usage. It’s important to consider the target hardware and performance requirements when adjusting this setting.
-
Best practices for using this variable include:
- Only modify it if you have a good understanding of the rendering pipeline and memory management in Unreal Engine.
- Test thoroughly on target hardware after making changes to ensure optimal performance.
- Consider the impact on other related DBuffer textures and the overall rendering process.
Regarding the associated variable DBufferA:
The purpose of DBufferA is to serve as one of the main textures in the Deferred Decal buffer system. It is used to store and process decal information in the deferred rendering pipeline.
-
DBufferA is a crucial part of the deferred decal rendering system in Unreal Engine’s renderer.
-
This texture is used in various parts of the rendering process, including the deferred decal pass and subsequent stages that need to access decal information.
-
The value (texture reference) of DBufferA is set during the creation of DBuffer textures, typically in the CreateDBufferTextures function.
-
DBufferA interacts closely with DBufferB and DBufferC, forming the trio of main DBuffer textures. It’s also associated with DBufferMask when using per-pixel DBuffer mask techniques.
-
Developers should be aware that DBufferA is a critical component of the deferred decal system. Its creation, usage, and management can significantly impact rendering quality and performance.
-
Best practices for working with DBufferA include:
- Ensure proper initialization and management of the texture throughout the rendering pipeline.
- Consider the impact on memory usage, especially on platforms with limited GPU memory.
- Optimize decal rendering and usage to make the most efficient use of the DBuffer system.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:495
Scope: file
Source code excerpt:
FASTVRAM_CVAR(ScreenSpaceAO,0);
FASTVRAM_CVAR(SSR, 0);
FASTVRAM_CVAR(DBufferA, 0);
FASTVRAM_CVAR(DBufferB, 0);
FASTVRAM_CVAR(DBufferC, 0);
FASTVRAM_CVAR(DBufferMask, 0);
FASTVRAM_CVAR(DOFSetup, 1);
FASTVRAM_CVAR(DOFReduce, 1);
FASTVRAM_CVAR(DOFPostfilter, 1);
#Associated Variable and Callsites
This variable is associated with another variable named DBufferA
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.cpp:213
Scope (from outer to inner):
file
function void GetDeferredDecalPassParameters
Source code excerpt:
const FDBufferTextures& DBufferTextures = *Textures.DBufferTextures;
const ERenderTargetLoadAction LoadAction = DBufferTextures.DBufferA->HasBeenProduced()
? ERenderTargetLoadAction::ELoad
: ERenderTargetLoadAction::EClear;
AddColorTarget(DBufferTextures.DBufferA, LoadAction);
AddColorTarget(DBufferTextures.DBufferB, LoadAction);
AddColorTarget(DBufferTextures.DBufferC, LoadAction);
if (DBufferTextures.DBufferMask)
{
AddColorTarget(DBufferTextures.DBufferMask, LoadAction);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/CompositionLighting/PostProcessDeferredDecals.cpp:730
Scope (from outer to inner):
file
function void AddDeferredDecalPass
Source code excerpt:
{
// Combine DBuffer RTWriteMasks; will end up in one texture we can load from in the base pass PS and decide whether to do the actual work or not.
FRDGTextureRef Textures[] = { PassTextures.DBufferTextures->DBufferA, PassTextures.DBufferTextures->DBufferB, PassTextures.DBufferTextures->DBufferC };
FRenderTargetWriteMask::Decode(GraphBuilder, View.ShaderMap, MakeArrayView(Textures), PassTextures.DBufferTextures->DBufferMask, GFastVRamConfig.DBufferMask, TEXT("DBufferMaskCombine"));
}
}
void ExtractNormalsForNextFrameReprojection(FRDGBuilder& GraphBuilder, const FSceneTextures& SceneTextures, const TArray<FViewInfo>& Views)
{
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DBufferTextures.cpp:11
Scope (from outer to inner):
file
function bool FDBufferTextures::IsValid
Source code excerpt:
bool FDBufferTextures::IsValid() const
{
check(!DBufferA || (DBufferB && DBufferC));
return HasBeenProduced(DBufferA);
}
EDecalDBufferMaskTechnique GetDBufferMaskTechnique(EShaderPlatform ShaderPlatform)
{
const bool bWriteMaskDBufferMask = RHISupportsRenderTargetWriteMask(ShaderPlatform);
const bool bPerPixelDBufferMask = FDataDrivenShaderPlatformInfo::GetSupportsPerPixelDBufferMask(ShaderPlatform);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DBufferTextures.cpp:44
Scope (from outer to inner):
file
function FDBufferTexturesDesc GetDBufferTexturesDesc
Source code excerpt:
FRDGTextureDesc Desc = FRDGTextureDesc::Create2D(Extent, PF_B8G8R8A8, FClearValueBinding::None, BaseFlags);
Desc.Flags = BaseFlags | GFastVRamConfig.DBufferA;
Desc.ClearValue = FClearValueBinding::Black;
DBufferTexturesDesc.DBufferADesc = Desc;
Desc.Flags = BaseFlags | GFastVRamConfig.DBufferB;
Desc.ClearValue = FClearValueBinding(FLinearColor(128.0f / 255.0f, 128.0f / 255.0f, 128.0f / 255.0f, 1));
DBufferTexturesDesc.DBufferBDesc = Desc;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DBufferTextures.cpp:89
Scope (from outer to inner):
file
function FDBufferTextures CreateDBufferTextures
Source code excerpt:
: ERDGTextureFlags::None;
DBufferTextures.DBufferA = GraphBuilder.CreateTexture(TexturesDesc.DBufferADesc, TEXT("DBufferA"), TextureFlags);
DBufferTextures.DBufferB = GraphBuilder.CreateTexture(TexturesDesc.DBufferBDesc, TEXT("DBufferB"), TextureFlags);
DBufferTextures.DBufferC = GraphBuilder.CreateTexture(TexturesDesc.DBufferCDesc, TEXT("DBufferC"), TextureFlags);
if (DBufferMaskTechnique == EDecalDBufferMaskTechnique::PerPixel)
{
DBufferTextures.DBufferMask = GraphBuilder.CreateTexture(TexturesDesc.DBufferMaskDesc, TEXT("DBufferMask"));
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DBufferTextures.cpp:117
Scope (from outer to inner):
file
function FDBufferParameters GetDBufferParameters
Source code excerpt:
if (DBufferTextures.IsValid())
{
Parameters.DBufferATexture = DBufferTextures.DBufferA;
Parameters.DBufferBTexture = DBufferTextures.DBufferB;
Parameters.DBufferCTexture = DBufferTextures.DBufferC;
if (DBufferTextures.DBufferMask)
{
Parameters.DBufferRenderMask = DBufferTextures.DBufferMask;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DBufferTextures.h:32
Scope: file
Source code excerpt:
bool IsValid() const;
FRDGTextureRef DBufferA = nullptr;
FRDGTextureRef DBufferB = nullptr;
FRDGTextureRef DBufferC = nullptr;
FRDGTextureRef DBufferMask = nullptr;
};
FDBufferTexturesDesc GetDBufferTexturesDesc(FIntPoint Extent, EShaderPlatform ShaderPlatform);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:495
Scope: file
Source code excerpt:
FASTVRAM_CVAR(ScreenSpaceAO,0);
FASTVRAM_CVAR(SSR, 0);
FASTVRAM_CVAR(DBufferA, 0);
FASTVRAM_CVAR(DBufferB, 0);
FASTVRAM_CVAR(DBufferC, 0);
FASTVRAM_CVAR(DBufferMask, 0);
FASTVRAM_CVAR(DOFSetup, 1);
FASTVRAM_CVAR(DOFReduce, 1);
FASTVRAM_CVAR(DOFPostfilter, 1);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.cpp:695
Scope (from outer to inner):
file
function void FFastVramConfig::Update
Source code excerpt:
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_ScreenSpaceAO, ScreenSpaceAO);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_SSR, SSR);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DBufferA, DBufferA);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DBufferB, DBufferB);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DBufferC, DBufferC);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DBufferMask, DBufferMask);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DOFSetup, DOFSetup);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DOFReduce, DOFReduce);
bDirty |= UpdateTextureFlagFromCVar(CVarFastVRam_DOFPostfilter, DOFPostfilter);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/SceneRendering.h:2845
Scope: file
Source code excerpt:
ETextureCreateFlags ScreenSpaceAO;
ETextureCreateFlags SSR;
ETextureCreateFlags DBufferA;
ETextureCreateFlags DBufferB;
ETextureCreateFlags DBufferC;
ETextureCreateFlags DBufferMask;
ETextureCreateFlags DOFSetup;
ETextureCreateFlags DOFReduce;
ETextureCreateFlags DOFPostfilter;