Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dalai@blender.org>2020-12-17 19:39:49 +0300
committerDalai Felinto <dalai@blender.org>2020-12-17 19:39:49 +0300
commit42b0389a9b05e51e17ba79540e88cd446b52fae7 (patch)
treeee17716640f1b1133ae2ab4ca65cd92a63d09f15 /source/blender/python/gpu/gpu_py_vertex_buffer.c
parentc5a17d5ea1ff786cb91cbcf3f12cd02f730c4143 (diff)
parente7b698327cd91b371ff4fd43d1c117637224fded (diff)
Merge remote-tracking branch 'origin/master' into geometry-nodesgeometry-nodes
Diffstat (limited to 'source/blender/python/gpu/gpu_py_vertex_buffer.c')
-rw-r--r--source/blender/python/gpu/gpu_py_vertex_buffer.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/source/blender/python/gpu/gpu_py_vertex_buffer.c b/source/blender/python/gpu/gpu_py_vertex_buffer.c
index d8c6e67816a..8e19eac76d0 100644
--- a/source/blender/python/gpu/gpu_py_vertex_buffer.c
+++ b/source/blender/python/gpu/gpu_py_vertex_buffer.c
@@ -116,10 +116,10 @@ static void fill_format_sequence(void *data_dst_void,
#undef WARN_TYPE_LIMIT_PUSH
#undef WARN_TYPE_LIMIT_POP
-static bool bpygpu_vertbuf_fill_impl(GPUVertBuf *vbo,
- uint data_id,
- PyObject *seq,
- const char *error_prefix)
+static bool py_vertbuf_fill_impl(GPUVertBuf *vbo,
+ uint data_id,
+ PyObject *seq,
+ const char *error_prefix)
{
const char *exc_str_size_mismatch = "Expected a %s of size %d, got %u";
@@ -213,10 +213,7 @@ static bool bpygpu_vertbuf_fill_impl(GPUVertBuf *vbo,
return ok;
}
-static int bpygpu_attr_fill(GPUVertBuf *buf,
- int id,
- PyObject *py_seq_data,
- const char *error_prefix)
+static int py_attr_fill(GPUVertBuf *buf, int id, PyObject *py_seq_data, const char *error_prefix)
{
if (id < 0 || id >= GPU_vertbuf_get_format(buf)->attr_len) {
PyErr_Format(PyExc_ValueError, "Format id %d out of range", id);
@@ -228,7 +225,7 @@ static int bpygpu_attr_fill(GPUVertBuf *buf,
return 0;
}
- if (!bpygpu_vertbuf_fill_impl(buf, (uint)id, py_seq_data, error_prefix)) {
+ if (!py_vertbuf_fill_impl(buf, (uint)id, py_seq_data, error_prefix)) {
return 0;
}
@@ -241,7 +238,7 @@ static int bpygpu_attr_fill(GPUVertBuf *buf,
/** \name VertBuf Type
* \{ */
-static PyObject *bpygpu_VertBuf_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
+static PyObject *py_VertBuf_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
{
struct {
PyObject *py_fmt;
@@ -263,7 +260,7 @@ static PyObject *bpygpu_VertBuf_new(PyTypeObject *UNUSED(type), PyObject *args,
return BPyGPUVertBuf_CreatePyObject(vbo);
}
-PyDoc_STRVAR(bpygpu_VertBuf_attr_fill_doc,
+PyDoc_STRVAR(py_VertBuf_attr_fill_doc,
".. method:: attr_fill(id, data)\n"
"\n"
" Insert data into the buffer for a single attribute.\n"
@@ -272,7 +269,7 @@ PyDoc_STRVAR(bpygpu_VertBuf_attr_fill_doc,
" :type id: int or str\n"
" :param data: Sequence of data that should be stored in the buffer\n"
" :type data: sequence of values or tuples\n");
-static PyObject *bpygpu_VertBuf_attr_fill(BPyGPUVertBuf *self, PyObject *args, PyObject *kwds)
+static PyObject *py_VertBuf_attr_fill(BPyGPUVertBuf *self, PyObject *args, PyObject *kwds)
{
PyObject *data;
PyObject *identifier;
@@ -302,22 +299,22 @@ static PyObject *bpygpu_VertBuf_attr_fill(BPyGPUVertBuf *self, PyObject *args, P
return NULL;
}
- if (!bpygpu_attr_fill(self->buf, id, data, "GPUVertBuf.attr_fill")) {
+ if (!py_attr_fill(self->buf, id, data, "GPUVertBuf.attr_fill")) {
return NULL;
}
Py_RETURN_NONE;
}
-static struct PyMethodDef bpygpu_VertBuf_methods[] = {
+static struct PyMethodDef py_VertBuf_methods[] = {
{"attr_fill",
- (PyCFunction)bpygpu_VertBuf_attr_fill,
+ (PyCFunction)py_VertBuf_attr_fill,
METH_VARARGS | METH_KEYWORDS,
- bpygpu_VertBuf_attr_fill_doc},
+ py_VertBuf_attr_fill_doc},
{NULL, NULL, 0, NULL},
};
-static void bpygpu_VertBuf_dealloc(BPyGPUVertBuf *self)
+static void py_VertBuf_dealloc(BPyGPUVertBuf *self)
{
GPU_vertbuf_discard(self->buf);
Py_TYPE(self)->tp_free(self);
@@ -335,11 +332,11 @@ PyDoc_STRVAR(py_gpu_vertex_buffer_doc,
PyTypeObject BPyGPUVertBuf_Type = {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUVertBuf",
.tp_basicsize = sizeof(BPyGPUVertBuf),
- .tp_dealloc = (destructor)bpygpu_VertBuf_dealloc,
+ .tp_dealloc = (destructor)py_VertBuf_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_doc = py_gpu_vertex_buffer_doc,
- .tp_methods = bpygpu_VertBuf_methods,
- .tp_new = bpygpu_VertBuf_new,
+ .tp_methods = py_VertBuf_methods,
+ .tp_new = py_VertBuf_new,
};
/** \} */