Commit: 405a5d3bd7ada5dd5af605b59ba07c7144f144a2
Author: Clément Foucault
Date: Thu Sep 10 15:53:48 2020 +0200
Branches: master
https://developer.blender.org/rB405a5d3bd7ada5dd5af605b59ba07c7144f144a2
GPUBatch: Do not unbind shader after drawing.
This allows subsequent redraw to work just like before.
However a better safeguard system against setting the uniforms in the
wrong shader would be nice to have.
===================================================================
M source/blender/gpu/intern/gpu_batch.cc
===================================================================
diff --git a/source/blender/gpu/intern/gpu_batch.cc
b/source/blender/gpu/intern/gpu_batch.cc
index de079a89de7..1f873570f4a 100644
--- a/source/blender/gpu/intern/gpu_batch.cc
+++ b/source/blender/gpu/intern/gpu_batch.cc
@@ -235,14 +235,12 @@ void GPU_batch_draw(GPUBatch *batch)
{
GPU_shader_bind(batch->shader);
GPU_batch_draw_advanced(batch, 0, 0, 0, 0);
- GPU_shader_unbind();
}
void GPU_batch_draw_range(GPUBatch *batch, int v_first, int v_count)
{
GPU_shader_bind(batch->shader);
GPU_batch_draw_advanced(batch, v_first, v_count, 0, 0);
- GPU_shader_unbind();
}
/* Draw multiple instance of a batch without having any instance attributes. */
@@ -252,7 +250,6 @@ void GPU_batch_draw_instanced(GPUBatch *batch, int i_count)
GPU_shader_bind(batch->shader);
GPU_batch_draw_advanced(batch, 0, 0, 0, i_count);
- GPU_shader_unbind();
}
void GPU_batch_draw_advanced(
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs