OpenSubdiv: remove legacy support & display queries

OSD display needs more work, since it uses some legacy OpenGL light and material functions.
This commit is contained in:
Mike Erwin 2017-05-18 17:28:04 -04:00
parent 51278bab5d
commit ff8673399e
6 changed files with 7 additions and 36 deletions

View File

@ -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? */
}

View File

@ -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
}

View File

@ -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) {

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;