Function createFromApiHandle

Synopsis

#include <Source/Falcor/Core/API/Buffer.h>

static SharedPtr createFromApiHandle(ApiHandle handle, size_t size, Resource::BindFlags bindFlags, CpuAccess cpuAccess)

Description

Create a new buffer from an existing API handle.

Parameters:

[ in ] handle - Handle of already allocated resource.

[ in ] size - The size of the buffer in bytes.

[ in ] bindFlags - Buffer bind flags. Flags must match the bind flags of the original resource.

[ in ] cpuAccess - Flags indicating how the buffer can be updated. Flags must match those of the heap the original resource is allocated on.

Return
A pointer to a new buffer object, or throws an exception if creation failed.

Source

Lines 165-171 in Source/Falcor/Core/API/Buffer.cpp. Line 173 in Source/Falcor/Core/API/Buffer.h.

Buffer::SharedPtr Buffer::createFromApiHandle(ApiHandle handle, size_t size, Resource::BindFlags bindFlags, CpuAccess cpuAccess)
{
    assert(handle);
    Buffer::SharedPtr pBuffer = SharedPtr(new Buffer(size, bindFlags, cpuAccess));
    pBuffer->mApiHandle = handle;
    return pBuffer;
}





Add Discussion as Guest

Log in to DocsForge