forked from bartvdbraak/blender
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.
This commit is contained in:
parent
1356e3b490
commit
2006103a52
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user