Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_shader.cpp
| Show First 20 Lines • Show All 1,188 Lines • ▼ Show 20 Lines | if(shader_map.sync(&shader, *b_mat) || update_all) { | ||||
| shader->use_mis = get_boolean(cmat, "sample_as_light"); | shader->use_mis = get_boolean(cmat, "sample_as_light"); | ||||
| shader->use_transparent_shadow = get_boolean(cmat, "use_transparent_shadow"); | shader->use_transparent_shadow = get_boolean(cmat, "use_transparent_shadow"); | ||||
| shader->heterogeneous_volume = !get_boolean(cmat, "homogeneous_volume"); | shader->heterogeneous_volume = !get_boolean(cmat, "homogeneous_volume"); | ||||
| shader->volume_sampling_method = get_volume_sampling(cmat); | shader->volume_sampling_method = get_volume_sampling(cmat); | ||||
| shader->volume_interpolation_method = get_volume_interpolation(cmat); | shader->volume_interpolation_method = get_volume_interpolation(cmat); | ||||
| shader->displacement_method = (experimental) ? get_displacement_method(cmat) : DISPLACE_BUMP; | shader->displacement_method = (experimental) ? get_displacement_method(cmat) : DISPLACE_BUMP; | ||||
| shader->set_graph(graph); | shader->set_graph(graph); | ||||
| /* By simplifying the shader graph as soon as possible, some shader nodes might be | |||||
| * removed which can help to skip unneccessary attribures later. | |||||
| * | |||||
| * However, since graph simplification also accounts for e.g. mix weight, this would | |||||
| * cause frequent expensive resyncs in interactive sessions. */ | |||||
| if(!preview) { | |||||
| shader->graph->simplify(scene); | |||||
sergey: Please bother to do benchmarks on real scenes rather than just wacking threading code into… | |||||
Not Done Inline ActionsOk, re-read code more carefully. This is pushing the outer loop data. While in theory we can do the whole material sync from thread current code should be good enough already. sergey: Ok, re-read code more carefully. This is pushing the outer loop data. While in theory we can do… | |||||
| } | |||||
| shader->tag_update(scene); | shader->tag_update(scene); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Sync World */ | /* Sync World */ | ||||
Not Done Inline ActionsIMO safer to always for pool.wait_work(). If there is no work to be done it'll be almost NOOP. ut if we'll be using pool for something else than non-preview tasks it'll save us from possible issues related on missing wait_work. sergey: IMO safer to always for pool.wait_work(). If there is no work to be done it'll be almost NOOP. | |||||
| void BlenderSync::sync_world(bool update_all) | void BlenderSync::sync_world(bool update_all) | ||||
| { | { | ||||
| Background *background = scene->background; | Background *background = scene->background; | ||||
| Background prevbackground = *background; | Background prevbackground = *background; | ||||
| BL::World b_world = b_scene.world(); | BL::World b_world = b_scene.world(); | ||||
| ▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines | |||||
Please bother to do benchmarks on real scenes rather than just wacking threading code into somewhere inside of an inner loop.
Ideally threading should start as early as possible (in this case, export the whole material), otherwise synchronization overhead in the current task scheduler implementation might make things slower than they were before making things threaded.