diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-10-21 00:31:13 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-10-24 02:03:59 +0300 |
commit | 7ad9333fad25b9a7cabea0d659eaf724f89912c8 (patch) | |
tree | 4fa0d78c9659dd842852420bd1d8b8f8925a0c2f /intern/cycles/render/light.cpp | |
parent | ae41f38f78f8c54f92cf34dd88e35948e19aed55 (diff) |
Code refactor: store device/interp/extension/type in each device_memory.
Diffstat (limited to 'intern/cycles/render/light.cpp')
-rw-r--r-- | intern/cycles/render/light.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index bb73ebd7e41..9664e1310d5 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -36,8 +36,8 @@ static void shade_background_pixels(Device *device, DeviceScene *dscene, int res int width = res; int height = res; - device_vector<uint4> d_input; - device_vector<float4> d_output; + device_vector<uint4> d_input(device, "background_input", MEM_READ_ONLY); + device_vector<float4> d_output(device, "background_output", MEM_WRITE_ONLY); uint4 *d_input_data = d_input.resize(width*height); @@ -57,9 +57,9 @@ static void shade_background_pixels(Device *device, DeviceScene *dscene, int res device->const_copy_to("__data", &dscene->data, sizeof(dscene->data)); - device->mem_alloc("shade_background_pixels_input", d_input, MEM_READ_ONLY); + device->mem_alloc(d_input); device->mem_copy_to(d_input); - device->mem_alloc("shade_background_pixels_output", d_output, MEM_WRITE_ONLY); + device->mem_alloc(d_output); device->mem_zero(d_output); DeviceTask main_task(DeviceTask::SHADER); @@ -451,7 +451,7 @@ void LightManager::device_update_distribution(Device *device, DeviceScene *dscen kfilm->pass_shadow_scale *= (float)(num_lights - num_background_lights)/(float)num_lights; /* CDF */ - device->tex_alloc("__light_distribution", dscene->light_distribution); + device->tex_alloc(dscene->light_distribution); /* Portals */ if(num_portals > 0) { @@ -611,8 +611,8 @@ void LightManager::device_update_background(Device *device, VLOG(2) << "Background MIS build time " << time_dt() - time_start << "\n"; /* update device */ - device->tex_alloc("__light_background_marginal_cdf", dscene->light_background_marginal_cdf); - device->tex_alloc("__light_background_conditional_cdf", dscene->light_background_conditional_cdf); + device->tex_alloc(dscene->light_background_marginal_cdf); + device->tex_alloc(dscene->light_background_conditional_cdf); } void LightManager::device_update_points(Device *device, @@ -813,7 +813,7 @@ void LightManager::device_update_points(Device *device, VLOG(1) << "Number of lights without contribution: " << num_scene_lights - light_index; - device->tex_alloc("__light_data", dscene->light_data); + device->tex_alloc(dscene->light_data); } void LightManager::device_update(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) |