Initialize buffer data properly;

This commit is contained in:
bjorn 2022-05-24 22:30:59 -07:00
parent 99ecd04e27
commit 73f13ef3c7
1 changed files with 2 additions and 1 deletions

View File

@ -445,9 +445,10 @@ Buffer* lovrBufferCreate(BufferInfo* info, void** data) {
});
if (data && *data == NULL) {
gpu_stream* transfers = getTransfers();
gpu_buffer* scratchpad = tempAlloc(gpu_sizeof_buffer());
*data = gpu_map(scratchpad, size, 4, GPU_MAP_WRITE);
// TODO copy scratchpad to buffer
gpu_copy_buffers(transfers, scratchpad, buffer->gpu, 0, 0, size);
}
return buffer;