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

@@ -38,6 +38,7 @@ private:
struct TextureAccess {
RenderGraphTextureHandle texture = {};
RenderGraphAccessMode mode = RenderGraphAccessMode::Read;
RenderGraphTextureAspect aspect = RenderGraphTextureAspect::Color;
};
struct PassNode {
@@ -60,6 +61,8 @@ class RenderGraphPassBuilder {
public:
void ReadTexture(RenderGraphTextureHandle texture);
void WriteTexture(RenderGraphTextureHandle texture);
void ReadDepthTexture(RenderGraphTextureHandle texture);
void WriteDepthTexture(RenderGraphTextureHandle texture);
void SetExecuteCallback(RenderGraphExecuteCallback callback);
private:

View File

@@ -31,6 +31,7 @@ private:
struct CompiledTextureAccess {
RenderGraphTextureHandle texture = {};
RenderGraphAccessMode mode = RenderGraphAccessMode::Read;
RenderGraphTextureAspect aspect = RenderGraphTextureAspect::Color;
RHI::ResourceStates requiredState = RHI::ResourceStates::Common;
};

View File

@@ -35,6 +35,11 @@ enum class RenderGraphAccessMode : Core::uint8 {
Write = 1
};
enum class RenderGraphTextureAspect : Core::uint8 {
Color = 0,
Depth = 1
};
enum class RenderGraphTextureViewType : Core::uint8 {
RenderTarget = 0,
ShaderResource = 1