MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / prepareGFXBufferDesc

Function prepareGFXBufferDesc

Source/Falcor/Core/API/Buffer.cpp:51–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49void getGFXResourceState(ResourceBindFlags flags, gfx::ResourceState& defaultState, gfx::ResourceStateSet& allowedStates);
50
51static 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
83Slang::ComPtr<gfx::IBufferResource> createBufferResource(

Callers 2

createBufferResourceFunction · 0.85

Calls 2

getGFXFormatFunction · 0.85
getGFXResourceStateFunction · 0.85

Tested by

no test coverage detected