[Bf-blender-cvs] [4bcd9f1ae58] cycles-x: Cycles: Report device compute type to the full log

Sergey Sharybin noreply at git.blender.org
Wed May 5 10:37:19 CEST 2021


Commit: 4bcd9f1ae5880eb8debff74e42b41d99f1d6beb8
Author: Sergey Sharybin
Date:   Wed May 5 10:34:26 2021 +0200
Branches: cycles-x
https://developer.blender.org/rB4bcd9f1ae5880eb8debff74e42b41d99f1d6beb8

Cycles: Report device compute type to the full log

Makes it more explicitly visible whether rendering was done on CUDA
or OptiX.

Before this change one had to carefully look at the device ID, and the
look of OptiX device IDs was a bit confusing (mentioning both CUDA and
OPTIX in the ID).

===================================================================

M	intern/cycles/integrator/path_trace.cpp

===================================================================

diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp
index cdeb3ec318c..d1d1aee5737 100644
--- a/intern/cycles/integrator/path_trace.cpp
+++ b/intern/cycles/integrator/path_trace.cpp
@@ -426,12 +426,37 @@ bool PathTrace::get_render_tile_pixels(PassAccessor &pass_accessor, float *pixel
  * Report generation.
  */
 
+static const char *device_type_for_description(const DeviceType type)
+{
+  switch (type) {
+    case DEVICE_NONE:
+      return "None";
+
+    case DEVICE_CPU:
+      return "CPU";
+    case DEVICE_OPENCL:
+      return "OpenCL";
+    case DEVICE_CUDA:
+      return "CUDA";
+    case DEVICE_OPTIX:
+      return "OptiX";
+    case DEVICE_DUMMY:
+      return "Dummy";
+    case DEVICE_MULTI:
+      return "Multi";
+  }
+
+  return "UNKNOWN";
+}
+
 /* Construct description of the device which will appear in the full report. */
 /* TODO(sergey): Consider making it more reusable utility. */
 static string full_device_info_description(const DeviceInfo &device_info)
 {
   string full_description = device_info.description;
 
+  full_description += " (" + string(device_type_for_description(device_info.type)) + ")";
+
   if (device_info.display_device) {
     full_description += " (display)";
   }



More information about the Bf-blender-cvs mailing list