Cycles: Fix OptiX context log no longer showing up
Commit 8392ca915b removed
WITH_CYCLES_LOGGING, but missed that the OptiX context log was
conditionally compiled depending on that definition, so this fixes
that.
Pull Request: https://projects.blender.org/blender/blender/pulls/147706
This commit is contained in:
@@ -63,7 +63,6 @@ OptiXDevice::OptiXDevice(const DeviceInfo &info, Stats &stats, Profiler &profile
|
|||||||
|
|
||||||
/* Create OptiX context for this device. */
|
/* Create OptiX context for this device. */
|
||||||
OptixDeviceContextOptions options = {};
|
OptixDeviceContextOptions options = {};
|
||||||
# ifdef WITH_CYCLES_LOGGING
|
|
||||||
options.logCallbackLevel = 4; /* Fatal = 1, Error = 2, Warning = 3, Print = 4. */
|
options.logCallbackLevel = 4; /* Fatal = 1, Error = 2, Warning = 3, Print = 4. */
|
||||||
options.logCallbackFunction = [](unsigned int level, const char *, const char *message, void *) {
|
options.logCallbackFunction = [](unsigned int level, const char *, const char *message, void *) {
|
||||||
switch (level) {
|
switch (level) {
|
||||||
@@ -77,22 +76,19 @@ OptiXDevice::OptiXDevice(const DeviceInfo &info, Stats &stats, Profiler &profile
|
|||||||
LOG_WARNING << message;
|
LOG_WARNING << message;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
LOG_INFO << message;
|
LOG_DEBUG << message;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
# endif
|
|
||||||
if (DebugFlags().optix.use_debug) {
|
if (DebugFlags().optix.use_debug) {
|
||||||
LOG_INFO << "Using OptiX debug mode.";
|
LOG_INFO << "Using OptiX debug mode.";
|
||||||
options.validationMode = OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL;
|
options.validationMode = OPTIX_DEVICE_CONTEXT_VALIDATION_MODE_ALL;
|
||||||
}
|
}
|
||||||
optix_assert(optixDeviceContextCreate(cuContext, &options, &context));
|
optix_assert(optixDeviceContextCreate(cuContext, &options, &context));
|
||||||
# ifdef WITH_CYCLES_LOGGING
|
|
||||||
optix_assert(optixDeviceContextSetLogCallback(
|
optix_assert(optixDeviceContextSetLogCallback(
|
||||||
context, options.logCallbackFunction, options.logCallbackData, options.logCallbackLevel));
|
context, options.logCallbackFunction, options.logCallbackData, options.logCallbackLevel));
|
||||||
# endif
|
|
||||||
|
|
||||||
/* Fix weird compiler bug that assigns wrong size. */
|
/* Fix weird compiler bug that assigns wrong size. */
|
||||||
launch_params.data_elements = sizeof(KernelParamsOptiX);
|
launch_params.data_elements = sizeof(KernelParamsOptiX);
|
||||||
|
|||||||
Reference in New Issue
Block a user