[Bf-blender-cvs] [4b58200] opensubdiv-modifier: OpenSubdiv: Fix wrong cached result in cuew when there's no CUDA

Sergey Sharybin noreply at git.blender.org
Mon Aug 4 20:21:20 CEST 2014


Commit: 4b58200eb80f69e795ad6d21849e7ad039be35ed
Author: Sergey Sharybin
Date:   Tue Aug 5 00:20:51 2014 +0600
Branches: opensubdiv-modifier
https://developer.blender.org/rB4b58200eb80f69e795ad6d21849e7ad039be35ed

OpenSubdiv: Fix wrong cached result in cuew when there's no CUDA

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

M	extern/cuew/auto/cuew_gen.py
M	extern/cuew/src/cuew.c

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

diff --git a/extern/cuew/auto/cuew_gen.py b/extern/cuew/auto/cuew_gen.py
index 709ccea..7f3f0ee 100644
--- a/extern/cuew/auto/cuew_gen.py
+++ b/extern/cuew/auto/cuew_gen.py
@@ -460,14 +460,16 @@ def print_init_guard():
 
   error = atexit(cuewExit);
   if (error) {
-    return CUEW_ERROR_ATEXIT_FAILED;
+    result = CUEW_ERROR_ATEXIT_FAILED;
+    return result;
   }
 
   /* Load library. */
   lib = dynamic_library_open(path);
 
   if (lib == NULL) {
-    return CUEW_ERROR_OPEN_FAILED;
+    result = CUEW_ERROR_OPEN_FAILED;
+    return result;
   }""")
     print("")
 
@@ -484,7 +486,8 @@ def print_driver_version_guard():
 
   /* We require version 4.0. */
   if (driver_version < 4000) {
-    return 0;
+    result = CUEW_ERROR_OPEN_FAILED;
+    return result;
   }""" % (REAL_LIB))
 
 
diff --git a/extern/cuew/src/cuew.c b/extern/cuew/src/cuew.c
index 7c7f942..35ffca3 100644
--- a/extern/cuew/src/cuew.c
+++ b/extern/cuew/src/cuew.c
@@ -291,14 +291,16 @@ int cuewInit(void) {
 
   error = atexit(cuewExit);
   if (error) {
-    return CUEW_ERROR_ATEXIT_FAILED;
+    result = CUEW_ERROR_ATEXIT_FAILED;
+    return result;
   }
 
   /* Load library. */
   lib = dynamic_library_open(path);
 
   if (lib == NULL) {
-    return CUEW_ERROR_OPEN_FAILED;
+    result = CUEW_ERROR_OPEN_FAILED;
+    return result;
   }
 
   /* Detect driver version. */
@@ -311,7 +313,8 @@ int cuewInit(void) {
 
   /* We require version 4.0. */
   if (driver_version < 4000) {
-    return 0;
+    result = CUEW_ERROR_OPEN_FAILED;
+    return result;
   }
   /* Fetch all function pointers. */
   CUDA_LIBRARY_FIND(cuGetErrorString);




More information about the Bf-blender-cvs mailing list