diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-10-24 03:04:58 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-10-24 03:05:41 +0300 |
commit | f5456df095291c6cb2d0223a179746c8e514cd15 (patch) | |
tree | 76384b0c91806c95d55b007850ee225889a3250e /intern/cycles/render/shader.cpp | |
parent | 254daf8f8c276a4e5292e5a12fcfa88296131878 (diff) | |
parent | 070a668d04844610059aaedc80c49e9038fd1779 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'intern/cycles/render/shader.cpp')
-rw-r--r-- | intern/cycles/render/shader.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index 3992ada2e85..70f6d5bab47 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -416,14 +416,13 @@ void ShaderManager::device_update_common(Device *device, Scene *scene, Progress& /*progress*/) { - device->tex_free(dscene->shader_flag); - dscene->shader_flag.clear(); + dscene->shader_flag.free(); if(scene->shaders.size() == 0) return; uint shader_flag_size = scene->shaders.size()*SHADER_SIZE; - uint *shader_flag = dscene->shader_flag.resize(shader_flag_size); + uint *shader_flag = dscene->shader_flag.alloc(shader_flag_size); uint i = 0; bool has_volumes = false; bool has_transparent_shadow = false; @@ -479,7 +478,7 @@ void ShaderManager::device_update_common(Device *device, has_transparent_shadow |= (flag & SD_HAS_TRANSPARENT_SHADOW) != 0; } - device->tex_alloc("__shader_flag", dscene->shader_flag); + dscene->shader_flag.copy_to_device(); /* lookup tables */ KernelTables *ktables = &dscene->data.tables; @@ -504,12 +503,11 @@ void ShaderManager::device_update_common(Device *device, kintegrator->transparent_shadows = has_transparent_shadow; } -void ShaderManager::device_free_common(Device *device, DeviceScene *dscene, Scene *scene) +void ShaderManager::device_free_common(Device *, DeviceScene *dscene, Scene *scene) { scene->lookup_tables->remove_table(&beckmann_table_offset); - device->tex_free(dscene->shader_flag); - dscene->shader_flag.clear(); + dscene->shader_flag.free(); } void ShaderManager::add_default(Scene *scene) |