Cleanup: don't copy constant memory to GPU multiple times for displacement

This commit is contained in:
Brecht Van Lommel 2021-10-14 17:52:19 +02:00
parent eb71157e2a
commit 509b637d59
2 changed files with 3 additions and 3 deletions

View File

@ -1800,6 +1800,9 @@ void GeometryManager::device_update(Device *device,
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) {
if (scene->update_stats) {
scene->update_stats->geometry.times.add_entry({"device_update (displacement)", time});

View File

@ -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. */
ShaderEval shader_eval(device, progress);
if (!shader_eval.eval(SHADER_EVAL_DISPLACE,