Add render graph depth access semantics

This commit is contained in:
2026-04-14 13:56:08 +08:00
parent 9950e0a44f
commit 87bf83451b
7 changed files with 93 additions and 5 deletions

View File

@@ -25,6 +25,7 @@ void RenderGraphPassBuilder::ReadTexture(RenderGraphTextureHandle texture) {
RenderGraph::TextureAccess access = {};
access.texture = texture;
access.mode = RenderGraphAccessMode::Read;
access.aspect = RenderGraphTextureAspect::Color;
m_graph->m_passes[m_passHandle.index].accesses.push_back(access);
}
@@ -36,6 +37,31 @@ void RenderGraphPassBuilder::WriteTexture(RenderGraphTextureHandle texture) {
RenderGraph::TextureAccess access = {};
access.texture = texture;
access.mode = RenderGraphAccessMode::Write;
access.aspect = RenderGraphTextureAspect::Color;
m_graph->m_passes[m_passHandle.index].accesses.push_back(access);
}
void RenderGraphPassBuilder::ReadDepthTexture(RenderGraphTextureHandle texture) {
if (m_graph == nullptr || !m_passHandle.IsValid()) {
return;
}
RenderGraph::TextureAccess access = {};
access.texture = texture;
access.mode = RenderGraphAccessMode::Read;
access.aspect = RenderGraphTextureAspect::Depth;
m_graph->m_passes[m_passHandle.index].accesses.push_back(access);
}
void RenderGraphPassBuilder::WriteDepthTexture(RenderGraphTextureHandle texture) {
if (m_graph == nullptr || !m_passHandle.IsValid()) {
return;
}
RenderGraph::TextureAccess access = {};
access.texture = texture;
access.mode = RenderGraphAccessMode::Write;
access.aspect = RenderGraphTextureAspect::Depth;
m_graph->m_passes[m_passHandle.index].accesses.push_back(access);
}