mirror of https://github.com/bjornbytes/lovr.git
Initialize buffer data properly;
This commit is contained in:
parent
99ecd04e27
commit
73f13ef3c7
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue