Integrate render target handling in frame graphs (#411)

* Graphics: Integrate RenderTarget in FrameGraph

- This handles the blit to texture/swapchain in the FrameGraph and fixes RenderTextureBlit
- Dummy attachments were added to the FrameGraph class to handle link without texture (used to setup a dependency between two passes with no texture)
- FramePass now supports custom access/layout/usage for inputs

* Graphics/RenderTarget: Allow to set any RenderTarget as output
This commit is contained in:
Jérôme Leclercq
2023-11-28 21:00:57 +01:00
committed by GitHub
parent f57fc3c1d5
commit 32d227628c
19 changed files with 490 additions and 340 deletions

View File

@@ -73,7 +73,9 @@ namespace Nz
inline void SetDepthStencilInput(std::size_t attachmentId);
inline void SetDepthStencilOutput(std::size_t attachmentId);
inline void SetExecutionCallback(ExecutionCallback callback);
inline void SetInputLayout(std::size_t inputIndex, TextureLayout layout);
inline void SetInputAccess(std::size_t inputIndex, TextureLayout layout, PipelineStageFlags stageFlags, MemoryAccessFlags accessFlags);
inline void SetInputAssumedLayout(std::size_t inputIndex, TextureLayout layout);
inline void SetInputUsage(std::size_t inputIndex, TextureUsageFlags usageFlags);
inline void SetReadInput(std::size_t inputIndex, bool doesRead);
FramePass& operator=(const FramePass&) = delete;
@@ -90,7 +92,11 @@ namespace Nz
struct Input
{
std::optional<TextureLayout> assumedLayout;
std::optional<TextureUsageFlags> textureUsageFlags;
std::size_t attachmentId;
MemoryAccessFlags accessFlags = MemoryAccess::ShaderRead;
PipelineStageFlags stageFlags = PipelineStage::FragmentShader;
TextureLayout layout = TextureLayout::ColorInput;
bool doesRead = true;
};