diff options
| author | Yong He <yonghe@outlook.com> | 2021-03-04 16:25:58 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-04 16:25:58 -0800 |
| commit | a5ac4999b4dea546a7ef824669ab1809224b6448 (patch) | |
| tree | 15bb22eb98a94f7f81489deef55396461501d3dc /tools/gfx/simple-render-pass-layout.cpp | |
| parent | 13ff0bd345990c0fdfb7b52ebd5339cddb04889e (diff) | |
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 <yhe@nvidia.com>
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 |
