Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2022-03-02 18:03:01 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2022-03-02 18:03:01 +0300
commita41c2a513761e8884e92526b069ff6eed8168676 (patch)
treee624093127815a09d2807dccddaabea35510e154 /intern/cycles/blender
parenta23b4429915ca8597510b57353c4df331487c620 (diff)
parentc23ec04b4e30f300a670f1cb1dc882e0608d09ad (diff)
Merge branch 'master' into temp-image-buffer-rasterizertemp-image-buffer-rasterizer
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r--intern/cycles/blender/addon/properties.py9
-rw-r--r--intern/cycles/blender/session.cpp9
-rw-r--r--intern/cycles/blender/shader.cpp16
-rw-r--r--intern/cycles/blender/sync.cpp9
-rw-r--r--intern/cycles/blender/sync.h2
5 files changed, 27 insertions, 18 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/session.cpp b/intern/cycles/blender/session.cpp
index 8917c703700..5e9066da5de 100644
--- a/intern/cycles/blender/session.cpp
+++ b/intern/cycles/blender/session.cpp
@@ -493,8 +493,13 @@ void BlenderSession::render_frame_finish()
session->set_output_driver(nullptr);
session->full_buffer_written_cb = function_null;
- /* The display driver holds OpenGL resources which belong to an OpenGL context held by the render
- * engine on Blender side. Force destruction of those resources. */
+ /* The display driver is the source of drawing context for both drawing and possible graphics
+ * interop objects in the path trace. Once the frame is finished the OpenGL context might be
+ * freed form Blender side. Need to ensure that all GPU resources are freed prior to that
+ * point.
+ * Ideally would only do this when OpenGL context is actually destroyed, but there is no way to
+ * know when this happens (at least in the code at the time when this comment was written).
+ * The penalty of re-creating resources on every frame is unlikely to be noticed. */
display_driver_ = nullptr;
session->set_display_driver(nullptr);
diff --git a/intern/cycles/blender/shader.cpp b/intern/cycles/blender/shader.cpp
index 9de507966d8..ec50ad9db9a 100644
--- a/intern/cycles/blender/shader.cpp
+++ b/intern/cycles/blender/shader.cpp
@@ -32,7 +32,8 @@ typedef map<string, ConvertNode *> ProxyMap;
void BlenderSync::find_shader(BL::ID &id, array<Node *> &used_shaders, Shader *default_shader)
{
- Shader *shader = (id) ? shader_map.find(id) : default_shader;
+ Shader *synced_shader = (id) ? shader_map.find(id) : nullptr;
+ Shader *shader = (synced_shader) ? synced_shader : default_shader;
used_shaders.push_back_slow(shader);
shader->tag_used(scene);
@@ -1573,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 */