| 49 | void getGFXResourceState(ResourceBindFlags flags, gfx::ResourceState& defaultState, gfx::ResourceStateSet& allowedStates); |
| 50 | |
| 51 | static void prepareGFXBufferDesc( |
| 52 | gfx::IBufferResource::Desc& bufDesc, |
| 53 | size_t size, |
| 54 | size_t elementSize, |
| 55 | ResourceFormat format, |
| 56 | ResourceBindFlags bindFlags, |
| 57 | MemoryType memoryType |
| 58 | ) |
| 59 | { |
| 60 | bufDesc.sizeInBytes = size; |
| 61 | bufDesc.elementSize = elementSize; |
| 62 | bufDesc.format = getGFXFormat(format); |
| 63 | switch (memoryType) |
| 64 | { |
| 65 | case MemoryType::DeviceLocal: |
| 66 | bufDesc.memoryType = gfx::MemoryType::DeviceLocal; |
| 67 | break; |
| 68 | case MemoryType::ReadBack: |
| 69 | bufDesc.memoryType = gfx::MemoryType::ReadBack; |
| 70 | break; |
| 71 | case MemoryType::Upload: |
| 72 | bufDesc.memoryType = gfx::MemoryType::Upload; |
| 73 | break; |
| 74 | default: |
| 75 | FALCOR_UNREACHABLE(); |
| 76 | break; |
| 77 | } |
| 78 | getGFXResourceState(bindFlags, bufDesc.defaultState, bufDesc.allowedStates); |
| 79 | bufDesc.isShared = is_set(bindFlags, ResourceBindFlags::Shared); |
| 80 | } |
| 81 | |
| 82 | // TODO: This is also used in GpuMemoryHeap |
| 83 | Slang::ComPtr<gfx::IBufferResource> createBufferResource( |
no test coverage detected