[Bf-blender-cvs] [a7750f95b9f] master: GPU Python: Rename 'uniform_buffer' to 'uniform_block'

Germano Cavalcante noreply at git.blender.org
Wed Feb 17 17:23:41 CET 2021


Commit: a7750f95b9f1073d35664c95fda031d0be679bdc
Author: Germano Cavalcante
Date:   Wed Feb 17 13:22:54 2021 -0300
Branches: master
https://developer.blender.org/rBa7750f95b9f1073d35664c95fda031d0be679bdc

GPU Python: Rename 'uniform_buffer' to 'uniform_block'

>From the the opengl wiki:
> Buffer objects are associated with a program's uniform block similarly to the way that texture objects are associated with sampler uniforms.

===================================================================

M	source/blender/python/gpu/gpu_py_shader.c

===================================================================

diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c
index 538bed7df6d..2f9b67bdb6a 100644
--- a/source/blender/python/gpu/gpu_py_shader.c
+++ b/source/blender/python/gpu/gpu_py_shader.c
@@ -494,8 +494,8 @@ static PyObject *pygpu_shader_uniform_sampler(BPyGPUShader *self, PyObject *args
 }
 
 PyDoc_STRVAR(
-    pygpu_shader_uniform_buffer_doc,
-    ".. method:: uniform_buffer(name, ubo)\n"
+    pygpu_shader_uniform_block_doc,
+    ".. method:: uniform_block(name, ubo)\n"
     "\n"
     "   Specify the value of an uniform buffer object variable for the current GPUShader.\n"
     "\n"
@@ -503,12 +503,12 @@ PyDoc_STRVAR(
     "   :type name: str\n"
     "   :param ubo: Uniform Buffer to attach.\n"
     "   :type texture: :class:`gpu.types.GPUUniformBuf`\n");
-static PyObject *pygpu_shader_uniform_buffer(BPyGPUShader *self, PyObject *args)
+static PyObject *pygpu_shader_uniform_block(BPyGPUShader *self, PyObject *args)
 {
   const char *name;
   BPyGPUUniformBuf *py_ubo;
   if (!PyArg_ParseTuple(
-          args, "sO!:GPUShader.uniform_buffer", &name, &BPyGPUUniformBuf_Type, &py_ubo)) {
+          args, "sO!:GPUShader.uniform_block", &name, &BPyGPUUniformBuf_Type, &py_ubo)) {
     return NULL;
   }
 
@@ -601,10 +601,10 @@ static struct PyMethodDef pygpu_shader__tp_methods[] = {
      (PyCFunction)pygpu_shader_uniform_sampler,
      METH_VARARGS,
      pygpu_shader_uniform_sampler_doc},
-    {"uniform_buffer",
-     (PyCFunction)pygpu_shader_uniform_buffer,
+    {"uniform_block",
+     (PyCFunction)pygpu_shader_uniform_block,
      METH_VARARGS,
-     pygpu_shader_uniform_buffer_doc},
+     pygpu_shader_uniform_block_doc},
     {"attr_from_name",
      (PyCFunction)pygpu_shader_attr_from_name,
      METH_O,



More information about the Bf-blender-cvs mailing list