[Bf-blender-cvs] [d0cba5caf46] blender-v2.81-release: Fix T70937: Cycles fails in viewport when rendering with OptiX

Patrick Mours noreply at git.blender.org
Mon Oct 21 14:24:12 CEST 2019


Commit: d0cba5caf464e18e8522c3f890cb1053631374c1
Author: Patrick Mours
Date:   Mon Oct 21 14:22:24 2019 +0200
Branches: blender-v2.81-release
https://developer.blender.org/rBd0cba5caf464e18e8522c3f890cb1053631374c1

Fix T70937: Cycles fails in viewport when rendering with OptiX

Was caused by D6068, which did not handle "MEM_PIXELS" memory
when not in background mode. Before that it always fell back to using
generic device memory, so restoring that behavior. In future this
should be changes to use OpenGL interop for optimal performance.

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

M	intern/cycles/device/device_optix.cpp

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

diff --git a/intern/cycles/device/device_optix.cpp b/intern/cycles/device/device_optix.cpp
index e230662e698..370e3cf4085 100644
--- a/intern/cycles/device/device_optix.cpp
+++ b/intern/cycles/device/device_optix.cpp
@@ -1196,14 +1196,16 @@ class OptiXDevice : public Device {
   void mem_alloc(device_memory &mem) override
   {
     if (mem.type == MEM_PIXELS && !background) {
-      assert(!"mem_alloc not supported for pixels.");
+      // Always fall back to no interop for now
+      // TODO(pmours): Support OpenGL interop when moving CUDA memory management to common code
+      background = true;
     }
     else if (mem.type == MEM_TEXTURE) {
       assert(!"mem_alloc not supported for textures.");
+      return;
     }
-    else {
-      generic_alloc(mem);
-    }
+
+    generic_alloc(mem);
   }
 
   CUDAMem *generic_alloc(device_memory &mem, size_t pitch_padding = 0)



More information about the Bf-blender-cvs mailing list