MCPcopy Create free account
hub / github.com/defold/defold / SetDeviceBuffer

Function SetDeviceBuffer

engine/graphics/src/vulkan/graphics_vulkan.cpp:2232–2252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2230 }
2231
2232 static void SetDeviceBuffer(VulkanContext* context, DeviceBuffer* buffer, uint32_t size, uint32_t offset, const void* data)
2233 {
2234 if (size == 0)
2235 {
2236 return;
2237 }
2238
2239 if (offset == 0)
2240 {
2241 // Coherent memory writes does not seem to be properly synced on MoltenVK,
2242 // so for now we always mark the old buffer for destruction when updating the data.
2243 #ifndef __MACH__
2244 if (size != buffer->m_MemorySize)
2245 #endif
2246 {
2247 DestroyResourceDeferred(context, buffer);
2248 }
2249 }
2250
2251 DeviceBufferUploadHelper(context, data, size, offset, buffer);
2252 }
2253
2254 static HUniformBuffer VulkanNewUniformBuffer(HContext _context, const UniformBufferLayout& layout)
2255 {

Callers 2

VulkanSetIndexBufferDataFunction · 0.85

Calls 2

DestroyResourceDeferredFunction · 0.70
DeviceBufferUploadHelperFunction · 0.70

Tested by

no test coverage detected