summaryrefslogtreecommitdiffstats
path: root/tools/gfx/simple-render-pass-layout.cpp
blob: 1c937e708d2512346d6b0ed3f4f0f1e90a85914a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 (GfxIndex 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