| 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 | { |
no test coverage detected