diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-05-19 00:28:04 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-05-19 01:30:23 +0300 |
commit | ff8673399ecb42b1e4c796d176454c17921fa390 (patch) | |
tree | e510e6b195f475b31fdda813af4119d93b2e8403 | |
parent | 51278bab5ded412fa1a38c2564cc3fda71e3129b (diff) |
OpenSubdiv: remove legacy support & display queries
OSD display needs more work, since it uses some legacy OpenGL light and material functions.
-rw-r--r-- | intern/opensubdiv/opensubdiv_capi.cc | 13 | ||||
-rw-r--r-- | intern/opensubdiv/opensubdiv_capi.h | 4 | ||||
-rw-r--r-- | intern/opensubdiv/opensubdiv_gpu_capi.cc | 7 | ||||
-rw-r--r-- | intern/opensubdiv/opensubdiv_utils_capi.cc | 14 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 3 |
6 files changed, 7 insertions, 36 deletions
diff --git a/intern/opensubdiv/opensubdiv_capi.cc b/intern/opensubdiv/opensubdiv_capi.cc index 52ce98fe74b..8337bcb0ce5 100644 --- a/intern/opensubdiv/opensubdiv_capi.cc +++ b/intern/opensubdiv/opensubdiv_capi.cc @@ -368,16 +368,3 @@ const struct OpenSubdiv_TopologyRefinerDescr *openSubdiv_getGLMeshTopologyRefine { return gl_mesh->topology_refiner; } - -int openSubdiv_supportGPUDisplay(void) -{ - // TODO: simplify extension check once Blender adopts GL 3.2 - 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))); - /* also ARB_explicit_attrib_location? */ -} diff --git a/intern/opensubdiv/opensubdiv_capi.h b/intern/opensubdiv/opensubdiv_capi.h index c3a194813e6..3fdfefd525f 100644 --- a/intern/opensubdiv/opensubdiv_capi.h +++ b/intern/opensubdiv/opensubdiv_capi.h @@ -146,11 +146,9 @@ void openSubdiv_osdGLAllocFVar(struct OpenSubdiv_TopologyRefinerDescr *topology_ void openSubdiv_osdGLDestroyFVar(OpenSubdiv_GLMesh *gl_mesh); /* ** Utility functions ** */ -int openSubdiv_supportGPUDisplay(void); int openSubdiv_getAvailableEvaluators(void); -void openSubdiv_init(bool gpu_legacy_support); +void openSubdiv_init(void); void openSubdiv_cleanup(void); -bool openSubdiv_gpu_legacy_support(void); #ifdef __cplusplus } diff --git a/intern/opensubdiv/opensubdiv_gpu_capi.cc b/intern/opensubdiv/opensubdiv_gpu_capi.cc index 00592f2e87e..d6b30b9bfe3 100644 --- a/intern/opensubdiv/opensubdiv_gpu_capi.cc +++ b/intern/opensubdiv/opensubdiv_gpu_capi.cc @@ -423,11 +423,10 @@ bool openSubdiv_osdGLDisplayInit(void) { static bool need_init = true; static bool init_success = false; - if (need_init) { - if (!openSubdiv_supportGPUDisplay()) { - return false; - } + if (need_init) { + /* TODO: update OSD drawing to OpenGL 3.3 core, then remove following line */ + return false; const char *version = ""; if (GLEW_VERSION_3_2) { diff --git a/intern/opensubdiv/opensubdiv_utils_capi.cc b/intern/opensubdiv/opensubdiv_utils_capi.cc index ae5592367dd..72e3751e6b3 100644 --- a/intern/opensubdiv/opensubdiv_utils_capi.cc +++ b/intern/opensubdiv/opensubdiv_utils_capi.cc @@ -41,14 +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()) { - return 0; - } - int flags = OPENSUBDIV_EVALUATOR_CPU; #ifdef OPENSUBDIV_HAS_OPENMP @@ -82,19 +76,13 @@ int openSubdiv_getAvailableEvaluators(void) return flags; } -void openSubdiv_init(bool gpu_legacy_support) +void openSubdiv_init(void) { /* 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; -} diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c index ab89a920089..9c86a22a1f8 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c +++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c @@ -993,7 +993,7 @@ void ccgSubSurf__sync_subdivUvs(CCGSubSurf *ss, bool subdiv_uvs) void BKE_subsurf_osd_init(void) { - openSubdiv_init(false); + openSubdiv_init(); BLI_spin_init(&delete_spin); } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 35887c12d62..da7bbb55b00 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -5014,8 +5014,7 @@ static bool subsurf_use_gpu_backend(SubsurfFlags flags) */ return (flags & SUBSURF_USE_GPU_BACKEND) != 0 && - (U.opensubdiv_compute_type != USER_OPENSUBDIV_COMPUTE_NONE) && - (openSubdiv_supportGPUDisplay()); + (U.opensubdiv_compute_type != USER_OPENSUBDIV_COMPUTE_NONE); #else (void)flags; return false; |