Possible fix for #31054: cycles viewport rendering not working with CUDA for

computation and ATI card for OpenGL.
This commit is contained in:
Brecht Van Lommel 2012-05-03 23:39:42 +00:00
parent 48ead27366
commit 0fcf17fc72

@ -172,10 +172,15 @@ public:
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;