forked from bartvdbraak/blender
Cleanup: don't copy constant memory to GPU multiple times for displacement
This commit is contained in:
parent
eb71157e2a
commit
509b637d59
@ -1800,6 +1800,9 @@ void GeometryManager::device_update(Device *device,
|
|||||||
size_t num_bvh = 0;
|
size_t num_bvh = 0;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
/* Copy constant data needed by shader evaluation. */
|
||||||
|
device->const_copy_to("__data", &dscene->data, sizeof(dscene->data));
|
||||||
|
|
||||||
scoped_callback_timer timer([scene](double time) {
|
scoped_callback_timer timer([scene](double time) {
|
||||||
if (scene->update_stats) {
|
if (scene->update_stats) {
|
||||||
scene->update_stats->geometry.times.add_entry({"device_update (displacement)", time});
|
scene->update_stats->geometry.times.add_entry({"device_update (displacement)", time});
|
||||||
|
@ -191,9 +191,6 @@ bool GeometryManager::displace(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Needs to be up to data for attribute access. */
|
|
||||||
device->const_copy_to("__data", &dscene->data, sizeof(dscene->data));
|
|
||||||
|
|
||||||
/* Evaluate shader on device. */
|
/* Evaluate shader on device. */
|
||||||
ShaderEval shader_eval(device, progress);
|
ShaderEval shader_eval(device, progress);
|
||||||
if (!shader_eval.eval(SHADER_EVAL_DISPLACE,
|
if (!shader_eval.eval(SHADER_EVAL_DISPLACE,
|
||||||
|
Loading…
Reference in New Issue
Block a user