diff options
Diffstat (limited to 'tools/gfx/simple-render-pass-layout.cpp')
| -rw-r--r-- | tools/gfx/simple-render-pass-layout.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/gfx/simple-render-pass-layout.cpp b/tools/gfx/simple-render-pass-layout.cpp new file mode 100644 index 000000000..8821df87c --- /dev/null +++ b/tools/gfx/simple-render-pass-layout.cpp @@ -0,0 +1,25 @@ +#include "simple-render-pass-layout.h" + +#include "renderer-shared.h" + +namespace gfx +{ + +IRenderPassLayout* SimpleRenderPassLayout::getInterface(const Slang::Guid& guid) +{ + if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IRenderPassLayout) + return static_cast<IRenderPassLayout*>(this); + return nullptr; +} + +void SimpleRenderPassLayout::init(const IRenderPassLayout::Desc& desc) +{ + m_renderTargetAccesses.setCount(desc.renderTargetCount); + for (uint32_t i = 0; i < desc.renderTargetCount; i++) + m_renderTargetAccesses[i] = desc.renderTargetAccess[i]; + m_hasDepthStencil = (desc.depthStencilAccess != nullptr); + if (m_hasDepthStencil) + m_depthStencilAccess = *desc.depthStencilAccess; +} + +} // namespace gfx |
