diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-04-13 08:38:52 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-04-13 16:51:51 +0300 |
commit | 9c09e5ba242fffc4906d86ce111def89e481c048 (patch) | |
tree | 2f2b9bbfd908a920097a2a48fd5d30a745e0a4a7 /source/blender/python/gpu | |
parent | e22fd7247adc4ce6de5eb7b4275b91116177109a (diff) |
Fix some usages of 'GPU_shader_get_uniform_block'
`GPU_shader_get_uniform_block` is marked as deprecated and the value
returned does not match what `GPU_uniformbuf_bind` expects.
Also, small typo fix in python error message.
Differential Revision: https://developer.blender.org/D14638
Diffstat (limited to 'source/blender/python/gpu')
-rw-r--r-- | source/blender/python/gpu/gpu_py_shader.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index cdcf22df7a1..9fe4bdcbaa0 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -537,16 +537,15 @@ static PyObject *pygpu_shader_uniform_block(BPyGPUShader *self, PyObject *args) return NULL; } - int slot = GPU_shader_get_uniform_block(self->shader, name); - if (slot == -1) { + int binding = GPU_shader_get_uniform_block_binding(self->shader, name); + if (binding == -1) { PyErr_SetString( PyExc_BufferError, - "GPUShader.uniform_buffer: uniform block not found, make sure the name is correct"); + "GPUShader.uniform_block: uniform block not found, make sure the name is correct"); return NULL; } - GPU_uniformbuf_bind(py_ubo->ubo, slot); - GPU_shader_uniform_1i(self->shader, name, slot); + GPU_uniformbuf_bind(py_ubo->ubo, binding); Py_RETURN_NONE; } |