diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2022-03-01 22:31:18 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-03-01 22:31:18 +0300 |
commit | e1ec2d025142a35ce5a5302da0b9a71a279c61f2 (patch) | |
tree | 965ee6a0c38fc2352bb61401648ba95f0640b0f8 /intern/cycles | |
parent | 6498688e274836a66d9075edfe79fd3572334427 (diff) | |
parent | 8e88af99348590e9879dcbfe97bbbc180fc5ec67 (diff) |
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 9 | ||||
-rw-r--r-- | intern/cycles/blender/shader.cpp | 13 | ||||
-rw-r--r-- | intern/cycles/blender/sync.cpp | 9 | ||||
-rw-r--r-- | intern/cycles/blender/sync.h | 2 | ||||
-rw-r--r-- | intern/cycles/device/metal/device_impl.mm | 2 |
5 files changed, 19 insertions, 16 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 4e62bae6fe3..e3e5734c6b6 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -1514,9 +1514,12 @@ class CyclesPreferences(bpy.types.AddonPreferences): row.prop(self, "peer_memory") if compute_device_type == 'METAL': - row = layout.row() - row.use_property_split = True - row.prop(self, "use_metalrt") + import platform + # MetalRT only works on Apple Silicon at present, pending argument encoding fixes on AMD + if platform.machine() == 'arm64': + row = layout.row() + row.use_property_split = True + row.prop(self, "use_metalrt") def draw(self, context): diff --git a/intern/cycles/blender/shader.cpp b/intern/cycles/blender/shader.cpp index 9d696aaeeb2..ec50ad9db9a 100644 --- a/intern/cycles/blender/shader.cpp +++ b/intern/cycles/blender/shader.cpp @@ -1574,18 +1574,13 @@ void BlenderSync::sync_lights(BL::Depsgraph &b_depsgraph, bool update_all) } } -void BlenderSync::sync_shaders(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d) +void BlenderSync::sync_shaders(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d, bool update_all) { - /* for auto refresh images */ - ImageManager *image_manager = scene->image_manager; - const int frame = b_scene.frame_current(); - const bool auto_refresh_update = image_manager->set_animation_frame_update(frame); - shader_map.pre_sync(); - sync_world(b_depsgraph, b_v3d, auto_refresh_update); - sync_lights(b_depsgraph, auto_refresh_update); - sync_materials(b_depsgraph, auto_refresh_update); + sync_world(b_depsgraph, b_v3d, update_all); + sync_lights(b_depsgraph, update_all); + sync_materials(b_depsgraph, update_all); } CCL_NAMESPACE_END diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp index 0b11af2dbf9..d4949a5ff30 100644 --- a/intern/cycles/blender/sync.cpp +++ b/intern/cycles/blender/sync.cpp @@ -246,7 +246,12 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render, int height, void **python_thread_state) { - if (!has_updates_) { + /* For auto refresh images. */ + ImageManager *image_manager = scene->image_manager; + const int frame = b_scene.frame_current(); + const bool auto_refresh_update = image_manager->set_animation_frame_update(frame); + + if (!has_updates_ && !auto_refresh_update) { return; } @@ -261,7 +266,7 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render, sync_view_layer(b_view_layer); sync_integrator(b_view_layer, background); sync_film(b_view_layer, b_v3d); - sync_shaders(b_depsgraph, b_v3d); + sync_shaders(b_depsgraph, b_v3d, auto_refresh_update); sync_images(); geometry_synced.clear(); /* use for objects and motion sync */ diff --git a/intern/cycles/blender/sync.h b/intern/cycles/blender/sync.h index d92efb80a5d..5cc18452ac1 100644 --- a/intern/cycles/blender/sync.h +++ b/intern/cycles/blender/sync.h @@ -114,7 +114,7 @@ class BlenderSync { /* Shader */ array<Node *> find_used_shaders(BL::Object &b_ob); void sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d, bool update_all); - void sync_shaders(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d); + void sync_shaders(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d, bool update_all); void sync_nodes(Shader *shader, BL::ShaderNodeTree &b_ntree); /* Object */ diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index 593c9c3cf06..c01f51fb506 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -77,11 +77,11 @@ MetalDevice::MetalDevice(const DeviceInfo &info, Stats &stats, Profiler &profile } case METAL_GPU_APPLE: { max_threads_per_threadgroup = 512; + use_metalrt = info.use_metalrt; break; } } - use_metalrt = info.use_metalrt; if (auto metalrt = getenv("CYCLES_METALRT")) { use_metalrt = (atoi(metalrt) != 0); } |