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/scene.cpp | |
parent | 254daf8f8c276a4e5292e5a12fcfa88296131878 (diff) | |
parent | 070a668d04844610059aaedc80c49e9038fd1779 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'intern/cycles/render/scene.cpp')
-rw-r--r-- | intern/cycles/render/scene.cpp | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/intern/cycles/render/scene.cpp b/intern/cycles/render/scene.cpp index cf89385a33d..260a325206c 100644 --- a/intern/cycles/render/scene.cpp +++ b/intern/cycles/render/scene.cpp @@ -40,10 +40,48 @@ CCL_NAMESPACE_BEGIN -Scene::Scene(const SceneParams& params_, const DeviceInfo& device_info_) -: params(params_) +DeviceScene::DeviceScene(Device *device) +: bvh_nodes(device, "__bvh_nodes", MEM_TEXTURE), + bvh_leaf_nodes(device, "__bvh_leaf_nodes", MEM_TEXTURE), + object_node(device, "__object_node", MEM_TEXTURE), + prim_tri_index(device, "__prim_tri_index", MEM_TEXTURE), + prim_tri_verts(device, "__prim_tri_verts", MEM_TEXTURE), + prim_type(device, "__prim_type", MEM_TEXTURE), + prim_visibility(device, "__prim_visibility", MEM_TEXTURE), + prim_index(device, "__prim_index", MEM_TEXTURE), + prim_object(device, "__prim_object", MEM_TEXTURE), + prim_time(device, "__prim_time", MEM_TEXTURE), + tri_shader(device, "__tri_shader", MEM_TEXTURE), + tri_vnormal(device, "__tri_vnormal", MEM_TEXTURE), + tri_vindex(device, "__tri_vindex", MEM_TEXTURE), + tri_patch(device, "__tri_patch", MEM_TEXTURE), + tri_patch_uv(device, "__tri_patch_uv", MEM_TEXTURE), + curves(device, "__curves", MEM_TEXTURE), + curve_keys(device, "__curve_keys", MEM_TEXTURE), + patches(device, "__patches", MEM_TEXTURE), + objects(device, "__objects", MEM_TEXTURE), + objects_vector(device, "__objects_vector", MEM_TEXTURE), + attributes_map(device, "__attributes_map", MEM_TEXTURE), + attributes_float(device, "__attributes_float", MEM_TEXTURE), + attributes_float3(device, "__attributes_float3", MEM_TEXTURE), + attributes_uchar4(device, "__attributes_uchar4", MEM_TEXTURE), + light_distribution(device, "__light_distribution", MEM_TEXTURE), + light_data(device, "__light_data", MEM_TEXTURE), + light_background_marginal_cdf(device, "__light_background_marginal_cdf", MEM_TEXTURE), + light_background_conditional_cdf(device, "__light_background_conditional_cdf", MEM_TEXTURE), + particles(device, "__particles", MEM_TEXTURE), + svm_nodes(device, "__svm_nodes", MEM_TEXTURE), + shader_flag(device, "__shader_flag", MEM_TEXTURE), + object_flag(device, "__object_flag", MEM_TEXTURE), + lookup_table(device, "__lookup_table", MEM_TEXTURE), + sobol_directions(device, "__sobol_directions", MEM_TEXTURE) +{ + memset(&data, 0, sizeof(data)); +} + +Scene::Scene(const SceneParams& params_, Device *device) +: device(device), dscene(device), params(params_) { - device = NULL; memset(&dscene.data, 0, sizeof(dscene.data)); camera = new Camera(); @@ -54,13 +92,13 @@ Scene::Scene(const SceneParams& params_, const DeviceInfo& device_info_) mesh_manager = new MeshManager(); object_manager = new ObjectManager(); integrator = new Integrator(); - image_manager = new ImageManager(device_info_); + image_manager = new ImageManager(device->info); particle_system_manager = new ParticleSystemManager(); curve_system_manager = new CurveSystemManager(); bake_manager = new BakeManager(); /* OSL only works on the CPU */ - if(device_info_.type == DEVICE_CPU) + if(device->info.has_osl) shader_manager = ShaderManager::create(this, params.shadingsystem); else shader_manager = ShaderManager::create(this, SHADINGSYSTEM_SVM); |