Subdiv: remove unused GPU device choice, fix crash with libepoxy on init

openSubdiv_init() would detect available evaluators before any OpenGL context
exists, causing a crash with libepoxy. This test however is redundant as we
already check the requirements on the Blender side through the GPU API.

To simplify things, completely remove the device detection in the opensubdiv
module and reduce the evaluators to just CPU and GPU. The plan here is to move
to the GPU module abstraction over OpenGL/Metal/Vulkan and so all these
different backends no longer make sense.

This also removes the user preference for OpenSubdiv compute device, which was
not used for the new GPU subdivision implementation.

Ref D15291

Differential Revision: https://developer.blender.org/D15470
This commit is contained in:
Brecht Van Lommel 2022-07-15 19:32:09 +02:00
parent 3c016fbfd0
commit c7f788b877
24 changed files with 11 additions and 561 deletions

View File

@ -42,18 +42,6 @@ if(WITH_OPENSUBDIV)
internal/base/util.cc
internal/base/util.h
# Device.
internal/device/device_context_cuda.cc
internal/device/device_context_cuda.h
internal/device/device_context_glsl_compute.cc
internal/device/device_context_glsl_compute.h
internal/device/device_context_glsl_transform_feedback.cc
internal/device/device_context_glsl_transform_feedback.h
internal/device/device_context_opencl.cc
internal/device/device_context_opencl.h
internal/device/device_context_openmp.cc
internal/device/device_context_openmp.h
# Evaluator.
internal/evaluator/eval_output.cc
internal/evaluator/eval_output.h

View File

