From a5ac4999b4dea546a7ef824669ab1809224b6448 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 4 Mar 2021 16:25:58 -0800 Subject: Refactor `gfx` to surface `CommandBuffer` interface. (#1735) * Refactor `gfx` to surface `CommandBuffer` interface. * Fixes. * Fix code review issues, and make vulkan runnable on devices without VK_EXT_extended_dynamic_states. * Update solution files * Move out-of-date examples to examples/experimental Co-authored-by: Yong He --- tools/gfx/simple-render-pass-layout.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tools/gfx/simple-render-pass-layout.cpp (limited to 'tools/gfx/simple-render-pass-layout.cpp') 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(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 -- cgit v1.2.3