summaryrefslogtreecommitdiffstats
path: root/tools/gfx/metal/metal-transient-heap.cpp
blob: 16c883f677af186488bfb1c4db9cc450783c3ece (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// metal-transient-heap.cpp
#include "metal-transient-heap.h"

#include "metal-device.h"
#include "metal-util.h"

namespace gfx
{

using namespace Slang;

namespace metal
{

Result TransientResourceHeapImpl::init(const ITransientResourceHeap::Desc& desc, DeviceImpl* device)
{
    Super::init(
        desc,
        256, // TODO
        device);

    return SLANG_OK;
}

TransientResourceHeapImpl::~TransientResourceHeapImpl() {}

Result TransientResourceHeapImpl::createCommandBuffer(ICommandBuffer** outCmdBuffer)
{
    RefPtr<CommandBufferImpl> commandBuffer = new CommandBufferImpl();
    SLANG_RETURN_ON_FAIL(commandBuffer->init(m_device, this));
    returnComPtr(outCmdBuffer, commandBuffer);
    return SLANG_OK;
}

Result TransientResourceHeapImpl::synchronizeAndReset()
{
    Super::reset();
    return SLANG_OK;
}

} // namespace metal
} // namespace gfx