MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / MapBuffer

Method MapBuffer

deps/LLGL/sources/Renderer/Vulkan/VKRenderSystem.cpp:227–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void* VKRenderSystem::MapBuffer(Buffer& buffer, const CPUAccess access)
228{
229 auto& bufferVK = LLGL_CAST(VKBuffer&, buffer);
230
231 if (auto stagingBuffer = bufferVK.GetStagingVkBuffer())
232 {
233 /* Copy GPU local buffer into staging buffer for read accces */
234 if (access != CPUAccess::WriteOnly && access != CPUAccess::WriteDiscard)
235 device_.CopyBuffer(bufferVK.GetVkBuffer(), stagingBuffer, bufferVK.GetSize());
236
237 /* Map staging buffer */
238 return bufferVK.Map(device_, access);
239 }
240
241 return nullptr;
242}
243
244void VKRenderSystem::UnmapBuffer(Buffer& buffer)
245{

Callers 6

mainFunction · 0.45
mainFunction · 0.45
OnDrawFrameMethod · 0.45
ModifyTextureContentMethod · 0.45
CsRenderSystem.cppFile · 0.45

Calls 5

GetStagingVkBufferMethod · 0.80
CopyBufferMethod · 0.45
GetVkBufferMethod · 0.45
GetSizeMethod · 0.45
MapMethod · 0.45

Tested by 2

mainFunction · 0.36
mainFunction · 0.36