diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-04 03:39:42 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-04 03:39:42 +0400 |
commit | 0fcf17fc72319bc52b793b2f6156a60aed31dc62 (patch) | |
tree | 5deeb3074f2df5ed89617a97bdb6dd3f1e4195ac /intern | |
parent | 48ead2736643cf0327b9472cfd05042a58f9d9b0 (diff) |
Possible fix for #31054: cycles viewport rendering not working with CUDA for
computation and ATI card for OpenGL.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/device_cuda.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/intern/cycles/device/device_cuda.cpp b/intern/cycles/device/device_cuda.cpp index 0c08baae3ff..4bead82fe5a 100644 --- a/intern/cycles/device/device_cuda.cpp +++ b/intern/cycles/device/device_cuda.cpp @@ -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; |