From 2006103a520bbc4fe48169e1125d93b6c052a362 Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Sat, 23 Mar 2013 03:11:48 +0000 Subject: OpenGL: Moving the GPU_pass_update_uniforms() call from GPU_material_bind_uniforms() to GPU_material_bind(). This way, material specific uniforms don't need to be resent when sending object specific uniforms. This saves uniform update calls in the BGE where one material is bound and multiple objects can be drawn. This doesn't offer much in the way of performance, but it cleans up our OpenGL usage a bit. One test scene went from 8k OpenGL calls to 4k with just this one change. --- source/blender/gpu/intern/gpu_material.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 636c44d3e80..999e3b5c20e 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -278,6 +278,7 @@ void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double tim } GPU_pass_bind(material->pass, time, mipmap); + GPU_pass_update_uniforms(material->pass); material->bound = 1; } } @@ -338,8 +339,6 @@ void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[4][4], float mult_m4_m4m4(lamp->dynpersmat, lamp->persmat, viewinv); } } - - GPU_pass_update_uniforms(material->pass); } } -- cgit v1.2.3