Graphics/FramePass: Add SetReadInput method

This commit is contained in:
Jérôme Leclercq
2021-12-13 23:44:34 +01:00
parent dfa2a0040a
commit 90ab0e9438
4 changed files with 17 additions and 13 deletions

View File

@@ -61,10 +61,10 @@ namespace Nz
inline void SetCommandCallback(CommandCallback callback);
inline void SetClearColor(std::size_t outputIndex, const std::optional<Color>& color);
inline void SetDepthStencilClear(float depth, UInt32 stencil);
inline void SetExecutionCallback(ExecutionCallback callback);
inline void SetDepthStencilInput(std::size_t attachmentId);
inline void SetDepthStencilOutput(std::size_t attachmentId);
inline void SetExecutionCallback(ExecutionCallback callback);
inline void SetReadInput(std::size_t inputIndex, bool doesRead);
FramePass& operator=(const FramePass&) = delete;
FramePass& operator=(FramePass&&) noexcept = default;
@@ -80,6 +80,7 @@ namespace Nz
struct Input
{
std::size_t attachmentId;
bool doesRead = true;
};
struct Output

View File

@@ -126,6 +126,12 @@ namespace Nz
m_executionCallback = std::move(callback);
}
inline void FramePass::SetReadInput(std::size_t inputIndex, bool doesRead)
{
assert(inputIndex < m_inputs.size());
m_inputs[inputIndex].doesRead = doesRead;
}
inline void FramePass::SetDepthStencilInput(std::size_t attachmentId)
{
m_depthStencilInput = attachmentId;