Rendering
Rendering
#Overview
name: Rendering
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 68
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of the Rendering setting variable is to control various aspects of the rendering system in Unreal Engine 5. Here are the key points about this variable:
-
The Rendering variable is used to enable or disable any rendering or buffer clearing in the engine. It is part of the show flags system that controls visibility of different rendering features.
-
It is used primarily in the main rendering pipelines like FDeferredShadingSceneRenderer and FMobileSceneRenderer to determine if rendering should proceed at all.
-
Multiple Unreal Engine subsystems and modules rely on this variable, including the core rendering system, mobile rendering, ray tracing, and various plugins.
-
The value is typically set through the engine show flags, but can also be controlled programmatically.
-
When Rendering is disabled, it can be used to pause rendering while the app is not in focus to save processing cycles.
-
It interacts with other rendering-related variables and settings throughout the engine.
-
Developers should be aware that disabling Rendering will stop all visual output, which can be useful for benchmarking or debugging but should be used carefully in production.
-
Best practices include only disabling Rendering when absolutely necessary, and ensuring it is re-enabled when visual output is required again.
-
The variable is marked as SHOWFLAG_ALWAYS_ACCESSIBLE, meaning it can be accessed and modified at runtime, even in shipping builds.
-
When working with this variable, developers should consider its impact on performance, visual fidelity, and other rendering systems that may depend on it being enabled.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2839, section: [Trace.ChannelPresets]
- INI Section:
Trace.ChannelPresets
- Raw value:
gpu,cpu,frame,log,bookmark
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheMask/Private/Mask2D/AvaMask2DBaseModifier.cpp:470
Scope (from outer to inner):
file
function void UAvaMask2DBaseModifier::OnModifierCDOSetup
Source code excerpt:
void UAvaMask2DBaseModifier::OnModifierCDOSetup(FActorModifierCoreMetadata& InMetadata)
{
Super::OnModifierCDOSetup(InMetadata);
InMetadata.SetName(TEXT("Mask"));
InMetadata.SetCategory(TEXT("Rendering"));
#if WITH_EDITOR
InMetadata.SetDescription(LOCTEXT("ModifierDescription", "Allows to use a custom mask texture on attached actors materials"));
#endif
}
UActorComponent* UAvaMask2DBaseModifier::FindOrAddMaskComponent(TSubclassOf<UActorComponent> InComponentClass, AActor* InActor)
{
if (!InActor || !InComponentClass)
{
return nullptr;
}
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheMask/Private/Mask2D/AvaMask2DReadModifier.cpp:147
Scope (from outer to inner):
file
function void UAvaMask2DReadModifier::OnModifierCDOSetup
Source code excerpt:
void UAvaMask2DReadModifier::OnModifierCDOSetup(FActorModifierCoreMetadata& InMetadata)
{
Super::OnModifierCDOSetup(InMetadata);
InMetadata.SetName(TEXT("MaskRead"));
InMetadata.SetCategory(TEXT("Rendering"));
InMetadata.DisallowAfter(TEXT("MaskWrite"));
InMetadata.DisallowBefore(TEXT("MaskWrite"));
#if WITH_EDITOR
InMetadata.SetDisplayName(FText::FromString(TEXT("Mask (Apply)")));
InMetadata.SetDescription(LOCTEXT("ModifierDescription", "Allows to use a custom mask texture on attached actors materials"));
#endif
}
void UAvaMask2DReadModifier::SetupMaskComponent(UActorComponent* InComponent)
{
if (!InComponent)
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheMask/Private/Mask2D/AvaMask2DWriteModifier.cpp:105
Scope (from outer to inner):
file
function void UAvaMask2DWriteModifier::OnModifierCDOSetup
Source code excerpt:
void UAvaMask2DWriteModifier::OnModifierCDOSetup(FActorModifierCoreMetadata& InMetadata)
{
Super::OnModifierCDOSetup(InMetadata);
InMetadata.SetName(TEXT("MaskWrite"));
InMetadata.SetCategory(TEXT("Rendering"));
InMetadata.DisallowAfter(TEXT("MaskRead"));
InMetadata.DisallowBefore(TEXT("MaskRead"));
#if WITH_EDITOR
InMetadata.SetDisplayName(FText::FromString(TEXT("Mask (Set)")));
InMetadata.SetDescription(LOCTEXT("ModifierDescription", "Allows to use a custom mask texture on attached actors materials"));
#endif
}
void UAvaMask2DWriteModifier::SetupMaskComponent(UActorComponent* InComponent)
{
if (!InComponent)
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheModifiers/Private/Modifiers/AvaGeometryBaseModifier.cpp:20
Scope (from outer to inner):
file
function void UAvaGeometryBaseModifier::OnModifierCDOSetup
Source code excerpt:
});
// Avoid geometry modifiers after translucent or layout modifiers
InMetadata.AvoidAfterCategory(TEXT("Translucent"));
InMetadata.AvoidAfterCategory(TEXT("Layout"));
InMetadata.AvoidAfterCategory(TEXT("Rendering"));
}
bool UAvaGeometryBaseModifier::IsModifierReady() const
{
if (!GetMeshComponent())
{
return false;
}
return true;
}
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheModifiers/Private/Modifiers/AvaGlobalOpacityModifier.cpp:109
Scope (from outer to inner):
file
function void UAvaGlobalOpacityModifier::OnModifierCDOSetup
Source code excerpt:
void UAvaGlobalOpacityModifier::OnModifierCDOSetup(FActorModifierCoreMetadata& InMetadata)
{
Super::OnModifierCDOSetup(InMetadata);
InMetadata.SetName(TEXT("GlobalOpacity"));
InMetadata.SetCategory(TEXT("Rendering"));
#if WITH_EDITOR
InMetadata.SetDescription(LOCTEXT("ModifierDescription", "Sets global opacity parameters on an actor with Material Designer Instances generated with the Material Designer"));
#endif
}
#undef LOCTEXT_NAMESPACE
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheModifiers/Private/Modifiers/AvaHideEmptyModifier.cpp:9
Scope (from outer to inner):
file
function void UAvaHideEmptyModifier::OnModifierCDOSetup
Source code excerpt:
void UAvaHideEmptyModifier::OnModifierCDOSetup(FActorModifierCoreMetadata& InMetadata)
{
Super::OnModifierCDOSetup(InMetadata);
InMetadata.SetName(TEXT("HideEmpty"));
InMetadata.SetCategory(TEXT("Rendering"));
#if WITH_EDITOR
InMetadata.SetDescription(LOCTEXT("ModifierDescription", "Hides a container when the text content is empty"));
#endif
InMetadata.SetCompatibilityRule([](const AActor* InActor)->bool
{
return InActor && InActor->FindComponentByClass<UText3DComponent>();
});
}
void UAvaHideEmptyModifier::OnModifierAdded(EActorModifierCoreEnableReason InReason)
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheModifiers/Private/Modifiers/AvaMaterialParameterModifier.cpp:116
Scope (from outer to inner):
file
function void UAvaMaterialParameterModifier::OnModifierCDOSetup
Source code excerpt:
void UAvaMaterialParameterModifier::OnModifierCDOSetup(FActorModifierCoreMetadata& InMetadata)
{
Super::OnModifierCDOSetup(InMetadata);
InMetadata.SetName(TEXT("MaterialParameter"));
InMetadata.SetCategory(TEXT("Rendering"));
#if WITH_EDITOR
InMetadata.SetDescription(LOCTEXT("ModifierDescription", "Sets specified dynamic materials parameters on an actor and its children"));
#endif
InMetadata.SetCompatibilityRule([this](const AActor* InActor)->bool
{
if (!IsValid(InActor))
{
return false;
}
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheModifiers/Private/Modifiers/AvaTranslucentPriorityModifier.cpp:21
Scope (from outer to inner):
file
function void UAvaTranslucentPriorityModifier::OnModifierCDOSetup
Source code excerpt:
void UAvaTranslucentPriorityModifier::OnModifierCDOSetup(FActorModifierCoreMetadata& InMetadata)
{
Super::OnModifierCDOSetup(InMetadata);
InMetadata.SetName(TEXT("TranslucentPriority"));
InMetadata.SetCategory(TEXT("Rendering"));
#if WITH_EDITOR
InMetadata.SetDescription(LOCTEXT("ModifierDescription", "Set the translucency sort priority of a primitive component based on different modes"));
#endif
InMetadata.SetCompatibilityRule([this](const AActor* InActor)
{
if (!InActor)
{
return false;
}
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheModifiers/Private/Modifiers/AvaVisibilityModifier.cpp:137
Scope (from outer to inner):
file
function void UAvaVisibilityModifier::OnModifierCDOSetup
Source code excerpt:
void UAvaVisibilityModifier::OnModifierCDOSetup(FActorModifierCoreMetadata& InMetadata)
{
Super::OnModifierCDOSetup(InMetadata);
InMetadata.SetName(TEXT("Visibility"));
InMetadata.SetCategory(TEXT("Rendering"));
#if WITH_EDITOR
InMetadata.SetDescription(LOCTEXT("ModifierDescription", "Controls the visibility of a range of child actors by index"));
#endif
}
void UAvaVisibilityModifier::OnRenderStateUpdated(AActor* InActor, UActorComponent* InComponent)
{
Super::OnRenderStateUpdated(InActor, InComponent);
const AActor* ActorModified = GetModifiedActor();
#Loc: <Workspace>/Engine/Plugins/Experimental/Avalanche/Source/AvalancheModifiersEditor/Private/AvaModifiersEditorStyle.cpp:29
Scope (from outer to inner):
file
function FAvaModifiersEditorStyle::FAvaModifiersEditorStyle
Source code excerpt:
{
{TEXT("Unspecified"), FSlateColor(FActorModifierCoreMetadata::DefaultColor)},
{TEXT("Geometry"), FSlateColor(FLinearColor::Yellow.Desaturate(0.25))},
{TEXT("Transform"), FSlateColor(FLinearColor::Blue.Desaturate(0.25))},
{TEXT("Layout"), FSlateColor(FLinearColor::Green.Desaturate(0.25))},
{TEXT("Rendering"), FSlateColor(FLinearColor::Red.Desaturate(0.25))}
};
if (const UActorModifierCoreSubsystem* ModifierSubsystem = UActorModifierCoreSubsystem::Get())
{
// loop through already registered factories if subsystem exists
ModifierSubsystem->ForEachModifierMetadata([this](const FActorModifierCoreMetadata& InMetadata)->bool
{
OnModifierClassRegistered(InMetadata);
return true;
});
}
FSlateStyleRegistry::RegisterSlateStyle(*this);
UActorModifierCoreSubsystem::OnModifierClassRegisteredDelegate.AddRaw(this, &FAvaModifiersEditorStyle::OnModifierClassRegistered);
}
const FSlateColor& FAvaModifiersEditorStyle::GetModifierCategoryColor(FName CategoryName)
#Loc: <Workspace>/Engine/Plugins/Media/MediaPlate/Source/MediaPlateEditor/Private/MediaPlateCustomization.cpp:1422
Scope (from outer to inner):
file
function void FMediaPlateCustomization::CustomizeCategories
Source code excerpt:
RenderingSection->RemoveCategory(TEXT("Lighting"));
RenderingSection->AddCategory(TEXT("MediaTexture"));
RenderingSection->RemoveCategory(TEXT("MaterialParameters"));
RenderingSection->RemoveCategory(TEXT("Mobile"));
RenderingSection->RemoveCategory(TEXT("RayTracing"));
RenderingSection->RemoveCategory(TEXT("Rendering"));
RenderingSection->RemoveCategory(TEXT("TextureStreaming"));
RenderingSection->RemoveCategory(TEXT("VirtualTexture"));
// Hide unwanted Categories
const FName MediaPlateName = AMediaPlate::StaticClass()->GetFName();
const TSharedRef<FPropertySection> MediaPlateMiscSection = PropertyModule.FindOrCreateSection(MediaPlateName, TEXT("Misc"), LOCTEXT("Misc", "Misc"));
MediaPlateMiscSection->RemoveCategory("AssetUserData");
MediaPlateMiscSection->RemoveCategory("Cooking");
MediaPlateMiscSection->RemoveCategory("Input");
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/MovieGraphCoreTimeStep.cpp:98
Scope (from outer to inner):
file
function void UMovieGraphCoreTimeStep::TickProducingFrames
Source code excerpt:
CurrentCameraCut->ShotInfo.WorkMetrics.TotalEngineWarmUpFrameCount = CurrentCameraCut->ShotInfo.NumEngineWarmUpFramesRemaining;
if (CurrentCameraCut->ShotInfo.NumEngineWarmUpFramesRemaining == 0 && !CurrentCameraCut->ShotInfo.bEmulateFirstFrameMotionBlur)
{
// If there's no warm-up frames and they don't want to emulate motion blur, skip to rendering state next frame.
CurrentCameraCut->ShotInfo.State = EMovieRenderShotState::Rendering;
// Set up a fake "Previous" range that is just 1 frame further back than the start.
FFrameTime UpperBound = CurrentCameraCut->ShotInfo.CurrentTimeInRoot;
CurrentFrameData.LastOutputFrameRange = TRange<FFrameTime>(UpperBound - CurrentFrameMetrics.FrameTimePerOutputFrame, UpperBound);
CurrentFrameData.LastSampleRange = CurrentFrameData.LastOutputFrameRange;
GetOwningGraph()->GetDataSourceInstance()->PlayDataSource();
}
else
{
const bool bHasWarmUpFrames = CurrentCameraCut->ShotInfo.NumEngineWarmUpFramesRemaining > 0;
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/MovieGraphCoreTimeStep.cpp:168
Scope (from outer to inner):
file
function void UMovieGraphCoreTimeStep::TickProducingFrames
Source code excerpt:
CurrentShotIndex + 1, ActiveShotList.Num(), *CurrentCameraCut->OuterName, *CurrentCameraCut->InnerName);
}
// We only automatically advance the CurrentOutputFrameRange during Rendering, or when warm-up frames
// are counting down (if we're not going to emulate motion blur).
const bool bIncrementBecauseRenderingState = CurrentCameraCut->ShotInfo.State == EMovieRenderShotState::Rendering;
const bool bIncrementBecauseWarmUpState = CurrentCameraCut->ShotInfo.State == EMovieRenderShotState::WarmingUp && !CurrentCameraCut->ShotInfo.bEmulateFirstFrameMotionBlur;
bool bIncrementInternalCounters = bIncrementBecauseRenderingState || bIncrementBecauseWarmUpState;
// Due to the motion blur emulation frame only using one TS, we need to potentially override the flags we send to the renderer,
// otherwise the renderer gets confused because it's asked to render a frame that wasn't scheduled.
TOptional<bool> bIsFirstTemporalSampleOverride;
TOptional<bool> bIsLastTemporalSampleOverride;
if (IsFirstTemporalSample())
{
// Update our context and stats
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/MovieGraphCoreTimeStep.cpp:248
Scope (from outer to inner):
file
function void UMovieGraphCoreTimeStep::TickProducingFrames
Source code excerpt:
}
if (CurrentCameraCut->ShotInfo.NumEngineWarmUpFramesRemaining == 0)
{
GetOwningGraph()->GetDataSourceInstance()->PlayDataSource();
CurrentCameraCut->ShotInfo.State = CurrentCameraCut->ShotInfo.bEmulateFirstFrameMotionBlur ? EMovieRenderShotState::MotionBlur : EMovieRenderShotState::Rendering;
}
// We decrement at the end of this as we check before to see if we should move to the next state, but want to ensure we do at least one warm up frame.
CurrentCameraCut->ShotInfo.WorkMetrics.EngineWarmUpFrameIndex++;
CurrentCameraCut->ShotInfo.NumEngineWarmUpFramesRemaining--;
}
if (CurrentCameraCut->ShotInfo.State == EMovieRenderShotState::MotionBlur)
{
CurrentTimeStepData.bDiscardOutput = true;
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/MovieGraphCoreTimeStep.cpp:294
Scope (from outer to inner):
file
function void UMovieGraphCoreTimeStep::TickProducingFrames
Source code excerpt:
// We've done the motion blur emulation frame (above), but we didn't increment internal counters, so
// we can safely fall through to rendering here and it'll start on the rendering frame like normal.
// We _must_ fall through to rendering this tick, as we need the motion vectors generated by the difference
// between last frame and this one to be used for the renders this frame.
CurrentCameraCut->ShotInfo.State = EMovieRenderShotState::Rendering;
GetOwningGraph()->GetDataSourceInstance()->PlayDataSource();
}
}
if (CurrentCameraCut->ShotInfo.State == EMovieRenderShotState::Rendering)
{
CurrentTimeStepData.bDiscardOutput = false;
// We only track work metrics during Rendering
CurrentCameraCut->ShotInfo.WorkMetrics.OutputFrameIndex++;
// Now that we've calculated the total range of time we're trying to represent, we can check to see
// if this would put us beyond our range of time this shot is supposed to represent.
if (CurrentFrameData.CurrentOutputFrameRange.GetUpperBoundValue() > CurrentCameraCut->ShotInfo.TotalOutputRangeRoot.GetUpperBoundValue())
{
// We're going to spend this frame tearing down the shot (not rendering anything), next frame
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/MovieGraphCoreTimeStep.cpp:429
Scope (from outer to inner):
file
function void UMovieGraphCoreTimeStep::TickProducingFrames
Source code excerpt:
GetOwningGraph()->GetCustomEngineTimeStep()->SharedTimeStepData.RenderedFrameNumber++;
CurrentFrameData.LastOutputFrameRange = CurrentFrameData.CurrentOutputFrameRange;
// Increment the output frame number only on the last temporal sample, and only if
// we're actually rendering frames to disk.
if (CurrentCameraCut->ShotInfo.State == EMovieRenderShotState::Rendering)
{
GetOwningGraph()->GetCustomEngineTimeStep()->SharedTimeStepData.OutputFrameNumber++;
CurrentTimeStepData.ShotOutputFrameNumber++;
}
// If we've rendered the last temporal sub-sample, we've started a new output frame
// and we need to reset our temporal sample index.
CurrentFrameData.TemporalSampleIndex = 0;
CurrentCameraCut->ShotInfo.WorkMetrics.OutputSubSampleIndex = 0;
}
else
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/MovieGraphDefaultAudioRenderer.cpp:80
Scope (from outer to inner):
file
function void UMovieGraphDefaultAudioRenderer::ProcessAudioTick
Source code excerpt:
const int32 CurrentShotIndex = GetOwningGraph()->GetCurrentShotIndex();
const TObjectPtr<UMoviePipelineExecutorShot> CurrentShot = ActiveShotList[CurrentShotIndex];
// Start capturing any produced samples on the same frame we start submitting samples that will make it to disk.
// This comes before we process samples for this frame (below).
if ((CurrentShot->ShotInfo.State == EMovieRenderShotState::Rendering) && !AudioState.bIsRecordingAudio)
{
// There can be time in the Unreal world that passes when MRQ is not yet active. When MRQ isn't active,
// then the NRT audio platform doesn't process anything and it builds up for when we do start to actually
// process it for a shot. This causes our actual audio to become offset from the sequence once lined up
// afterwards. So for now we'll just flush out anything that needed to be processed before we start capturing
MixerDevice->Update(true);
// We don't have a great way of determining how much outstanding audio there is, so we're just going to
// process an arbitrary amount of time.
NRTPlatform->RenderAudio(30.f);
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/MovieGraphDefaultAudioRenderer.cpp:101
Scope (from outer to inner):
file
function void UMovieGraphDefaultAudioRenderer::ProcessAudioTick
Source code excerpt:
// This needs to tick every frame so we process and clear audio that happens between shots while the world is running.
// We have special ticking logic while rendering due to temporal sampling, and otherwise just fall back to normal.
bool bCanRenderAudio = true;
double AudioDeltaTime = FApp::GetDeltaTime();
if (CurrentShot->ShotInfo.State == EMovieRenderShotState::Rendering)
{
const UMovieGraphTimeStepBase* TimeStepInstance = GetOwningGraph()->GetTimeStepInstance();
const UMovieGraphDataSourceBase* DataSourceInstance = GetOwningGraph()->GetDataSourceInstance();
constexpr bool bIncludeCDOs = true;
constexpr bool bExactMatch = true;
const TObjectPtr<UMovieGraphEvaluatedConfig> EvaluatedGraph = TimeStepInstance->GetCalculatedTimeData().EvaluatedConfig;
UMovieGraphGlobalOutputSettingNode* OutputSettingNode = EvaluatedGraph->GetSettingForBranch<UMovieGraphGlobalOutputSettingNode>(UMovieGraphNode::GlobalsPinName, bIncludeCDOs, bExactMatch);
const FFrameRate SourceFrameRate = DataSourceInstance->GetDisplayRate();
const FFrameRate EffectiveFrameRate = UMovieGraphBlueprintLibrary::GetEffectiveFrameRate(OutputSettingNode, SourceFrameRate);
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineAudioRendering.cpp:135
Scope (from outer to inner):
file
function void UMoviePipeline::ProcessAudioTick
Source code excerpt:
UMoviePipelineExecutorShot* CurrentShot = ActiveShotList[CurrentShotIndex];
// Start capturing any produced samples on the same frame we start submitting samples that will make it to disk.
// This comes before we process samples for this frame (below).
if (CurrentShot->ShotInfo.State == EMovieRenderShotState::Rendering && !AudioState.bIsRecordingAudio)
{
// There can be time in the Unreal world that passes when MRQ is not yet active. When MRQ isn't active,
// then the NRT audio platform doesn't process anything and it builds up for when we do start to actually
// process it for a shot. This causes our actual audio to become offset from the sequence once lined up
// afterwards. So for now we'll just flush out anything that needed to be processed before we start capturing
MixerDevice->Update(true);
// We don't have a great way of determining how much outstanding audio there is, so we're just going to
// process an arbitrary amount of time.
NRTPlatform->RenderAudio(30.f);
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineAudioRendering.cpp:156
Scope (from outer to inner):
file
function void UMoviePipeline::ProcessAudioTick
Source code excerpt:
// This needs to tick every frame so we process and clear audio that happens between shots while the world is running.
// We have special ticking logic while rendering due to temporal sampling, and otherwise just fall back to normal.
bool bCanRenderAudio = true;
double AudioDeltaTime = FApp::GetDeltaTime();
if(CurrentShot->ShotInfo.State == EMovieRenderShotState::Rendering)
{
// The non-real time audio renderer desires even engine time steps. Unfortunately, when using temporal sampling
// we don't have an even timestep. However, because it's non-real time, and we're accumulating the results into
// a single frame anyways, we can bunch up the audio work and then process it when we've reached the end of a frame.
bCanRenderAudio = CachedOutputState.IsLastTemporalSample();
// Process work that has been submitted from the game thread to the audio thread over the temporal samples of this frame.
AudioDeltaTime = GetPipelinePrimaryConfig()->GetEffectiveFrameRate(TargetSequence).AsInterval();
}
// Handle any game logic that changed Audio State.
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineRendering.cpp:226
Scope (from outer to inner):
file
function void UMoviePipeline::RenderFrame
Source code excerpt:
// This is still global regardless, individual cameras don't get their own motion blur amount because the engine tick is tied to it.
CachedOutputState.FileMetadata.Add(TEXT("unreal/camera/shutterAngle"), FString::SanitizeFloat(CachedOutputState.TimeData.MotionBlurFraction * 360.0f));
}
if (CurrentCameraCut.State != EMovieRenderShotState::Rendering)
{
// We can optimize some of the settings for 'special' frames we may be rendering, ie: we render once for motion vectors, but
// we don't need that per-tile so we can set the tile count to 1, and spatial sample count to 1 for that particular frame.
{
// Spatial Samples aren't needed when not producing frames (caveat: Render Warmup Frame, handled below)
NumSpatialSamples = 1;
}
}
int32 NumWarmupSamples = 0;
if (CurrentCameraCut.State == EMovieRenderShotState::WarmingUp)
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineRendering.cpp:292
Scope (from outer to inner):
file
function void UMoviePipeline::RenderFrame
Source code excerpt:
// Now we want to render a user-configured number of spatial jitters to come up with the final output for this tile.
for (int32 RenderSampleIndex = 0; RenderSampleIndex < NumSamplesToRender; RenderSampleIndex++)
{
int32 SpatialSampleIndex = (CurrentCameraCut.State == EMovieRenderShotState::WarmingUp) ? 0 : RenderSampleIndex;
if (CurrentCameraCut.State == EMovieRenderShotState::Rendering)
{
// Count this as a sample rendered for the current work.
CurrentCameraCut.WorkMetrics.OutputSubSampleIndex++;
}
// We freeze views for all spatial samples except the last so that nothing in the FSceneView tries to update.
// Our spatial samples need to be different positional takes on the same world, thus pausing it.
const bool bAllowPause = CurrentCameraCut.State == EMovieRenderShotState::Rendering;
const bool bIsLastTile = FIntPoint(TileX, TileY) == FIntPoint(TileCount.X - 1, TileCount.Y - 1);
const bool bWorldIsPaused = bAllowPause && !(bIsLastTile && (RenderSampleIndex == (NumSamplesToRender - 1)));
// We need to pass camera cut flag on the first sample that gets rendered for a given camera cut. If you don't have any render
// warm up frames, we do this on the first render sample because we no longer render the motion blur frame (just evaluate it).
const bool bCameraCut = CachedOutputState.ShotSamplesRendered == 0;
CachedOutputState.ShotSamplesRendered++;
EAntiAliasingMethod AntiAliasingMethod = UE::MovieRenderPipeline::GetEffectiveAntiAliasingMethod(AntiAliasingSettings);
// Now to check if we have to force it off (at which point we warn the user).
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineTiming.cpp:340
Scope (from outer to inner):
file
function void UMoviePipeline::TickProducingFrames
Source code excerpt:
}
AccumulatedTickSubFrameDeltas -= TicksToEndOfPreviousFrame.GetSubFrame();
CurrentCameraCut->ShotInfo.CurrentTickInRoot = CurrentCameraCut->ShotInfo.CurrentTickInRoot - TicksToEndOfPreviousFrame.FloorToFrame();
// Skip to rendering which will skip the next block.
CurrentCameraCut->ShotInfo.State = EMovieRenderShotState::Rendering;
}
// This block is optional, as they may not want motion blur fixes.
if (CurrentCameraCut->ShotInfo.State == EMovieRenderShotState::MotionBlur)
{
CachedOutputState.bSkipRendering = false;
CachedOutputState.bDiscardRenderResult = true;
CachedOutputState.TimeData.MotionBlurFraction = FrameMetrics.ShutterAnglePercentage;
// For the Motion Blur frame, we evaluate the Sequence past the starting frame so that on the next frame
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineTiming.cpp:386
Scope (from outer to inner):
file
function void UMoviePipeline::TickProducingFrames
Source code excerpt:
}
// Alright we're in the point where we finally want to start rendering out frames, we've finished warming up,
// we've evaluated the correct frame to give us motion blur vector sources, etc. This will be called each time
// we advance the world, even when sub-stepping, etc.
if (CurrentCameraCut->ShotInfo.State == EMovieRenderShotState::Rendering)
{
float WorldTimeDilation = GetWorld()->GetWorldSettings()->GetEffectiveTimeDilation();
// This delta time may get modified to respect slowmo tracks and will be converted to seconds for
// engine delta time at the end.
FFrameTime DeltaFrameTime = FFrameTime();
UMoviePipelineAntiAliasingSetting* AntiAliasingSettings = FindOrAddSettingForShot<UMoviePipelineAntiAliasingSetting>(CurrentCameraCut);
check(AntiAliasingSettings);
// If we've rendered the last sample and wrapped around, then we're going to be
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Public/MovieRenderPipelineDataTypes.cpp:47
Scope (from outer to inner):
file
function void FMoviePipelineCameraCutInfo::SetNextStateAfter
Source code excerpt:
State = EMovieRenderShotState::MotionBlur;
}
else
{
UE_LOG(LogMovieRenderPipeline, Verbose, TEXT("[%d] Shot WarmUp finished. Setting state to Rendering due to no MotionBlur pre-frames."), GFrameCounter);
State = EMovieRenderShotState::Rendering;
}
}
break;
// This should only be called once with the Uninitialized state.
case EMovieRenderShotState::Uninitialized:
// Uninitialized can either jump to WarmUp, MotionBlur, or straight to Rendering if no fixes are applied.
if (NumEngineWarmUpFramesRemaining > 0)
{
UE_LOG(LogMovieRenderPipeline, Log, TEXT("[%d] Initialization set state to WarmingUp due to having %d warm up frames."), GFrameCounter, NumEngineWarmUpFramesRemaining);
State = EMovieRenderShotState::WarmingUp;
}
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Public/MovieRenderPipelineDataTypes.cpp:68
Scope (from outer to inner):
file
function void FMoviePipelineCameraCutInfo::SetNextStateAfter
Source code excerpt:
State = EMovieRenderShotState::MotionBlur;
}
else
{
UE_LOG(LogMovieRenderPipeline, Verbose, TEXT("[%d] Initialization set state to Rendering due to no MotionBlur pre-frames."), GFrameCounter);
State = EMovieRenderShotState::Rendering;
}
break;
}
}
MoviePipeline::FMoviePipelineRenderPassInitSettings::FMoviePipelineRenderPassInitSettings()
{
FeatureLevel = GMaxRHIFeatureLevel;
}
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Public/MovieRenderPipelineDataTypes.h:79
Scope: file
Source code excerpt:
MotionBlur = 2,
/*
* The shot is working on producing frames and may be currently doing a sub-frame or
* a whole frame.
*/
Rendering = 3,
/*
* The shot has produced all frames it will produce. No more evaluation should be
* done for this shot once it reaches this state.
*/
Finished = 4
};
USTRUCT(BlueprintType)
struct FMoviePipelinePassIdentifier
{
GENERATED_BODY()
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineRenderPasses/Private/Graph/Renderers/MovieGraphDeferredPass.cpp:122
Scope (from outer to inner):
file
namespace UE::MovieGraph::Rendering
function void FMovieGraphDeferredPass::Render
Source code excerpt:
return;
}
UMovieGraphImagePassBaseNode* ParentNodeThisFrame = GetParentNode(InTimeData.EvaluatedConfig);
const bool bWriteAllSamples = ParentNodeThisFrame->GetWriteAllSamples();
const bool bIsRenderingState = InFrameTraversalContext.Shot->ShotInfo.State == EMovieRenderShotState::Rendering;
int32 NumSpatialSamples = FMath::Max(1, bIsRenderingState ? ParentNodeThisFrame->GetNumSpatialSamples() : ParentNodeThisFrame->GetNumSpatialSamplesDuringWarmUp());
const ESceneCaptureSource SceneCaptureSource = ParentNodeThisFrame->GetDisableToneCurve() ? ESceneCaptureSource::SCS_FinalColorHDR : ESceneCaptureSource::SCS_FinalToneCurveHDR;
const EAntiAliasingMethod AntiAliasingMethod = ParentNodeThisFrame->GetAntiAliasingMethod();
float OverscanFraction = 0.f;
const float TileOverlapPadRatio = 0.0f; // No tiling support right now
// Camera nodes are optional
const bool bIncludeCDOs = false;
const UMovieGraphCameraSettingNode* CameraNode = InTimeData.EvaluatedConfig->GetSettingForBranch<UMovieGraphCameraSettingNode>(LayerData.BranchName, bIncludeCDOs);
if (CameraNode)
#Loc: <Workspace>/Engine/Plugins/Runtime/CableComponent/Source/CableComponent/Private/CableComponent.cpp:636
Scope (from outer to inner):
file
function void CreateDynamicRayTracingGeometries
Source code excerpt:
{
Segment.VertexBuffer = nullptr;
}
Initializer.bAllowUpdate = true;
Initializer.bFastBuild = true;
Initializer.Type = ERayTracingGeometryInitializerType::Rendering;
DynamicRayTracingGeometry.SetInitializer(MoveTemp(Initializer));
DynamicRayTracingGeometry.InitResource(RHICmdList);
}
bool bSupportRayTracing : 1;
bool bDynamicRayTracingGeometry : 1;
bool bNeedsDynamicRayTracingGeometries : 1;
bool bNeedsToUpdateRayTracingCache : 1;
FRayTracingGeometry StaticRayTracingGeometry;
#Loc: <Workspace>/Engine/Plugins/Runtime/XRBase/Source/XRBase/Private/DefaultXRCamera.cpp:216
Scope (from outer to inner):
file
function void FDefaultXRCamera::SetupViewFamily
Source code excerpt:
if (InViewFamily.Views.Num() > 0 && !InViewFamily.Views[0]->bIsSceneCapture)
{
InViewFamily.EngineShowFlags.HMDDistortion = HMD != nullptr ? HMD->GetHMDDistortionEnabled(InViewFamily.Scene->GetShadingPath()) : false;
}
InViewFamily.EngineShowFlags.StereoRendering = bCurrentFrameIsStereoRendering;
InViewFamily.EngineShowFlags.Rendering = HMD != nullptr ? !HMD->IsRenderingPaused() : true;
}
void FDefaultXRCamera::SetupView(FSceneViewFamily& InViewFamily, FSceneView& InView)
{
FQuat DeviceOrientation;
FVector DevicePosition;
if ( TrackingSystem->GetCurrentPose(DeviceId, DeviceOrientation, DevicePosition) )
{
InView.BaseHmdOrientation = DeviceOrientation;
InView.BaseHmdLocation = DevicePosition;
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterConfigurator/Private/Views/Details/Policies/DisplayClusterConfiguratorPolicyDetailCustomization.cpp:620
Scope (from outer to inner):
file
function void FDisplayClusterConfiguratorProjectionCustomization::CreateManualPolicy
Source code excerpt:
void FDisplayClusterConfiguratorProjectionCustomization::CreateManualPolicy(UDisplayClusterBlueprint* Blueprint)
{
check(Blueprint);
const FString RenderingKey = DisplayClusterProjectionStrings::cfg::manual::Rendering;
const FString RenderingMono = DisplayClusterProjectionStrings::cfg::manual::RenderingType::Mono;
const FString RenderingStereo = DisplayClusterProjectionStrings::cfg::manual::RenderingType::Stereo;
const FString RenderingMonoStereo = DisplayClusterProjectionStrings::cfg::manual::RenderingType::MonoStereo;
const FString FrustumKey = DisplayClusterProjectionStrings::cfg::manual::Type;
const FString FrustumMatrix = DisplayClusterProjectionStrings::cfg::manual::FrustumType::Matrix;
const FString FrustumAngles = DisplayClusterProjectionStrings::cfg::manual::FrustumType::Angles;
auto RefreshPolicy = [this](const FString& SelectedItem)
{
PropertyUtilities.Pin()->ForceRefresh();
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterLightCardEditor/Private/DetailCustomizations/DisplayClusterLightCardActorDetails.cpp:24
Scope (from outer to inner):
file
function void FDisplayClusterLightCardActorDetails::CustomizeDetails
Source code excerpt:
TSharedPtr<IPropertyHandle> TranslucencySortPriorityPropertyHandle = LightCardComponentPropertyHandle->GetChildHandle(TEXT("TranslucencySortPriority"));
check(TranslucencySortPriorityPropertyHandle->IsValidHandle());
InLayoutBuilder
.EditCategory(TEXT("Rendering"))
.AddProperty(TranslucencySortPriorityPropertyHandle);
}
// Add the detail views of components added for Light Card Actor Extenders
{
const TSharedRef<IPropertyHandle> ExtenderNameToComponentMapHandle = InLayoutBuilder.GetProperty(ADisplayClusterLightCardActor::GetExtenderNameToComponentMapMemberName());
ExtenderNameToComponentMapHandle->MarkHiddenByCustomization();
TArray<const void*> RawDatas;
ExtenderNameToComponentMapHandle->AccessRawData(RawDatas);
if (!RawDatas.IsEmpty())
{
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterProjection/Private/Policy/Manual/DisplayClusterProjectionManualPolicy.cpp:59
Scope (from outer to inner):
file
function bool FDisplayClusterProjectionManualPolicy::HandleStartScene
Source code excerpt:
UE_LOG(LogDisplayClusterProjectionManual, Log, TEXT("No rotation specified for projection policy of viewport '%s'"), *InViewport->GetId());
}
}
FString RenderType;
DisplayClusterHelpers::map::template ExtractValueFromString(GetParameters(), FString(DisplayClusterProjectionStrings::cfg::manual::Rendering), RenderType);
if (DataType == EManualDataType::Matrix)
{
if (RenderType == DisplayClusterProjectionStrings::cfg::manual::RenderingType::Mono)
{
DisplayClusterHelpers::map::template ExtractValueFromString(GetParameters(), FString(DisplayClusterProjectionStrings::cfg::manual::Matrix), ProjectionMatrix[0]);
}
else // stereo cases
{
DisplayClusterHelpers::map::template ExtractValueFromString(GetParameters(), FString(DisplayClusterProjectionStrings::cfg::manual::MatrixLeft), ProjectionMatrix[0]);
#Loc: <Workspace>/Engine/Plugins/Runtime/nDisplay/Source/DisplayClusterProjection/Public/DisplayClusterProjectionStrings.h:43
Scope (from outer to inner):
file
namespace DisplayClusterProjectionStrings
namespace cfg
namespace manual
Source code excerpt:
static constexpr const TCHAR* EnablePreview = TEXT("EnablePreview");
}
namespace manual
{
static constexpr const TCHAR* Rendering = TEXT("ManualRendering");
static constexpr const TCHAR* Type = TEXT("ManualFrustum");
static constexpr const TCHAR* Rotation = TEXT("rot");
static constexpr const TCHAR* Matrix = TEXT("matrix");
static constexpr const TCHAR* MatrixLeft = TEXT("matrix_left");
static constexpr const TCHAR* MatrixRight = TEXT("matrix_right");
static constexpr const TCHAR* Frustum = TEXT("frustum");
static constexpr const TCHAR* FrustumLeft = TEXT("frustum_left");
static constexpr const TCHAR* FrustumRight = TEXT("frustum_right");
#Loc: <Workspace>/Engine/Plugins/VirtualProduction/DMX/DMXPixelMapping/Source/DMXPixelMappingEditor/Private/Viewports/DMXPixelMappingPreviewViewportClient.cpp:102
Scope (from outer to inner):
file
function void FDMXPixelMappingPreviewViewportClient::Draw
Source code excerpt:
}
// Draw the current render elements
const bool bDrawVisibleRectOnly = IsDrawingVisibleRectOnly();
using namespace UE::DMXPixelMapping::Rendering;
const TArray<TSharedRef<FPixelMapRenderElement>> RenderElements = RendererComponent->GetPixelMapRenderElements();
for (const TSharedRef<FPixelMapRenderElement>& Element : RenderElements)
{
const FVector2D UV = Element->GetParameters().UV;
const FVector2D UVSize = Element->GetParameters().UVSize;
if (bDrawVisibleRectOnly)
{
const FVector2D PositionGraphSpace = UV * FVector2D{ InputTexture->GetSurfaceWidth(), InputTexture->GetSurfaceHeight() };
const FVector2D SizeGraphSpace = UVSize * FVector2D{ InputTexture->GetSurfaceWidth(), InputTexture->GetSurfaceHeight() };
#Loc: <Workspace>/Engine/Plugins/VirtualProduction/DMX/DMXPixelMapping/Source/DMXPixelMappingRuntime/Private/Components/DMXPixelMappingFixtureGroupItemComponent.cpp:400
Scope (from outer to inner):
file
function void UDMXPixelMappingFixtureGroupItemComponent::UpdateRenderElement
Source code excerpt:
return false;
}
void UDMXPixelMappingFixtureGroupItemComponent::UpdateRenderElement()
{
using namespace UE::DMXPixelMapping::Rendering;
const UDMXPixelMappingRendererComponent* RendererComponent = GetRendererComponent();
const UTexture* InputTexture = RendererComponent ? RendererComponent->GetRenderedInputTexture() : nullptr;
const double InputTextureWidth = InputTexture ? InputTexture->GetSurfaceWidth() : 1.0;
const double InputTextureHeight = InputTexture ? InputTexture->GetSurfaceHeight() : 1.0;
FPixelMapRenderElementParameters Parameters;
Parameters.UV = FVector2D(GetPosition().X / InputTextureWidth, GetPosition().Y / InputTextureHeight);
Parameters.UVSize = FVector2D(GetSize().X / InputTextureWidth, GetSize().Y / InputTextureHeight);
FVector2D A;
#Loc: <Workspace>/Engine/Plugins/VirtualProduction/DMX/DMXPixelMapping/Source/DMXPixelMappingRuntime/Private/Components/DMXPixelMappingMatrixCellComponent.cpp:182
Scope (from outer to inner):
file
function void UDMXPixelMappingMatrixCellComponent::UpdateRenderElement
Source code excerpt:
return PixelMapRenderElement.ToSharedRef();
}
void UDMXPixelMappingMatrixCellComponent::UpdateRenderElement()
{
using namespace UE::DMXPixelMapping::Rendering;
UDMXPixelMappingMatrixComponent* MatrixComponent = Cast<UDMXPixelMappingMatrixComponent>(GetParent());
if (!MatrixComponent)
{
return;
}
const UDMXPixelMappingRendererComponent* RendererComponent = GetRendererComponent();
const UTexture* InputTexture = RendererComponent ? RendererComponent->GetRenderedInputTexture() : nullptr;
const double InputTextureWidth = InputTexture ? InputTexture->GetSurfaceWidth() : 1.0;
const double InputTextureHeight = InputTexture ? InputTexture->GetSurfaceHeight() : 1.0;
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Private/EditorCategoryUtils.cpp:199
Scope (from outer to inner):
file
function const FText& FEditorCategoryUtils::GetCommonCategory
Source code excerpt:
CommonCategoryKeys.Add(FCommonEditorCategory::Gameplay, "Gameplay");
CommonCategoryKeys.Add(FCommonEditorCategory::Input, "Input");
CommonCategoryKeys.Add(FCommonEditorCategory::Math, "Math");
CommonCategoryKeys.Add(FCommonEditorCategory::Networking, "Networking");
CommonCategoryKeys.Add(FCommonEditorCategory::Pawn, "Pawn");
CommonCategoryKeys.Add(FCommonEditorCategory::Rendering, "Rendering");
CommonCategoryKeys.Add(FCommonEditorCategory::Utilities, "Utilities");
CommonCategoryKeys.Add(FCommonEditorCategory::Delegates, "Delegates");
CommonCategoryKeys.Add(FCommonEditorCategory::Variables, "Variables");
CommonCategoryKeys.Add(FCommonEditorCategory::Class, "Class");
CommonCategoryKeys.Add(FCommonEditorCategory::UserInterface, "UserInterface");
CommonCategoryKeys.Add(FCommonEditorCategory::AnimNotify, "AnimNotify");
CommonCategoryKeys.Add(FCommonEditorCategory::BranchPoint, "BranchPoint");
CommonCategoryKeys.Add(FCommonEditorCategory::FlowControl, "FlowControl");
CommonCategoryKeys.Add(FCommonEditorCategory::Transformation, "Transformation");
CommonCategoryKeys.Add(FCommonEditorCategory::String, "String");
#Loc: <Workspace>/Engine/Source/Editor/UnrealEd/Public/EditorCategoryUtils.h:35
Scope: file
Source code excerpt:
Input,
Math,
Networking,
Pawn,
Physics,
Rendering,
Transformation,
Utilities,
FlowControl,
UserInterface,
AnimNotify,
BranchPoint,
// Type library categories:
String,
Text,
Name,
#Loc: <Workspace>/Engine/Source/Runtime/D3D12RHI/Private/D3D12RayTracing.cpp:2885
Scope (from outer to inner):
file
function FD3D12RayTracingGeometry::FD3D12RayTracingGeometry
Source code excerpt:
}
}
INC_DWORD_STAT_BY(STAT_D3D12RayTracingTrianglesBLAS, Initializer.TotalPrimitiveCount);
const bool bForRendering = Initializer.Type == ERayTracingGeometryInitializerType::Rendering;
if (Initializer.OfflineData)
{
FD3D12Device* Device = Adapter->GetDevice(0);
const uint8* Data = ((const uint8*)Initializer.OfflineData->GetResourceData()) + sizeof(FOfflineBVHHeader);
uint32 Size = Initializer.OfflineData->GetResourceDataSize() - sizeof(FOfflineBVHHeader);
FD3D12ResourceLocation SrcResourceLoc(Device);
const bool bOnAsyncThread = !IsInRHIThread() && !IsInRenderingThread();
uint8* DstDataBase;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/RendererSettings.cpp:73
Scope (from outer to inner):
file
function URendererSettings::URendererSettings
Source code excerpt:
}
URendererSettings::URendererSettings(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
SectionName = TEXT("Rendering");
TranslucentSortAxis = FVector(0.0f, -1.0f, 0.0f);
bSupportStationarySkylight = true;
bSupportPointLightWholeSceneShadows = true;
MorphTargetMaxBlendWeight = 5.f;
bSupportSkyAtmosphere = true;
bSupportSkinCacheShaders = false;
bSkipCompilingGPUSkinVF = false;
GPUSimulationTextureSizeX = 1024;
GPUSimulationTextureSizeY = 1024;
bEnableRayTracing = 0;
bUseHardwareRayTracingForLumen = 0;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Rendering/NaniteResources.cpp:1809
Scope (from outer to inner):
file
namespace Nanite
function void FSceneProxy::CreateDynamicRayTracingGeometries
Source code excerpt:
{
Segment.VertexBuffer = nullptr;
}
Initializer.bAllowUpdate = true;
Initializer.bFastBuild = true;
Initializer.Type = ERayTracingGeometryInitializerType::Rendering;
DynamicRayTracingGeometries[LODIndex].SetInitializer(MoveTemp(Initializer));
DynamicRayTracingGeometries[LODIndex].InitResource(RHICmdList);
}
}
void FSceneProxy::ReleaseDynamicRayTracingGeometries()
{
for (auto& Geometry : DynamicRayTracingGeometries)
{
Geometry.ReleaseResource();
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/StaticMeshRender.cpp:729
Scope (from outer to inner):
file
function void FStaticMeshSceneProxy::CreateDynamicRayTracingGeometries
Source code excerpt:
{
Segment.VertexBuffer = nullptr;
}
Initializer.bAllowUpdate = true;
Initializer.bFastBuild = true;
Initializer.Type = ERayTracingGeometryInitializerType::Rendering;
DynamicRayTracingGeometries[LODIndex].SetInitializer(MoveTemp(Initializer));
DynamicRayTracingGeometries[LODIndex].InitResource(RHICmdList);
}
}
void FStaticMeshSceneProxy::ReleaseDynamicRayTracingGeometries()
{
for (auto& Geometry : DynamicRayTracingGeometries)
{
Geometry.ReleaseResource();
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Streaming/StaticMeshUpdate.cpp:356
Scope (from outer to inner):
file
function void FStaticMeshStreamIn::DoFinishUpdate
Source code excerpt:
// Here we check that assumption
CheckRayTracingGeometryInitializer(
Context.Mesh,
LODIndex + Context.Mesh->GetStreamableResourceState().AssetLODBias,
LODResource,
ERayTracingGeometryInitializerType::Rendering,
LODResource.RayTracingGeometry.Initializer);
check(EnumHasAllFlags(LODResource.RayTracingGeometry.GetGeometryState(), FRayTracingGeometry::EGeometryStateFlags::StreamedIn));
#endif
// Under very rare circumstances that we switch ray tracing on/off right in the middle of streaming RayTracingGeometryRHI might not be valid.
if (IsRayTracingEnabled() && ensure(LODResource.RayTracingGeometry.RayTracingGeometryRHI.IsValid()))
{
LODResource.RayTracingGeometry.RequestBuildIfNeeded(ERTAccelerationStructureBuildPriority::Normal);
}
}
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Public/ShowFlagsValues.inl:304
Scope: file
Source code excerpt:
/** Render safe frames */
SHOWFLAG_FIXED_IN_SHIPPING(1, CameraSafeFrames, SFG_Advanced, NSLOCTEXT("UnrealEd", "CameraSafeFramesSF", "Camera Safe Frames"))
/** Render TextRenderComponents (3D text), for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(TextRender, SFG_Advanced, NSLOCTEXT("UnrealEd", "TextRenderSF", "Render (3D) Text"))
/** Any rendering/buffer clearing (good for benchmarking and for pausing rendering while the app is not in focus to save cycles). */
SHOWFLAG_ALWAYS_ACCESSIBLE(Rendering, SFG_Hidden, NSLOCTEXT("UnrealEd", "RenderingSF", "Any Rendering")) // do not make it FIXED_IN_SHIPPING, used by Oculus plugin.
/** Show the current mask being used by the highres screenshot capture */
SHOWFLAG_FIXED_IN_SHIPPING(0, HighResScreenshotMask, SFG_Transient, NSLOCTEXT("UnrealEd", "HighResScreenshotMaskSF", "High Res Screenshot Mask"))
/** Distortion of output for HMD devices, SHOWFLAG_ALWAYS_ACCESSIBLE for now because USceneCaptureComponent needs that */
SHOWFLAG_ALWAYS_ACCESSIBLE(HMDDistortion, SFG_PostProcess, NSLOCTEXT("UnrealEd", "HMDDistortionSF", "HMD Distortion"))
/** Whether to render in stereoscopic 3d, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's used by StereoRendering */
SHOWFLAG_ALWAYS_ACCESSIBLE(StereoRendering, SFG_Hidden, NSLOCTEXT("UnrealEd", "StereoRenderingSF", "Stereoscopic Rendering"))
/** Show objects even if they should be distance culled, for now SHOWFLAG_ALWAYS_ACCESSIBLE because it's exposed in SceneCapture */
SHOWFLAG_ALWAYS_ACCESSIBLE(DistanceCulledPrimitives, SFG_Hidden, NSLOCTEXT("UnrealEd", "DistanceCulledPrimitivesSF", "Distance Culled Primitives"))
/** To visualize the culling in Tile Based Deferred Lighting, later for non tiled as well */
SHOWFLAG_FIXED_IN_SHIPPING(0, VisualizeLightCulling, SFG_Hidden, NSLOCTEXT("UnrealEd", "VisualizeLightCullingSF", "Light Culling"))
/** To disable precomputed visibility */
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeGrassMapsBuilder.cpp:323
Scope (from outer to inner):
file
function FLandscapeGrassMapsBuilder::~FLandscapeGrassMapsBuilder
Source code excerpt:
for (auto It = ComponentStates.CreateIterator(); It; ++It)
{
FComponentState* State = It.Value();
UE_LOG(LogGrass, Warning, TEXT("Failed to clear grass data state after %d iterations (stage:%d ticks:%d), forcing deletion of the state."), Iterations, State->Stage, State->TickCount);
if (State->Stage == EComponentStage::Rendering)
{
if ((State->ActiveRender != nullptr) && (State->ActiveRender->AsyncReadbackPtr != nullptr))
{
UE_LOG(LogGrass, Warning, TEXT(" %s"), *State->ActiveRender->AsyncReadbackPtr->ToString());
}
}
else if (State->Stage == EComponentStage::AsyncFetch)
{
if (State->AsyncFetchTask.Get() != nullptr)
{
UE_LOG(LogGrass, Warning, TEXT(" AsyncFetchTask: %p"), State->AsyncFetchTask.Get());
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeGrassMapsBuilder.cpp:441
Scope (from outer to inner):
file
function bool FLandscapeGrassMapsBuilder::UpdateTrackedComponents
Source code excerpt:
case EComponentStage::TextureStreaming:
// don't process streaming states yet -- first process rendering states to free up slots
StreamingStatesToProcess.Add(State);
continue; // next!
case EComponentStage::Rendering:
check(State->ActiveRender != nullptr);
{
// NOTE: on RHI platforms that don't support fences (D3D11), the IsReady() async check will never return true within a single frame (i.e. BuildGrassMapsNow)
// So it will never signal complete, unless we force it to finish after a number of ticks
// in general 3 ticks should be the max latency we should ever see in an amortized use case
const bool bForceFinish = (State->TickCount > 4);
const bool bComplete = State->ActiveRender->CheckAndUpdateAsyncReadback(bRenderCommandsQueuedByLastUpdate, bForceFinish);
if (bComplete)
{
if (GGrassMapUseAsyncFetch != 0)
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeGrassMapsBuilder.cpp:959
Scope (from outer to inner):
file
function bool FLandscapeGrassMapsBuilder::CancelAndEvict
Source code excerpt:
StreamingCount--;
PendingCount++;
DEBUG_TRANSITION(State, TextureStreaming, Pending);
}
break;
case EComponentStage::Rendering:
{
RemoveTextureStreamingRequests(State);
if (State.ActiveRender != nullptr)
{
// calling update ensures it is pushed forward if there is still a readback in progress
bool bNewRenderCommands = false;
if (bCancelImmediately)
{
// release active render from the state, and cancel and self destruct it
FLandscapeGrassWeightExporter* Render = State.ActiveRender.Release();
Render->CancelAndSelfDestruct();
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeGrassMapsBuilder.cpp:986
Scope (from outer to inner):
file
function bool FLandscapeGrassMapsBuilder::CancelAndEvict
Source code excerpt:
}
}
check(RenderingCount > 0);
RenderingCount--;
PendingCount++;
DEBUG_TRANSITION(State, Rendering, Pending);
}
break;
case EComponentStage::AsyncFetch:
{
FAsyncTask<FAsyncFetchTask>* Task = State.AsyncFetchTask.Get();
if (Task != nullptr)
{
if (bCancelImmediately)
{
Task->EnsureCompletion(/* bDoWorkOnThisThreadIfNotStarted= */ true, /* bIsLatencySensitive= */ true);
}
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeGrassMapsBuilder.cpp:1266
Scope (from outer to inner):
file
function void FLandscapeGrassMapsBuilder::KickOffRenderAndReadback
Source code excerpt:
constexpr bool bInNeedsGrassmap = true;
constexpr bool bInNeedsHeightmap = true;
State.ActiveRender.Reset(new FLandscapeGrassWeightExporter(Component->GetLandscapeProxy(), { Component }, bInNeedsGrassmap, bInNeedsHeightmap, MoveTemp(HeightMips)));
check(State.ActiveRender != nullptr);
State.Stage = EComponentStage::Rendering;
RenderingCount++;
DEBUG_TRANSITION(State, Streaming, Rendering);
State.TickCount = 0;
}
void FLandscapeGrassMapsBuilder::LaunchAsyncFetchTask(FComponentState& State)
{
SCOPE_CYCLE_COUNTER(STAT_PopulateGrassMap);
check(State.Stage == EComponentStage::Rendering);
check(RenderingCount > 0);
RenderingCount--;
// now that render is complete, we can drop the texture streaming requests and allow textures to stream out
RemoveTextureStreamingRequests(State);
check(State.ActiveRender != nullptr);
State.AsyncFetchTask.Reset(new FAsyncTask<FAsyncFetchTask>(State.ActiveRender.Get()));
State.AsyncFetchTask->StartBackgroundTask();
State.Stage = EComponentStage::AsyncFetch;
AsyncFetchCount++;
DEBUG_TRANSITION(State, Rendering, AsyncFetch);
State.TickCount = 0;
}
void FLandscapeGrassMapsBuilder::PopulateGrassDataFromAsyncFetchTask(FComponentState& State)
{
check(AsyncFetchCount > 0);
AsyncFetchCount--;
State.ActiveRender->FreeAsyncReadback();
FAsyncFetchTask& Inner = State.AsyncFetchTask->GetTask();
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeGrassMapsBuilder.cpp:1319
Scope (from outer to inner):
file
function void FLandscapeGrassMapsBuilder::PopulateGrassDataFromReadback
Source code excerpt:
void FLandscapeGrassMapsBuilder::PopulateGrassDataFromReadback(FComponentState& State)
{
SCOPE_CYCLE_COUNTER(STAT_PopulateGrassMap);
check(State.Stage == EComponentStage::Rendering);
check(RenderingCount > 0);
RenderingCount--;
// now that render is complete, we can drop the texture streaming requests and allow textures to stream out
RemoveTextureStreamingRequests(State);
check(State.ActiveRender != nullptr);
State.ActiveRender->ApplyResults();
State.ActiveRender.Reset();
State.Stage = EComponentStage::GrassMapsPopulated;
PopulatedCount++;
DEBUG_TRANSITION(State, Rendering, Populated);
State.TickCount = 0;
}
void FLandscapeGrassMapsBuilder::RemoveTextureStreamingRequests(FComponentState& State)
{
for (UTexture* Texture : State.TexturesToStream)
{
TextureStreamingManager.UnrequestTextureFullyStreamedIn(Texture);
}
State.TexturesToStream.Empty();
}
#Loc: <Workspace>/Engine/Source/Runtime/Landscape/Private/LandscapeGrassMapsBuilder.h:88
Scope (from outer to inner):
file
class class FLandscapeGrassMapsBuilder
Source code excerpt:
enum class EComponentStage
{
Pending, // initial state; the component is waiting to start the generation process.
NotReady, // tried to start generation process, but either no grass types exist or the material is not ready. wait for that to change.
TextureStreaming, // texture streaming was requested. wait for the mips to be available
Rendering, // GPU render commands were sent -- waiting for async readback to complete
AsyncFetch, // Waiting for the async fetch task to complete
GrassMapsPopulated, // grass maps are built and are ready to create instances
};
struct FComponentState
{
public:
// this pointer is valid as long as the Component is registered
// (the FComponentState itself may continue to exist after unregistration, until all resources are cleaned up)
ULandscapeComponent* Component = nullptr;
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/RHIResources.h:2934
Scope: file
Source code excerpt:
DECLARE_INTRINSIC_TYPE_LAYOUT(ERayTracingGeometryType);
enum class ERayTracingGeometryInitializerType
{
// Fully initializes the RayTracingGeometry object: creates underlying buffer and initializes shader parameters.
Rendering,
// Does not create underlying buffer or shader parameters. Used by the streaming system as an object that is streamed into.
StreamingDestination,
// Creates buffers but does not create shader parameters. Used for intermediate objects in the streaming system.
StreamingSource,
};
DECLARE_INTRINSIC_TYPE_LAYOUT(ERayTracingGeometryInitializerType);
struct FRayTracingGeometrySegment
{
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/RHIResources.h:3003
Scope: file
Source code excerpt:
FRHIRayTracingGeometry* SourceGeometry = nullptr;
bool bFastBuild = false;
bool bAllowUpdate = false;
bool bAllowCompaction = true;
ERayTracingGeometryInitializerType Type = ERayTracingGeometryInitializerType::Rendering;
// Use FDebugName for auto-generated debug names with numbered suffixes, it is a variation of FMemoryImageName with optional number postfix.
FDebugName DebugName;
// Store the path name of the owner object for resource tracking. FMemoryImageName allows a conversion to/from FName.
FName OwnerName;
};
enum ERayTracingSceneLifetime
{
// Scene may only be used during the frame when it was created.
RTSL_SingleFrame,
#Loc: <Workspace>/Engine/Source/Runtime/RHI/Public/RHIResources.h:3132
Scope (from outer to inner):
file
class class FRHIRayTracingGeometry : public FRHIRayTracingAccelerationStructure
Source code excerpt:
{
return Initializer.Segments.Num();
}
protected:
FRayTracingGeometryInitializer Initializer = {};
ERayTracingGeometryInitializerType InitializedType = ERayTracingGeometryInitializerType::Rendering;
};
/** Top level ray tracing acceleration structure (contains instances of meshes). */
class FRHIRayTracingScene : public FRHIRayTracingAccelerationStructure
{
public:
virtual const FRayTracingSceneInitializer2& GetInitializer() const = 0;
// Returns a buffer view for RHI-specific system parameters associated with this scene.
// This may be needed to access ray tracing geometry data in shaders that use ray queries.
// Returns NULL if current RHI does not require this buffer.
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:981
Scope: file
Source code excerpt:
enum class FStagingResourceStatus
{
Unused,
RenderingIntermediaryOnly,
Rendering,
WritingToDisk,
WritingToDiskComplete,
};
struct FStagingPoolEntry
{
FStagingResourceStatus Status = FStagingResourceStatus::Unused;
FString DumpFilePath;
int32 GPUIndex = 0;
FGPUFenceRHIRef WriteToResourceComplete;
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:1059
Scope (from outer to inner):
file
function FStagingTexturePoolEntry& ReuseStagingTexture
Source code excerpt:
if (Entry->Status == FStagingResourceStatus::Unused)
{
check(Entry->Texture.GetRefCount() == 1);
*Texture = Entry->Texture;
check(Entry->Texture.GetRefCount() == 2);
Entry->Status = FStagingResourceStatus::Rendering;
Entry->WriteToResourceComplete->Clear();
return *Entry;
}
}
else
{
if (Entry->Status == FStagingResourceStatus::RenderingIntermediaryOnly && Entry->Texture.GetRefCount() == 1)
{
*Texture = Entry->Texture;
check(Entry->Texture.GetRefCount() == 2);
check(!Entry->WriteToResourceComplete);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:1079
Scope (from outer to inner):
file
function FStagingTexturePoolEntry& ReuseStagingTexture
Source code excerpt:
}
CreateStagingTexture(Desc, /* out */ Texture);
FStagingTexturePoolEntry* NewEntry = new FStagingTexturePoolEntry;
NewEntry->Status = Access == ERHIAccess::CopyDest ? FStagingResourceStatus::Rendering : FStagingResourceStatus::RenderingIntermediaryOnly;
NewEntry->Desc = Desc;
NewEntry->Texture = *Texture;
StagingTexturePool.Add(TUniquePtr<FStagingTexturePoolEntry>(NewEntry));
RHICmdList.Transition(FRHITransitionInfo(*Texture, ERHIAccess::Unknown, Access));
if (UAV)
{
check(Access == ERHIAccess::UAVCompute);
NewEntry->UAV = CreateUAVNoLifetimeExtension(RHICmdList, *Texture, /* MipLevel = */ 0);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:1119
Scope (from outer to inner):
file
function FStagingBufferPoolEntry& ReuseStagingBuffer
Source code excerpt:
continue;
}
if (Entry->Status == FStagingResourceStatus::Unused)
{
Entry->Status = FStagingResourceStatus::Rendering;
Entry->WriteToResourceComplete->Clear();
return *Entry;
}
}
FStagingBufferPoolEntry* NewEntry = new FStagingBufferPoolEntry;
NewEntry->Status = FStagingResourceStatus::Rendering;
NewEntry->ByteSize = ByteSize;
NewEntry->StagingBuffer = RHICreateStagingBuffer();
NewEntry->StagingBuffer->DisableLifetimeExtension();
NewEntry->WriteToResourceComplete = RHICreateGPUFence(GDumpGPUBufferFenceName);
NewEntry->WriteToResourceComplete->Clear();
StagingBufferPool.Add(TUniquePtr<FStagingBufferPoolEntry>(NewEntry));
return *NewEntry;
}
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:1827
Scope (from outer to inner):
file
function void LandCompletedResources
Source code excerpt:
{
check(IsInRenderingThread());
check(bStream);
for (TUniquePtr<FStagingTexturePoolEntry>& Entry : StagingTexturePool)
{
if (Entry->Status == FStagingResourceStatus::Rendering)
{
// Try lock the staging surface.
void* Content = nullptr;
int32 RowPitchInPixels = 0;
int32 ColumnPitchInPixels = 0;
RHICmdList.MapStagingSurface(Entry->Texture, Entry->WriteToResourceComplete.GetReference(), Content, RowPitchInPixels, ColumnPitchInPixels, Entry->GPUIndex);
if (!Content)
{
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/DumpGPU.cpp:1879
Scope (from outer to inner):
file
function void LandCompletedResources
Source code excerpt:
}
}
for (TUniquePtr<FStagingBufferPoolEntry>& Entry : StagingBufferPool)
{
if (Entry->Status == FStagingResourceStatus::Rendering)
{
// Try lock the staging buffer.
void* Content = RHICmdList.LockStagingBuffer(Entry->StagingBuffer, Entry->WriteToResourceComplete.GetReference(), 0, Entry->ByteSize);
if (!Content)
{
// NOP
}
else
{
check(Entry->WriteToDiskComplete == nullptr);
Entry->WriteToDiskComplete = FPlatformProcess::GetSynchEventFromPool(true);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RayTracingGeometry.cpp:31
Scope (from outer to inner):
file
function void FRayTracingGeometry::InitRHIForStreaming
Source code excerpt:
ensureMsgf(RayTracingGeometryRHI || !IsRayTracingEnabled(),
TEXT("RayTracingGeometryRHI should be valid when ray tracing is enabled.\n")
TEXT("This check failing points to a race condition between FRayTracingGeometryManager::Tick(...) and FStaticMeshStreamIn processing.\n")
);
Initializer.Type = ERayTracingGeometryInitializerType::Rendering;
EnumAddFlags(GeometryState, EGeometryStateFlags::StreamedIn);
if (RayTracingGeometryRHI && IntermediateGeometry)
{
Batcher.QueueUpdateRequest(RayTracingGeometryRHI, IntermediateGeometry);
EnumAddFlags(GeometryState, EGeometryStateFlags::Valid);
}
else
{
check(GetRayTracingMode() == ERayTracingMode::Dynamic);
#Loc: <Workspace>/Engine/Source/Runtime/RenderCore/Private/RayTracingGeometry.cpp:265
Scope (from outer to inner):
file
function void FRayTracingGeometry::InitRHI
Source code excerpt:
void FRayTracingGeometry::InitRHI(FRHICommandListBase& RHICmdList)
{
if (!IsRayTracingAllowed())
return;
ERTAccelerationStructureBuildPriority BuildPriority = Initializer.Type != ERayTracingGeometryInitializerType::Rendering
? ERTAccelerationStructureBuildPriority::Skip
: ERTAccelerationStructureBuildPriority::Normal;
CreateRayTracingGeometry(RHICmdList, BuildPriority);
}
void FRayTracingGeometry::ReleaseRHI()
{
RemoveBuildRequest();
RayTracingGeometryRHI.SafeRelease();
GeometryState = EGeometryStateFlags::Invalid;
}
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/DeferredShadingRenderer.cpp:1440
Scope (from outer to inner):
file
function void FDeferredShadingSceneRenderer::Render
Source code excerpt:
}
}
void FDeferredShadingSceneRenderer::Render(FRDGBuilder& GraphBuilder)
{
if (!ViewFamily.EngineShowFlags.Rendering)
{
return;
}
// If this is scene capture rendering depth pre-pass, we'll take the shortcut function RenderSceneCaptureDepth if optimization switch is on.
const ERendererOutput RendererOutput = GetRendererOutput();
const bool bNaniteEnabled = ShouldRenderNanite();
const bool bHasRayTracedOverlay = HasRayTracedOverlay(ViewFamily);
#if !UE_BUILD_SHIPPING
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/MobileShadingRenderer.cpp:906
Scope (from outer to inner):
file
function void FMobileSceneRenderer::Render
Source code excerpt:
}
}
void FMobileSceneRenderer::Render(FRDGBuilder& GraphBuilder)
{
if (!ViewFamily.EngineShowFlags.Rendering)
{
return;
}
const ERendererOutput RendererOutput = GetRendererOutput();
const bool bRendererOutputFinalSceneColor = (RendererOutput == ERendererOutput::FinalSceneColor);
GraphBuilder.SetCommandListStat(GET_STATID(STAT_CLMM_SceneStart));
RDG_RHI_EVENT_SCOPE(GraphBuilder, MobileSceneRender);
RDG_RHI_GPU_STAT_SCOPE(GraphBuilder, MobileSceneRender);
#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanRayTracing.cpp:99
Scope: file
Source code excerpt:
#endif
enum class EBLASBuildDataUsage
{
// Uses provided VB/IB when filling out BLAS build data
Rendering = 0,
// Does not use VB/IB. Special mode for estimating BLAS size.
Size = 1
};
// Temporary brute force allocation helper, this should be handled by the memory sub-allocator
static uint32 FindMemoryType(VkPhysicalDevice Gpu, uint32 Filter, VkMemoryPropertyFlags RequestedProperties)
{
VkPhysicalDeviceMemoryProperties Properties = {};
VulkanRHI::vkGetPhysicalDeviceMemoryProperties(Gpu, &Properties);
#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanRayTracing.cpp:192
Scope (from outer to inner):
file
function static void GetBLASBuildData
Source code excerpt:
// We only need to get IB/VB address when we are getting data for rendering. For estimating BLAS size we set them to 0.
// According to vulkan spec any VkDeviceOrHostAddressKHR members are ignored in vkGetAccelerationStructureBuildSizesKHR.
uint32 IndexStrideInBytes = 0;
if (IndexBufferRHI)
{
IndexBufferDeviceAddress.deviceAddress = Usage == EBLASBuildDataUsage::Rendering ? IndexBuffer->GetDeviceAddress() + IndexBufferOffset : 0;
// In case we are just calculating size but index buffer is not yet in valid state we assume the geometry is using uint32 format
IndexStrideInBytes = Usage == EBLASBuildDataUsage::Rendering
? IndexBuffer->GetStride()
: (IndexBuffer->GetSize() > 0) ? IndexBuffer->GetStride() : 4;
}
TArray<uint32, TInlineAllocator<1>> PrimitiveCounts;
for (int32 SegmentIndex = 0; SegmentIndex < Segments.Num(); ++SegmentIndex)
{
const FRayTracingGeometrySegment& Segment = Segments[SegmentIndex];
FVulkanResourceMultiBuffer* const VertexBuffer = ResourceCast(Segment.VertexBuffer.GetReference());
VkDeviceOrHostAddressConstKHR VertexBufferDeviceAddress = {};
VertexBufferDeviceAddress.deviceAddress = Usage == EBLASBuildDataUsage::Rendering
? VertexBuffer->GetDeviceAddress() + Segment.VertexBufferOffset
: 0;
VkAccelerationStructureGeometryKHR SegmentGeometry;
ZeroVulkanStruct(SegmentGeometry, VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_KHR);
if (Segment.bForceOpaque)
{
SegmentGeometry.flags |= VK_GEOMETRY_OPAQUE_BIT_KHR;
}
#Loc: <Workspace>/Engine/Source/Runtime/VulkanRHI/Private/VulkanRayTracing.cpp:1216
Scope (from outer to inner):
file
function void FVulkanCommandListContext::RHIBuildAccelerationStructures
Source code excerpt:
Geometry->Initializer.GeometryType,
Geometry->Initializer.IndexBuffer,
Geometry->Initializer.IndexBufferOffset,
GetRayTracingAccelerationStructureBuildFlags(Geometry->Initializer),
P.BuildMode,
EBLASBuildDataUsage::Rendering,
BuildData);
check(BuildData.SizesInfo.accelerationStructureSize <= Geometry->AccelerationStructureBuffer->GetSize());
BuildData.GeometryInfo.dstAccelerationStructure = Geometry->Handle;
BuildData.GeometryInfo.srcAccelerationStructure = bIsUpdate ? Geometry->Handle : VK_NULL_HANDLE;
VkDeviceAddress ScratchBufferAddress = ScratchBuffer->GetDeviceAddress() + ScratchBufferOffset;
ScratchBufferOffset += ScratchBufferRequiredSize;
checkf(ScratchBufferAddress % GRHIRayTracingScratchBufferAlignment == 0,