TODO: This is also used in GpuMemoryHeap
| 81 | |
| 82 | // TODO: This is also used in GpuMemoryHeap |
| 83 | Slang::ComPtr<gfx::IBufferResource> createBufferResource( |
| 84 | ref<Device> pDevice, |
| 85 | Buffer::State initState, |
| 86 | size_t size, |
| 87 | size_t elementSize, |
| 88 | ResourceFormat format, |
| 89 | ResourceBindFlags bindFlags, |
| 90 | MemoryType memoryType |
| 91 | ) |
| 92 | { |
| 93 | FALCOR_ASSERT(pDevice); |
| 94 | |
| 95 | // Create the buffer |
| 96 | gfx::IBufferResource::Desc bufDesc = {}; |
| 97 | prepareGFXBufferDesc(bufDesc, size, elementSize, format, bindFlags, memoryType); |
| 98 | |
| 99 | Slang::ComPtr<gfx::IBufferResource> pApiHandle; |
| 100 | FALCOR_GFX_CALL(pDevice->getGfxDevice()->createBufferResource(bufDesc, nullptr, pApiHandle.writeRef())); |
| 101 | FALCOR_ASSERT(pApiHandle); |
| 102 | |
| 103 | return pApiHandle; |
| 104 | } |
| 105 | |
| 106 | Buffer::Buffer( |
| 107 | ref<Device> pDevice, |
no test coverage detected