Fix Cycles MetalRT not working after recent oneAPI changes

Forgot to initialize the device info.
This commit is contained in:
Brecht Van Lommel
2023-04-28 19:42:32 +02:00
parent 2fcf34a6bd
commit 5b69be00a6
2 changed files with 6 additions and 4 deletions

View File

@@ -55,8 +55,11 @@ void device_metal_info(vector<DeviceInfo> &devices)
info.denoisers = DENOISER_NONE;
info.id = id;
info.has_nanovdb = MetalInfo::get_device_vendor(device) == METAL_GPU_APPLE;
info.has_light_tree = MetalInfo::get_device_vendor(device) != METAL_GPU_AMD;
MetalGPUVendor vendor = MetalInfo::get_device_vendor(device);
info.has_nanovdb = vendor == METAL_GPU_APPLE;
info.has_light_tree = vendor != METAL_GPU_AMD;
info.use_hardware_raytracing = vendor != METAL_GPU_INTEL;
devices.push_back(info);
device_index++;

View File

@@ -100,16 +100,15 @@ MetalDevice::MetalDevice(const DeviceInfo &info, Stats &stats, Profiler &profile
}
case METAL_GPU_AMD: {
max_threads_per_threadgroup = 128;
use_metalrt = info.use_hardware_raytracing;
break;
}
case METAL_GPU_APPLE: {
max_threads_per_threadgroup = 512;
use_metalrt = info.use_hardware_raytracing;
break;
}
}
use_metalrt = info.use_hardware_raytracing;
if (auto metalrt = getenv("CYCLES_METALRT")) {
use_metalrt = (atoi(metalrt) != 0);
}