@ -21,55 +21,15 @@
#endif
#include "internal/base/util.h"
#include "internal/device/device_context_cuda.h"
#include "internal/device/device_context_glsl_compute.h"
#include "internal/device/device_context_glsl_transform_feedback.h"
#include "internal/device/device_context_opencl.h"
#include "internal/device/device_context_openmp.h"
using blender::opensubdiv::CUDADeviceContext;
using blender::opensubdiv::GLSLComputeDeviceContext;
using blender::opensubdiv::GLSLTransformFeedbackDeviceContext;
using blender::opensubdiv::OpenCLDeviceContext;
using blender::opensubdiv::OpenMPDeviceContext;
void openSubdiv_init()
{
// Ensure all OpenGL strings are cached.
openSubdiv_getAvailableEvaluators();
}
void openSubdiv_cleanup()
{
}
int openSubdiv_getAvailableEvaluators()
{
int flags = OPENSUBDIV_EVALUATOR_CPU;
if (OpenMPDeviceContext::isSupported()) {
flags |= OPENSUBDIV_EVALUATOR_OPENMP;
}
if (OpenCLDeviceContext::isSupported()) {
flags |= OPENSUBDIV_EVALUATOR_OPENCL;
}
if (CUDADeviceContext::isSupported()) {
flags |= OPENSUBDIV_EVALUATOR_CUDA;
}
if (GLSLTransformFeedbackDeviceContext::isSupported()) {
flags |= OPENSUBDIV_EVALUATOR_GLSL_TRANSFORM_FEEDBACK;
}
if (GLSLComputeDeviceContext::isSupported()) {
flags |= OPENSUBDIV_EVALUATOR_GLSL_COMPUTE;
}
return flags;
}
int openSubdiv_getVersionHex()
{
#if defined(OPENSUBDIV_VERSION_NUMBER)

View File

@ -1,39 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#include "internal/device/device_context_cuda.h"
namespace blender {
namespace opensubdiv {
bool CUDADeviceContext::isSupported()
{
// TODO(sergey): Add CUDA device support, using CUDA-RT API.
return false;
}
CUDADeviceContext::CUDADeviceContext()
{
}
CUDADeviceContext::~CUDADeviceContext()
{
}
} // namespace opensubdiv
} // namespace blender

View File

@ -1,38 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#ifndef OPENSUBDIV_DEVICE_CONTEXT_CUDA_H_
#define OPENSUBDIV_DEVICE_CONTEXT_CUDA_H_
namespace blender {
namespace opensubdiv {
class CUDADeviceContext {
public:
// Stateless check to see whether CUDA functionality is available on this
// platform.
static bool isSupported();
CUDADeviceContext();
~CUDADeviceContext();
};
} // namespace opensubdiv
} // namespace blender
#endif // _OPENSUBDIV_DEVICE_CONTEXT_CUDA_H_

View File

@ -1,40 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#include "internal/device/device_context_glsl_compute.h"
#include <GL/glew.h>
namespace blender {
namespace opensubdiv {
bool GLSLComputeDeviceContext::isSupported()
{
return GLEW_VERSION_4_3 || GLEW_ARB_compute_shader;
}
GLSLComputeDeviceContext::GLSLComputeDeviceContext()
{
}
GLSLComputeDeviceContext::~GLSLComputeDeviceContext()
{
}
} // namespace opensubdiv
} // namespace blender

View File

@ -1,38 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#ifndef OPENSUBDIV_DEVICE_CONTEXT_GLSL_COMPUTE_H_
#define OPENSUBDIV_DEVICE_CONTEXT_GLSL_COMPUTE_H_
namespace blender {
namespace opensubdiv {
class GLSLComputeDeviceContext {
public:
// Stateless check to see whether GLSL compute functionality is
// available on this platform.
static bool isSupported();
GLSLComputeDeviceContext();
~GLSLComputeDeviceContext();
};
} // namespace opensubdiv
} // namespace blender
#endif // _OPENSUBDIV_DEVICE_CONTEXT_GLSL_COMPUTE_H_

View File

@ -1,40 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#include "internal/device/device_context_glsl_transform_feedback.h"
#include <GL/glew.h>
namespace blender {
namespace opensubdiv {
bool GLSLTransformFeedbackDeviceContext::isSupported()
{
return GLEW_VERSION_4_1;
}
GLSLTransformFeedbackDeviceContext::GLSLTransformFeedbackDeviceContext()
{
}
GLSLTransformFeedbackDeviceContext::~GLSLTransformFeedbackDeviceContext()
{
}
} // namespace opensubdiv
} // namespace blender

View File

@ -1,38 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#ifndef OPENSUBDIV_DEVICE_CONTEXT_GLSL_TRANSFORM_FEEDBACK_H_
#define OPENSUBDIV_DEVICE_CONTEXT_GLSL_TRANSFORM_FEEDBACK_H_
namespace blender {
namespace opensubdiv {
class GLSLTransformFeedbackDeviceContext {
public:
// Stateless check to see whether GLSL transform feedback functionality is
// available on this platform.
static bool isSupported();
GLSLTransformFeedbackDeviceContext();
~GLSLTransformFeedbackDeviceContext();
};
} // namespace opensubdiv
} // namespace blender
#endif // _OPENSUBDIV_DEVICE_CONTEXT_GLSL_TRANSFORM_FEEDBACK_H_

View File

@ -1,39 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#include "internal/device/device_context_opencl.h"
namespace blender {
namespace opensubdiv {
bool OpenCLDeviceContext::isSupported()
{
// TODO(sergey): Add support of OpenCL devices.
return false;
}
OpenCLDeviceContext::OpenCLDeviceContext()
{
}
OpenCLDeviceContext::~OpenCLDeviceContext()
{
}
} // namespace opensubdiv
} // namespace blender

View File

@ -1,38 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#ifndef OPENSUBDIV_DEVICE_CONTEXT_OPENCL_H_
#define OPENSUBDIV_DEVICE_CONTEXT_OPENCL_H_
namespace blender {
namespace opensubdiv {
class OpenCLDeviceContext {
public:
// Stateless check to see whether OpenCL functionality is available on this
// platform.
static bool isSupported();
OpenCLDeviceContext();
~OpenCLDeviceContext();
};
} // namespace opensubdiv
} // namespace blender
#endif // _OPENSUBDIV_DEVICE_CONTEXT_OPENCL_H_

View File

@ -1,42 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#include "internal/device/device_context_openmp.h"
namespace blender {
namespace opensubdiv {
bool OpenMPDeviceContext::isSupported()
{
#ifdef OPENSUBDIV_HAS_OPENMP
return true;
#else
return false;
#endif
}
OpenMPDeviceContext::OpenMPDeviceContext()
{
}
OpenMPDeviceContext::~OpenMPDeviceContext()
{
}
} // namespace opensubdiv
} // namespace blender

View File

@ -1,38 +0,0 @@
// Copyright 2020 Blender Foundation. All rights reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Author: Sergey Sharybin
#ifndef OPENSUBDIV_DEVICE_CONTEXT_OPENMP_H_
#define OPENSUBDIV_DEVICE_CONTEXT_OPENMP_H_
namespace blender {
namespace opensubdiv {
class OpenMPDeviceContext {
public:
// Stateless check to see whether OpenMP functionality is available on this
// platform.
static bool isSupported();
OpenMPDeviceContext();
~OpenMPDeviceContext();
};
} // namespace opensubdiv
} // namespace blender
#endif // _OPENSUBDIV_DEVICE_CONTEXT_OPENMP_H_

View File

@ -30,7 +30,7 @@ OpenSubdiv_EvaluatorCacheImpl::~OpenSubdiv_EvaluatorCacheImpl()
OpenSubdiv_EvaluatorCacheImpl *openSubdiv_createEvaluatorCacheInternal(
eOpenSubdivEvaluator evaluator_type)
{
if (evaluator_type != eOpenSubdivEvaluator::OPENSUBDIV_EVALUATOR_GLSL_COMPUTE) {
if (evaluator_type != eOpenSubdivEvaluator::OPENSUBDIV_EVALUATOR_GPU) {
return nullptr;
}
OpenSubdiv_EvaluatorCacheImpl *evaluator_cache;

View File

@ -442,11 +442,6 @@ OpenSubdiv_EvaluatorImpl *openSubdiv_createEvaluatorInternal(
eOpenSubdivEvaluator evaluator_type,
OpenSubdiv_EvaluatorCacheImpl *evaluator_cache_descr)
{
// Only CPU and GLCompute are implemented at the moment.
if (evaluator_type != OPENSUBDIV_EVALUATOR_CPU &&
evaluator_type != OPENSUBDIV_EVALUATOR_GLSL_COMPUTE) {
return NULL;
}
using blender::opensubdiv::vector;
TopologyRefiner *refiner = topology_refiner->impl->topology_refiner;
if (refiner == NULL) {
@ -551,8 +546,8 @@ OpenSubdiv_EvaluatorImpl *openSubdiv_createEvaluatorInternal(
// Create OpenSubdiv's CPU side evaluator.
blender::opensubdiv::EvalOutputAPI::EvalOutput *eval_output = nullptr;
const bool use_gl_evaluator = evaluator_type == OPENSUBDIV_EVALUATOR_GLSL_COMPUTE;
if (use_gl_evaluator) {
const bool use_gpu_evaluator = evaluator_type == OPENSUBDIV_EVALUATOR_GPU;
if (use_gpu_evaluator) {
blender::opensubdiv::GpuEvalOutput::EvaluatorCache *evaluator_cache = nullptr;
if (evaluator_cache_descr) {
evaluator_cache = static_cast<blender::opensubdiv::GpuEvalOutput::EvaluatorCache *>(

View File

@ -31,9 +31,6 @@ extern "C" {
void openSubdiv_init(void);
void openSubdiv_cleanup(void);
// Bitmask of eOpenSubdivEvaluator.
int openSubdiv_getAvailableEvaluators(void);
int openSubdiv_getVersionHex(void);
#ifdef __cplusplus

View File

@ -23,15 +23,9 @@
extern "C" {
#endif
// Keep this a bitmask so it's possible to pass available
// evaluators to Blender.
typedef enum eOpenSubdivEvaluator {
OPENSUBDIV_EVALUATOR_CPU = (1 << 0),
OPENSUBDIV_EVALUATOR_OPENMP = (1 << 1),
OPENSUBDIV_EVALUATOR_OPENCL = (1 << 2),
OPENSUBDIV_EVALUATOR_CUDA = (1 << 3),
OPENSUBDIV_EVALUATOR_GLSL_TRANSFORM_FEEDBACK = (1 << 4),
OPENSUBDIV_EVALUATOR_GLSL_COMPUTE = (1 << 5),
OPENSUBDIV_EVALUATOR_CPU = 0,
OPENSUBDIV_EVALUATOR_GPU = 1,
} eOpenSubdivEvaluator;
typedef enum OpenSubdiv_SchemeType {

View File

@ -174,7 +174,6 @@ const UserDef U_default = {
.pie_menu_confirm = 0,
.pie_menu_radius = 100,
.pie_menu_threshold = 12,
.opensubdiv_compute_type = 0,
.factor_display_type = USER_FACTOR_AS_FACTOR,
.render_display_type = USER_RENDER_DISPLAY_WINDOW,
.filebrowser_display_type = USER_TEMP_SPACE_DISPLAY_WINDOW,

View File

@ -589,12 +589,6 @@ class USERPREF_PT_system_cycles_devices(SystemPanel, CenterAlignMixIn, Panel):
addon.preferences.draw_impl(col, context)
del addon
# NOTE: Disabled for until GPU side of OpenSubdiv is brought back.
# system = prefs.system
# if hasattr(system, "opensubdiv_compute_type"):
# col.label(text="OpenSubdiv compute:")
# col.row().prop(system, "opensubdiv_compute_type", text="")
class USERPREF_PT_system_os_settings(SystemPanel, CenterAlignMixIn, Panel):
bl_label = "Operating System Settings"

View File

@ -20,7 +20,7 @@ struct Subdiv;
typedef enum eSubdivEvaluatorType {
SUBDIV_EVALUATOR_TYPE_CPU,
SUBDIV_EVALUATOR_TYPE_GLSL_COMPUTE,
SUBDIV_EVALUATOR_TYPE_GPU,
} eSubdivEvaluatorType;
/* Returns true if evaluator is ready for use. */

View File

@ -34,8 +34,8 @@ static eOpenSubdivEvaluator opensubdiv_evalutor_from_subdiv_evaluator_type(
case SUBDIV_EVALUATOR_TYPE_CPU: {
return OPENSUBDIV_EVALUATOR_CPU;
}
case SUBDIV_EVALUATOR_TYPE_GLSL_COMPUTE: {
return OPENSUBDIV_EVALUATOR_GLSL_COMPUTE;
case SUBDIV_EVALUATOR_TYPE_GPU: {
return OPENSUBDIV_EVALUATOR_GPU;
}
}
BLI_assert_msg(0, "Unknown evaluator type");

View File

@ -98,11 +98,6 @@ static bool is_subdivision_evaluation_possible_on_gpu(void)
return false;
}
const int available_evaluators = openSubdiv_getAvailableEvaluators();
if ((available_evaluators & OPENSUBDIV_EVALUATOR_GLSL_COMPUTE) == 0) {
return false;
}
return true;
}

View File

@ -2045,7 +2045,7 @@ static bool draw_subdiv_create_requested_buffers(Object *ob,
draw_subdiv_invalidate_evaluator_for_orco(subdiv, mesh_eval);
if (!BKE_subdiv_eval_begin_from_mesh(
subdiv, mesh_eval, nullptr, SUBDIV_EVALUATOR_TYPE_GLSL_COMPUTE, evaluator_cache)) {
subdiv, mesh_eval, nullptr, SUBDIV_EVALUATOR_TYPE_GPU, evaluator_cache)) {
/* This could happen in two situations:
* - OpenSubdiv is disabled.
* - Something totally bad happened, and OpenSubdiv rejected our
@ -2220,7 +2220,7 @@ void DRW_create_subdivision(Object *ob,
const bool use_hide)
{
if (g_evaluator_cache == nullptr) {
g_evaluator_cache = openSubdiv_createEvaluatorCache(OPENSUBDIV_EVALUATOR_GLSL_COMPUTE);
g_evaluator_cache = openSubdiv_createEvaluatorCache(OPENSUBDIV_EVALUATOR_GPU);
}
#undef TIME_SUBDIV

View File

@ -913,8 +913,7 @@ typedef struct UserDef {
/** Pie menu distance from center before a direction is set. */
short pie_menu_threshold;
short opensubdiv_compute_type;
short _pad6;
short _pad6[2];
char factor_display_type;

View File

@ -38,23 +38,6 @@
#include "BLT_lang.h"
#ifdef WITH_OPENSUBDIV
static const EnumPropertyItem opensubdiv_compute_type_items[] = {
{USER_OPENSUBDIV_COMPUTE_NONE, "NONE", 0, "None", ""},
{USER_OPENSUBDIV_COMPUTE_CPU, "CPU", 0, "CPU", ""},
{USER_OPENSUBDIV_COMPUTE_OPENMP, "OPENMP", 0, "OpenMP", ""},
{USER_OPENSUBDIV_COMPUTE_OPENCL, "OPENCL", 0, "OpenCL", ""},
{USER_OPENSUBDIV_COMPUTE_CUDA, "CUDA", 0, "CUDA", ""},
{USER_OPENSUBDIV_COMPUTE_GLSL_TRANSFORM_FEEDBACK,
"GLSL_TRANSFORM_FEEDBACK",
0,
"GLSL Transform Feedback",
""},
{USER_OPENSUBDIV_COMPUTE_GLSL_COMPUTE, "GLSL_COMPUTE", 0, "GLSL Compute", ""},
{0, NULL, 0, NULL, NULL},
};
#endif
const EnumPropertyItem rna_enum_preference_section_items[] = {
{USER_SECTION_INTERFACE, "INTERFACE", 0, "Interface", ""},
{USER_SECTION_THEME, "THEMES", 0, "Themes", ""},
@ -189,10 +172,6 @@ static const EnumPropertyItem rna_enum_userdef_viewport_aa_items[] = {
# include "UI_interface.h"
# ifdef WITH_OPENSUBDIV
# include "opensubdiv_capi.h"
# endif
# ifdef WITH_SDL_DYNLOAD
# include "sdlew.h"
# endif
@ -728,55 +707,6 @@ static PointerRNA rna_Theme_space_list_generic_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_ThemeSpaceListGeneric, ptr->data);
}
# ifdef WITH_OPENSUBDIV
static const EnumPropertyItem *rna_userdef_opensubdiv_compute_type_itemf(bContext *UNUSED(C),
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
bool *r_free)
{
EnumPropertyItem *item = NULL;
int totitem = 0;
int evaluators = openSubdiv_getAvailableEvaluators();
RNA_enum_items_add_value(
&item, &totitem, opensubdiv_compute_type_items, USER_OPENSUBDIV_COMPUTE_NONE);
# define APPEND_COMPUTE(compute) \
if (evaluators & OPENSUBDIV_EVALUATOR_##compute) { \
RNA_enum_items_add_value( \
&item, &totitem, opensubdiv_compute_type_items, USER_OPENSUBDIV_COMPUTE_##compute); \
} \
((void)0)
APPEND_COMPUTE(CPU);
APPEND_COMPUTE(OPENMP);
APPEND_COMPUTE(OPENCL);
APPEND_COMPUTE(CUDA);
APPEND_COMPUTE(GLSL_TRANSFORM_FEEDBACK);
APPEND_COMPUTE(GLSL_COMPUTE);
# undef APPEND_COMPUTE
RNA_enum_item_end(&item, &totitem);
*r_free = true;
return item;
}
static void rna_userdef_opensubdiv_update(Main *bmain,
Scene *UNUSED(scene),
PointerRNA *UNUSED(ptr))
{
Object *object;
for (object = bmain->objects.first; object; object = object->id.next) {
DEG_id_tag_update(&object->id, ID_RECALC_TRANSFORM);
}
USERDEF_TAG_DIRTY;
}
# endif
static const EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C),
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
@ -5699,17 +5629,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Audio Channels", "Audio channel count");
RNA_def_property_update(prop, 0, "rna_UserDef_audio_update");
# ifdef WITH_OPENSUBDIV
prop = RNA_def_property(srna, "opensubdiv_compute_type", PROP_ENUM, PROP_NONE);
RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT);
RNA_def_property_enum_sdna(prop, NULL, "opensubdiv_compute_type");
RNA_def_property_enum_items(prop, opensubdiv_compute_type_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_userdef_opensubdiv_compute_type_itemf");
RNA_def_property_ui_text(
prop, "OpenSubdiv Compute Type", "Type of computer back-end used with OpenSubdiv");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_PROPERTIES, "rna_userdef_opensubdiv_update");
# endif
# ifdef WITH_CYCLES
prop = RNA_def_property(srna, "legacy_compute_device_type", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "compute_device_type");