Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2013-03-23 07:11:48 +0400
committerMitchell Stokes <mogurijin@gmail.com>2013-03-23 07:11:48 +0400
commit2006103a520bbc4fe48169e1125d93b6c052a362 (patch)
treeaa32978f7d6664c12dd6e049e07e1ebb20c58fc9 /source/blender/gpu/intern/gpu_material.c
parent1356e3b490ec0d78084ae12296c2b30afff5f6cf (diff)
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.
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r--source/blender/gpu/intern/gpu_material.c3
1 files changed, 1 insertions, 2 deletions
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);
}
}