Gpu cleanup
This commit is contained in:
@@ -999,14 +999,14 @@ void gpu_vertex_buffer_init(gpu_buffer_t *buffer, int count, gpu_vertex_structur
|
||||
buffer->impl.vertex_buffer_view.StrideInBytes = buffer->stride;
|
||||
}
|
||||
|
||||
float *gpu_vertex_buffer_lock(gpu_buffer_t *buffer) {
|
||||
void *gpu_vertex_buffer_lock(gpu_buffer_t *buffer) {
|
||||
D3D12_RANGE range = {
|
||||
.Begin = 0,
|
||||
.End = buffer->count * buffer->stride,
|
||||
};
|
||||
void *p;
|
||||
buffer->impl.buffer->lpVtbl->Map(buffer->impl.buffer, 0, &range, &p);
|
||||
return (float *)p;
|
||||
return p;
|
||||
}
|
||||
|
||||
void gpu_vertex_buffer_unlock(gpu_buffer_t *buffer) {
|
||||
|
||||
@@ -587,10 +587,9 @@ void gpu_vertex_buffer_init(gpu_buffer_t *buffer, int count, gpu_vertex_structur
|
||||
buffer->impl.metal_buffer = (__bridge_retained void *)buf;
|
||||
}
|
||||
|
||||
float *gpu_vertex_buffer_lock(gpu_buffer_t *buf) {
|
||||
void *gpu_vertex_buffer_lock(gpu_buffer_t *buf) {
|
||||
id<MTLBuffer> buffer = (__bridge id<MTLBuffer>)buf->impl.metal_buffer;
|
||||
float *floats = (float *)[buffer contents];
|
||||
return floats;
|
||||
return [buffer contents];
|
||||
}
|
||||
|
||||
void gpu_vertex_buffer_unlock(gpu_buffer_t *buf) {
|
||||
|
||||
@@ -1818,9 +1818,10 @@ void gpu_vertex_buffer_init(gpu_buffer_t *buffer, int count, gpu_vertex_structur
|
||||
vkBindBufferMemory(device, buffer->impl.buf, buffer->impl.mem, 0);
|
||||
}
|
||||
|
||||
float *gpu_vertex_buffer_lock(gpu_buffer_t *buffer) {
|
||||
vkMapMemory(device, buffer->impl.mem, 0, buffer->count * buffer->stride, 0, (void **)&buffer->impl.data);
|
||||
return buffer->impl.data;
|
||||
void *gpu_vertex_buffer_lock(gpu_buffer_t *buffer) {
|
||||
void *p;
|
||||
vkMapMemory(device, buffer->impl.mem, 0, buffer->count * buffer->stride, 0, (void **)&p);
|
||||
return p;
|
||||
}
|
||||
|
||||
void gpu_vertex_buffer_unlock(gpu_buffer_t *buffer) {
|
||||
|
||||
@@ -30,7 +30,6 @@ typedef struct {
|
||||
VkBuffer buf;
|
||||
VkDeviceMemory mem;
|
||||
VkMemoryAllocateInfo mem_alloc;
|
||||
float *data;
|
||||
} gpu_buffer_impl_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user