Merge branch 'blender-v5.0-release'
This commit is contained in:
@@ -1624,9 +1624,8 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
||||
)
|
||||
|
||||
use_hiprt: BoolProperty(
|
||||
name="HIP RT (Unstable)",
|
||||
description="HIP RT enables AMD hardware ray tracing on RDNA2 and above. This currently has known stability "
|
||||
"issues, that are expected to be solved before the next release.",
|
||||
name="HIP RT",
|
||||
description="HIP RT enables AMD hardware ray tracing on RDNA2 and above",
|
||||
default=False,
|
||||
)
|
||||
|
||||
|
||||
@@ -30,12 +30,10 @@ BVHHIPRT::BVHHIPRT(const BVHParams ¶ms,
|
||||
|
||||
BVHHIPRT::~BVHHIPRT()
|
||||
{
|
||||
HIPRTDevice *hiprt_device = static_cast<HIPRTDevice *>(device);
|
||||
hiprtContext hiprt_context = hiprt_device->get_hiprt_context();
|
||||
custom_primitive_bound.free();
|
||||
triangle_index.free();
|
||||
vertex_data.free();
|
||||
hiprtDestroyGeometry(hiprt_context, hiprt_geom);
|
||||
device->release_bvh(this);
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
@@ -114,6 +114,7 @@ HIPRTDevice::HIPRTDevice(const DeviceInfo &info,
|
||||
HIPRTDevice::~HIPRTDevice()
|
||||
{
|
||||
HIPContextScope scope(this);
|
||||
free_bvh_memory_delayed();
|
||||
user_instance_id.free();
|
||||
prim_visibility.free();
|
||||
hiprt_blas_ptr.free();
|
||||
@@ -1150,12 +1151,33 @@ hiprtScene HIPRTDevice::build_tlas(BVHHIPRT *bvh,
|
||||
return scene;
|
||||
}
|
||||
|
||||
void HIPRTDevice::free_bvh_memory_delayed()
|
||||
{
|
||||
thread_scoped_lock lock(hiprt_mutex);
|
||||
if (stale_bvh.size()) {
|
||||
for (int bvh_index = 0; bvh_index < stale_bvh.size(); bvh_index++) {
|
||||
hiprtGeometry hiprt_geom = stale_bvh[bvh_index];
|
||||
hiprtDestroyGeometry(hiprt_context, hiprt_geom);
|
||||
hiprt_geom = nullptr;
|
||||
}
|
||||
stale_bvh.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void HIPRTDevice::release_bvh(BVH *bvh)
|
||||
{
|
||||
BVHHIPRT *current_bvh = static_cast<BVHHIPRT *>(bvh);
|
||||
thread_scoped_lock lock(hiprt_mutex);
|
||||
/* Tracks BLAS pointers whose BVH destructors have been called. */
|
||||
stale_bvh.push_back(current_bvh->hiprt_geom);
|
||||
}
|
||||
|
||||
void HIPRTDevice::build_bvh(BVH *bvh, Progress &progress, bool refit)
|
||||
{
|
||||
if (have_error()) {
|
||||
return;
|
||||
}
|
||||
|
||||
free_bvh_memory_delayed();
|
||||
progress.set_substatus("Building HIPRT acceleration structure");
|
||||
|
||||
hiprtBuildOptions options;
|
||||
@@ -1173,6 +1195,7 @@ void HIPRTDevice::build_bvh(BVH *bvh, Progress &progress, bool refit)
|
||||
|
||||
if (scene) {
|
||||
hiprtDestroyScene(hiprt_context, scene);
|
||||
scene = nullptr;
|
||||
}
|
||||
scene = build_tlas(bvh_rt, bvh_rt->objects, options, refit);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ class HIPRTDevice : public HIPDevice {
|
||||
|
||||
void build_bvh(BVH *bvh, Progress &progress, bool refit) override;
|
||||
|
||||
void release_bvh(BVH *bvh) override;
|
||||
|
||||
hiprtContext get_hiprt_context()
|
||||
{
|
||||
return hiprt_context;
|
||||
@@ -65,7 +67,7 @@ class HIPRTDevice : public HIPDevice {
|
||||
const vector<Object *> &objects,
|
||||
hiprtBuildOptions options,
|
||||
bool refit);
|
||||
|
||||
void free_bvh_memory_delayed();
|
||||
hiprtContext hiprt_context;
|
||||
hiprtScene scene;
|
||||
hiprtFuncTable functions_table;
|
||||
@@ -74,6 +76,13 @@ class HIPRTDevice : public HIPDevice {
|
||||
size_t scratch_buffer_size;
|
||||
device_vector<char> scratch_buffer;
|
||||
|
||||
/* This vector tracks the hiprt_geom members of BVHRT so that device memory
|
||||
* can be managed/released in HIPRTDevice.
|
||||
* Even if synchronization occurs before memory release, a GPU job may still
|
||||
* launch between synchronization and release, potentially causing the GPU
|
||||
* to access unmapped memory. */
|
||||
vector<hiprtGeometry> stale_bvh;
|
||||
|
||||
/* Is this scene using motion blur? Note there might exist motion data even if
|
||||
* motion blur is disabled, for render passes. */
|
||||
bool use_motion_blur = false;
|
||||
|
||||
@@ -107,7 +107,7 @@ class ActionSlot(PropertyGroup, ActionSlotBase):
|
||||
return str(action_slot.handle)
|
||||
|
||||
action_slot_ui: StringProperty(
|
||||
name="Acion Slot",
|
||||
name="Action Slot",
|
||||
description="Slot of the Action to use for the Action Constraints",
|
||||
# These callbacks let us store the action slot's `handle` property
|
||||
# under the hood (which is unique and never changes), while acting
|
||||
|
||||
@@ -669,12 +669,12 @@ class NODE_OT_add_zone(NodeAddZoneOperator, Operator):
|
||||
|
||||
input_node_type: StringProperty(
|
||||
name="Input Node",
|
||||
description="Specifies the input node used the created zone",
|
||||
description="Specifies the input node used by the created zone",
|
||||
)
|
||||
|
||||
output_node_type: StringProperty(
|
||||
name="Output Node",
|
||||
description="Specifies the output node used the created zone",
|
||||
description="Specifies the output node used by the created zone",
|
||||
)
|
||||
|
||||
add_default_geometry_link: BoolProperty(
|
||||
@@ -691,12 +691,12 @@ class NODE_OT_swap_zone(ZoneOperator, NodeSwapOperator, Operator):
|
||||
|
||||
input_node_type: StringProperty(
|
||||
name="Input Node",
|
||||
description="Specifies the input node used the created zone",
|
||||
description="Specifies the input node used by the created zone",
|
||||
)
|
||||
|
||||
output_node_type: StringProperty(
|
||||
name="Output Node",
|
||||
description="Specifies the output node used the created zone",
|
||||
description="Specifies the output node used by the created zone",
|
||||
)
|
||||
|
||||
add_default_geometry_link: BoolProperty(
|
||||
|
||||
@@ -1342,7 +1342,7 @@ class WM_OT_doc_view_manual(Operator):
|
||||
self.report(
|
||||
{'WARNING'},
|
||||
rpt_("No reference available {!r}, "
|
||||
"Update info in '_rna_manual_reference.py' "
|
||||
"update info in '_rna_manual_reference.py' "
|
||||
"or callback to bpy.utils.manual_map()").format(self.doc_id)
|
||||
)
|
||||
return {'CANCELLED'}
|
||||
|
||||
@@ -294,9 +294,6 @@ def draw_shape_key_properties(context, layout):
|
||||
row.active = enable_edit_value
|
||||
row.prop(key, "eval_time")
|
||||
|
||||
if ob.type == 'MESH':
|
||||
layout.prop(ob, "add_rest_position_attribute")
|
||||
|
||||
|
||||
class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
|
||||
bl_label = "Shape Keys"
|
||||
@@ -338,6 +335,12 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
|
||||
|
||||
col.menu("MESH_MT_shape_key_context_menu", icon='DOWNARROW_HLT', text="")
|
||||
|
||||
if ob.type == 'MESH':
|
||||
row = layout.row(align=True)
|
||||
row.use_property_split = False
|
||||
row.alignment = 'LEFT'
|
||||
row.prop(ob, "add_rest_position_attribute")
|
||||
|
||||
if kb:
|
||||
col.separator()
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ static void rna_FileBrowser_deselect_all(SpaceFile *sfile, ReportList *reports)
|
||||
if (sfile->files == nullptr) {
|
||||
/* Likely to happen in background mode.
|
||||
* We could look into initializing this on demand, see: #141547. */
|
||||
BKE_report(reports, RPT_ERROR, "uninitialized file-list");
|
||||
BKE_report(reports, RPT_ERROR, "Uninitialized file-list");
|
||||
return;
|
||||
}
|
||||
ED_fileselect_deselect_all(sfile);
|
||||
|
||||
Reference in New Issue
Block a user