MCPcopy Create free account
hub / github.com/ZDoom/Raze / Lock

Method Lock

source/common/rendering/vulkan/system/vk_hwbuffer.cpp:207–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205}
206
207void *VkHardwareBuffer::Lock(unsigned int size)
208{
209 size = max(size, (unsigned int)16); // For supporting zero byte buffers
210
211 if (!mBuffer)
212 {
213 // The model mesh loaders lock multiple non-persistent buffers at the same time. This is not allowed in vulkan.
214 // VkDeviceMemory can only be mapped once and multiple non-persistent buffers may come from the same device memory object.
215 mStaticUpload.Resize(size);
216 map = mStaticUpload.Data();
217 }
218 else if (!mPersistent)
219 {
220 map = mBuffer->Map(0, size);
221 }
222 return map;
223}
224
225void VkHardwareBuffer::Unlock()
226{

Callers

nothing calls this directly

Calls 3

ResizeMethod · 0.45
DataMethod · 0.45
MapMethod · 0.45

Tested by

no test coverage detected