yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

lucy96chenGFX renaming work part 2: slang-gfx.h renames (#2194)f493d24c7

master
757 B25 linesraw
1#include "simple-render-pass-layout.h"
2
3#include "renderer-shared.h"
4
5namespace gfx
6{
7
8IRenderPassLayout* SimpleRenderPassLayout::getInterface(const Slang::Guid& guid)
9{
10    if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IRenderPassLayout)
11        return static_cast<IRenderPassLayout*>(this);
12    return nullptr;
13}
14
15void SimpleRenderPassLayout::init(const IRenderPassLayout::Desc& desc)
16{
17    m_renderTargetAccesses.setCount(desc.renderTargetCount);
18    for (GfxIndex i = 0; i < desc.renderTargetCount; i++)
19        m_renderTargetAccesses[i] = desc.renderTargetAccess[i];
20    m_hasDepthStencil = (desc.depthStencilAccess != nullptr);
21    if (m_hasDepthStencil)
22        m_depthStencilAccess = *desc.depthStencilAccess;
23}
24
25} // namespace gfx