Graphics/FramePipelinePass: Replace pointer + size by span
This commit is contained in:
parent
7cd1b32e95
commit
9fb308a531
|
|
@ -14,6 +14,7 @@
|
|||
#include <Nazara/Math/Rect.hpp>
|
||||
#include <NazaraUtils/Bitset.hpp>
|
||||
#include <limits>
|
||||
#include <span>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
|
|
@ -74,13 +75,10 @@ namespace Nz
|
|||
|
||||
struct PassInputOuputs
|
||||
{
|
||||
// TODO: Add Nz::View / Nz::Span
|
||||
const std::size_t* inputAttachments;
|
||||
const std::size_t* outputAttachments;
|
||||
std::span<const std::size_t> inputAttachments;
|
||||
std::span<const std::size_t> outputAttachments;
|
||||
std::size_t depthStencilInput = InvalidAttachmentIndex;
|
||||
std::size_t depthStencilOutput = InvalidAttachmentIndex;
|
||||
std::size_t inputCount = 0;
|
||||
std::size_t outputCount = 0;
|
||||
};
|
||||
|
||||
struct VisibleRenderable
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ namespace Nz
|
|||
|
||||
FramePass& DebugDrawPipelinePass::RegisterToFrameGraph(FrameGraph& frameGraph, const PassInputOuputs& inputOuputs)
|
||||
{
|
||||
if (inputOuputs.inputCount != 1)
|
||||
if (inputOuputs.inputAttachments.size() != 1)
|
||||
throw std::runtime_error("one input expected");
|
||||
|
||||
if (inputOuputs.outputCount != 1)
|
||||
if (inputOuputs.outputAttachments.size() != 1)
|
||||
throw std::runtime_error("one output expected");
|
||||
|
||||
FramePass& debugDrawPass = frameGraph.AddPass("Debug draw pass");
|
||||
|
|
|
|||
|
|
@ -119,10 +119,10 @@ namespace Nz
|
|||
|
||||
FramePass& DepthPipelinePass::RegisterToFrameGraph(FrameGraph& frameGraph, const PassInputOuputs& inputOuputs)
|
||||
{
|
||||
if (inputOuputs.inputCount > 0)
|
||||
if (inputOuputs.inputAttachments.size() > 0)
|
||||
throw std::runtime_error("no input expected");
|
||||
|
||||
if (inputOuputs.outputCount > 0)
|
||||
if (inputOuputs.outputAttachments.size() > 0)
|
||||
throw std::runtime_error("no output expected");
|
||||
|
||||
if (inputOuputs.depthStencilInput != InvalidAttachmentIndex)
|
||||
|
|
|
|||
|
|
@ -146,10 +146,10 @@ namespace Nz
|
|||
|
||||
FramePass& ForwardPipelinePass::RegisterToFrameGraph(FrameGraph& frameGraph, const PassInputOuputs& inputOuputs)
|
||||
{
|
||||
if (inputOuputs.inputCount > 0)
|
||||
if (inputOuputs.inputAttachments.size() > 0)
|
||||
throw std::runtime_error("no input expected");
|
||||
|
||||
if (inputOuputs.outputCount != 1)
|
||||
if (inputOuputs.outputAttachments.size() != 1)
|
||||
throw std::runtime_error("one output expected");
|
||||
|
||||
if (inputOuputs.depthStencilOutput == InvalidAttachmentIndex)
|
||||
|
|
|
|||
|
|
@ -83,10 +83,8 @@ namespace Nz
|
|||
FramePipelinePass::PassInputOuputs passInputOuputs;
|
||||
passInputOuputs.depthStencilInput = GetAttachmentIndex(passData.depthStencilInput);
|
||||
passInputOuputs.depthStencilOutput = GetAttachmentIndex(passData.depthStencilOutput);
|
||||
passInputOuputs.inputAttachments = inputs.data();
|
||||
passInputOuputs.inputCount = passData.inputs.size();
|
||||
passInputOuputs.outputAttachments = outputs.data();
|
||||
passInputOuputs.outputCount = passData.outputs.size();
|
||||
passInputOuputs.inputAttachments = inputs;
|
||||
passInputOuputs.outputAttachments = outputs;
|
||||
|
||||
FramePass& framePass = passes[passIndex]->RegisterToFrameGraph(frameGraph, passInputOuputs);
|
||||
if (passCallback)
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ namespace Nz
|
|||
|
||||
FramePass& PostProcessPipelinePass::RegisterToFrameGraph(FrameGraph& frameGraph, const PassInputOuputs& inputOuputs)
|
||||
{
|
||||
if (inputOuputs.inputCount != 1)
|
||||
if (inputOuputs.inputAttachments.size() != 1)
|
||||
throw std::runtime_error("one input expected");
|
||||
|
||||
if (inputOuputs.outputCount != 1)
|
||||
if (inputOuputs.outputAttachments.size() != 1)
|
||||
throw std::runtime_error("one output expected");
|
||||
|
||||
if (inputOuputs.depthStencilInput != InvalidAttachmentIndex)
|
||||
|
|
|
|||
Loading…
Reference in New Issue