PyGPU: call 'GPU_shader_bind' in 'GPUShader.uniform_' methods

This simplifies python code.

When we call a method like shader.uniform_float("color", (1,1,1,1)),
we expect the shader's uniform to be updated regardless of whether the
shader is bound or not.

And `batch.draw()` already calls `GPU_shader_bind` inside.

Differential Revision: https://developer.blender.org/D15929
This commit is contained in:
2022-09-19 09:39:48 -03:00
parent 2fffd7d7a8
commit 2ce8b01c59
11 changed files with 7 additions and 10 deletions

View File

@@ -22,7 +22,6 @@ batch = batch_for_shader(shader, 'LINES', {"pos": coords}, indices=indices)
def draw():
shader.bind()
shader.uniform_float("color", (1, 0, 0, 1))
batch.draw(shader)