[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46250] trunk/blender/intern/cycles/device /device_cuda.cpp: Possible fix for #31054: cycles viewport rendering not working with CUDA for

Brecht Van Lommel brechtvanlommel at pandora.be
Fri May 4 01:39:44 CEST 2012


Revision: 46250
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46250
Author:   blendix
Date:     2012-05-03 23:39:42 +0000 (Thu, 03 May 2012)
Log Message:
-----------
Possible fix for #31054: cycles viewport rendering not working with CUDA for
computation and ATI card for OpenGL.

Modified Paths:
--------------
    trunk/blender/intern/cycles/device/device_cuda.cpp

Modified: trunk/blender/intern/cycles/device/device_cuda.cpp
===================================================================
--- trunk/blender/intern/cycles/device/device_cuda.cpp	2012-05-03 23:15:01 UTC (rev 46249)
+++ trunk/blender/intern/cycles/device/device_cuda.cpp	2012-05-03 23:39:42 UTC (rev 46250)
@@ -172,10 +172,15 @@
 
 		CUresult result;
 
-		if(background)
+		if(background) {
 			result = cuCtxCreate(&cuContext, 0, cuDevice);
-		else
-			result = cuGLCtxCreate(&cuContext, 0, cuDevice);
+		}
+		else {
+			if(cuGLCtxCreate(&cuContext, 0, cuDevice) != CUDA_SUCCESS) {
+				result = cuCtxCreate(&cuContext, 0, cuDevice);
+				background = true;
+			}
+		}
 
 		if(cuda_error(result))
 			return;




More information about the Bf-blender-cvs mailing list