Cleanup: GPU: Use references for some vertex buffer functions

Pull Request: https://projects.blender.org/blender/blender/pulls/122784
This commit is contained in:
Hans Goudey
2024-06-05 18:47:22 +02:00
committed by Hans Goudey
parent c1cf43e25e
commit 84c4ddbbb9
76 changed files with 682 additions and 687 deletions

View File

@@ -211,7 +211,7 @@ static int pygpu_vertbuf_fill(blender::gpu::VertBuf *buf,
return 0;
}
if (GPU_vertbuf_get_data(buf) == nullptr) {
if (GPU_vertbuf_get_data(*buf) == nullptr) {
PyErr_SetString(PyExc_ValueError, "Can't fill, static buffer already in use");
return 0;
}
@@ -251,10 +251,10 @@ static PyObject *pygpu_vertbuf__tp_new(PyTypeObject * /*type*/, PyObject *args,
return nullptr;
}
const GPUVertFormat *fmt = &((BPyGPUVertFormat *)params.py_fmt)->fmt;
const GPUVertFormat &fmt = ((BPyGPUVertFormat *)params.py_fmt)->fmt;
blender::gpu::VertBuf *vbo = GPU_vertbuf_create_with_format(fmt);
GPU_vertbuf_data_alloc(vbo, params.len);
GPU_vertbuf_data_alloc(*vbo, params.len);
return BPyGPUVertBuf_CreatePyObject(vbo);
}