From 9c09e5ba242fffc4906d86ce111def89e481c048 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Wed, 13 Apr 2022 02:38:52 -0300 Subject: 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 --- source/blender/python/gpu/gpu_py_shader.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/python') 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; } -- cgit v1.2.3