main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
5 changed files with 25 additions and 7 deletions
Showing only changes of commit 30e517c3ca - Show all commits

View File

@ -581,6 +581,10 @@ void MetalDevice::compile_and_load(int device_id, MetalPipelineType pso_type)
thread_scoped_lock lock(existing_devices_mutex); thread_scoped_lock lock(existing_devices_mutex);
if (MetalDevice *instance = get_device_by_ID(device_id, lock)) { if (MetalDevice *instance = get_device_by_ID(device_id, lock)) {
if (mtlLibrary) { if (mtlLibrary) {
if (error && [error localizedDescription]) {
VLOG_WARNING << "MSL compilation messages: " << [[error localizedDescription] UTF8String];
}
instance->mtlLibrary[pso_type] = mtlLibrary; instance->mtlLibrary[pso_type] = mtlLibrary;
starttime = time_dt(); starttime = time_dt();

View File

@ -715,7 +715,7 @@ void MetalKernelPipeline::compile()
} }
} }
}; };
if (computePipelineStateDescriptor.linkedFunctions) { if (linked_functions) {
addComputePipelineFunctionsWithDescriptor(); addComputePipelineFunctionsWithDescriptor();
} }
@ -748,7 +748,7 @@ void MetalKernelPipeline::compile()
} }
/* Add pipeline into the new archive (unless we did it earlier). */ /* Add pipeline into the new archive (unless we did it earlier). */
if (pipeline && !computePipelineStateDescriptor.linkedFunctions) { if (pipeline && !linked_functions) {
addComputePipelineFunctionsWithDescriptor(); addComputePipelineFunctionsWithDescriptor();
} }
} }

View File

@ -38,7 +38,7 @@ ccl_device_inline void gpu_parallel_sort_bucket_pass(const uint num_states,
ccl_gpu_shared int *buckets, ccl_gpu_shared int *buckets,
const ushort local_id, const ushort local_id,
const ushort local_size, const ushort local_size,
const ushort grid_id) const uint grid_id)
{ {
/* Zero the bucket sizes. */ /* Zero the bucket sizes. */
if (local_id < max_shaders) { if (local_id < max_shaders) {
@ -89,7 +89,7 @@ ccl_device_inline void gpu_parallel_sort_write_pass(const uint num_states,
ccl_gpu_shared int *local_offset, ccl_gpu_shared int *local_offset,
const ushort local_id, const ushort local_id,
const ushort local_size, const ushort local_size,
const ushort grid_id) const uint grid_id)
{ {
/* Calculate each partition's global offset from the prefix sum of the active state counts per /* Calculate each partition's global offset from the prefix sum of the active state counts per
* partition. */ * partition. */

View File

@ -109,7 +109,7 @@ struct kernel_gpu_##name \
const uint metal_global_id, \ const uint metal_global_id, \
const ushort metal_local_id, \ const ushort metal_local_id, \
const ushort metal_local_size, \ const ushort metal_local_size, \
const ushort metal_grid_id, \ const uint metal_grid_id, \
uint simdgroup_size, \ uint simdgroup_size, \
uint simd_lane_index, \ uint simd_lane_index, \
uint simd_group_index, \ uint simd_group_index, \
@ -122,7 +122,7 @@ kernel void cycles_metal_##name(device const kernel_gpu_##name *params_struct, \
const uint metal_global_id [[thread_position_in_grid]], \ const uint metal_global_id [[thread_position_in_grid]], \
const ushort metal_local_id [[thread_position_in_threadgroup]], \ const ushort metal_local_id [[thread_position_in_threadgroup]], \
const ushort metal_local_size [[threads_per_threadgroup]], \ const ushort metal_local_size [[threads_per_threadgroup]], \
const ushort metal_grid_id [[threadgroup_position_in_grid]], \ const uint metal_grid_id [[threadgroup_position_in_grid]], \
uint simdgroup_size [[threads_per_simdgroup]], \ uint simdgroup_size [[threads_per_simdgroup]], \
uint simd_lane_index [[thread_index_in_simdgroup]], \ uint simd_lane_index [[thread_index_in_simdgroup]], \
uint simd_group_index [[simdgroup_index_in_threadgroup]], \ uint simd_group_index [[simdgroup_index_in_threadgroup]], \
@ -135,7 +135,7 @@ void kernel_gpu_##name::run(thread MetalKernelContext& context, \
const uint metal_global_id, \ const uint metal_global_id, \
const ushort metal_local_id, \ const ushort metal_local_id, \
const ushort metal_local_size, \ const ushort metal_local_size, \
const ushort metal_grid_id, \ const uint metal_grid_id, \
uint simdgroup_size, \ uint simdgroup_size, \
uint simd_lane_index, \ uint simd_lane_index, \
uint simd_group_index, \ uint simd_group_index, \

View File

@ -3894,6 +3894,16 @@ static void filelist_readjob_all_asset_library(FileListReadJob *job_params,
/* A valid, but empty file-list from now. */ /* A valid, but empty file-list from now. */
filelist->filelist.entries_num = 0; filelist->filelist.entries_num = 0;
asset_system::AssetLibrary *current_file_library;
{
AssetLibraryReference library_ref{};
library_ref.custom_library_index = -1;
library_ref.type = ASSET_LIBRARY_LOCAL;
current_file_library = AS_asset_library_load(job_params->current_main, library_ref);
}
job_params->load_asset_library = current_file_library;
filelist_readjob_main_assets_add_items(job_params, stop, do_update, progress); filelist_readjob_main_assets_add_items(job_params, stop, do_update, progress);
/* When only doing partially reload for main data, we're done. */ /* When only doing partially reload for main data, we're done. */
@ -3916,6 +3926,10 @@ static void filelist_readjob_all_asset_library(FileListReadJob *job_params,
if (root_path.is_empty()) { if (root_path.is_empty()) {
return; return;
} }
if (&nested_library == current_file_library) {
/* Skip the "Current File" library, it's already loaded above. */
return;
}
/* Override library info to read this library. */ /* Override library info to read this library. */
job_params->load_asset_library = &nested_library; job_params->load_asset_library = &nested_library;