Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-12-18 21:16:52 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-12-18 21:16:52 +0300
commit82921ce42002901791d786890c232dc6768c8e62 (patch)
treef4fd36aabfaf058d8abdd2b40d96520cdbc72e9a /intern/opensubdiv
parent672f2efbe68ff6e75b0994358fa0269fc7105f43 (diff)
OpenSubdiv: Avoid having bad-level call
This is always asking for problems. Additionally, that call was leading to OpenGL calls happening from threads.
Diffstat (limited to 'intern/opensubdiv')
-rw-r--r--intern/opensubdiv/opensubdiv_capi.cc2
-rw-r--r--intern/opensubdiv/opensubdiv_capi.h5
-rw-r--r--intern/opensubdiv/opensubdiv_utils_capi.cc10
3 files changed, 12 insertions, 5 deletions
diff --git a/intern/opensubdiv/opensubdiv_capi.cc b/intern/opensubdiv/opensubdiv_capi.cc
index 6c226d6cf6b..9b9f4baa39e 100644
--- a/intern/opensubdiv/opensubdiv_capi.cc
+++ b/intern/opensubdiv/opensubdiv_capi.cc
@@ -296,7 +296,7 @@ const struct OpenSubdiv_TopologyRefinerDescr *openSubdiv_getGLMeshTopologyRefine
int openSubdiv_supportGPUDisplay(void)
{
// TODO: simplify extension check once Blender adopts GL 3.2
- return GPU_legacy_support() &&
+ return openSubdiv_gpu_legacy_support() &&
(GLEW_VERSION_3_2 ||
(GLEW_VERSION_3_1 && GLEW_EXT_geometry_shader4) ||
(GLEW_VERSION_3_0 && GLEW_EXT_geometry_shader4 && GLEW_ARB_uniform_buffer_object && (GLEW_ARB_texture_buffer_object || GLEW_EXT_texture_buffer_object)));
diff --git a/intern/opensubdiv/opensubdiv_capi.h b/intern/opensubdiv/opensubdiv_capi.h
index 9d1c1b3795c..b40505b197d 100644
--- a/intern/opensubdiv/opensubdiv_capi.h
+++ b/intern/opensubdiv/opensubdiv_capi.h
@@ -141,10 +141,9 @@ void openSubdiv_osdGLMeshDisplay(OpenSubdiv_GLMesh *gl_mesh,
/* ** Utility functions ** */
int openSubdiv_supportGPUDisplay(void);
int openSubdiv_getAvailableEvaluators(void);
-void openSubdiv_init(void);
+void openSubdiv_init(bool gpu_legacy_support);
void openSubdiv_cleanup(void);
-
-extern bool GPU_legacy_support(void);
+bool openSubdiv_gpu_legacy_support(void);
#ifdef __cplusplus
}
diff --git a/intern/opensubdiv/opensubdiv_utils_capi.cc b/intern/opensubdiv/opensubdiv_utils_capi.cc
index c993e347587..ae5592367dd 100644
--- a/intern/opensubdiv/opensubdiv_utils_capi.cc
+++ b/intern/opensubdiv/opensubdiv_utils_capi.cc
@@ -41,6 +41,8 @@
# include "opensubdiv_device_context_cuda.h"
#endif /* OPENSUBDIV_HAS_CUDA */
+static bool gpu_legacy_support_global = false;
+
int openSubdiv_getAvailableEvaluators(void)
{
if (!openSubdiv_supportGPUDisplay()) {
@@ -80,13 +82,19 @@ int openSubdiv_getAvailableEvaluators(void)
return flags;
}
-void openSubdiv_init(void)
+void openSubdiv_init(bool gpu_legacy_support)
{
/* Ensure all OpenGL strings are cached. */
(void)openSubdiv_getAvailableEvaluators();
+ gpu_legacy_support_global = gpu_legacy_support;
}
void openSubdiv_cleanup(void)
{
openSubdiv_osdGLDisplayDeinit();
}
+
+bool openSubdiv_gpu_legacy_support(void)
+{
+ return gpu_legacy_support_global;
+}