Move fullscreen graph ownership out of pass transitions

This commit is contained in:
2026-04-14 13:48:59 +08:00
parent 8bd375cd24
commit 9950e0a44f
6 changed files with 108 additions and 7 deletions

View File

@@ -84,6 +84,24 @@ RenderGraphTextureHandle RenderGraphBuilder::CreateTransientTexture(
return handle;
}
void RenderGraphBuilder::MergeImportedTextureOptions(
RenderGraphTextureHandle handle,
const RenderGraphImportedTextureOptions& importedOptions) {
if (!handle.IsValid() || handle.index >= m_graph.m_textures.size()) {
return;
}
RenderGraph::TextureResource& resource = m_graph.m_textures[handle.index];
if (resource.kind != RenderGraphTextureKind::Imported) {
return;
}
resource.importedOptions.graphOwnsTransitions =
resource.importedOptions.graphOwnsTransitions ||
importedOptions.graphOwnsTransitions;
resource.importedOptions.finalState = importedOptions.finalState;
}
RenderGraphPassHandle RenderGraphBuilder::AddRasterPass(
const Containers::String& name,
const std::function<void(RenderGraphPassBuilder&)>& setup) {

View File

@@ -116,6 +116,10 @@ public:
m_graph.m_textures[handle.index].kind == RenderGraphTextureKind::Transient;
}
bool OwnsTextureTransitions(RenderGraphTextureHandle handle) const {
return ShouldGraphManageTransitions(handle);
}
bool TransitionGraphOwnedImportsToFinalStates(
const RenderContext& renderContext,
Containers::String* outErrorMessage) {
@@ -317,6 +321,11 @@ bool RenderGraphExecutionContext::IsTransientTexture(RenderGraphTextureHandle ha
runtimeResources->IsTransientTexture(handle);
}
bool RenderGraphExecutionContext::OwnsTextureTransitions(RenderGraphTextureHandle handle) const {
return runtimeResources != nullptr &&
runtimeResources->OwnsTextureTransitions(handle);
}
bool RenderGraphExecutor::Execute(
const CompiledRenderGraph& graph,
const RenderContext& renderContext,