[Bf-blender-cvs] [6621a60e280] epoxy: OpenSubdiv: replace GLEW by libepoxy
Christian Rauch
noreply at git.blender.org
Sat Jun 25 14:06:50 CEST 2022
Commit: 6621a60e2804205a8b712f6b19a939f7a4de0c37
Author: Christian Rauch
Date: Sat Jun 25 01:56:47 2022 +0100
Branches: epoxy
https://developer.blender.org/rB6621a60e2804205a8b712f6b19a939f7a4de0c37
OpenSubdiv: replace GLEW by libepoxy
===================================================================
M intern/opensubdiv/internal/device/device_context_glsl_compute.cc
M intern/opensubdiv/internal/device/device_context_glsl_transform_feedback.cc
M intern/opensubdiv/internal/evaluator/eval_output.h
M intern/opensubdiv/internal/evaluator/gl_compute_evaluator.cc
M intern/opensubdiv/internal/evaluator/gl_compute_evaluator.h
===================================================================
diff --git a/intern/opensubdiv/internal/device/device_context_glsl_compute.cc b/intern/opensubdiv/internal/device/device_context_glsl_compute.cc
index 7b416976099..99f1ef2bf04 100644
--- a/intern/opensubdiv/internal/device/device_context_glsl_compute.cc
+++ b/intern/opensubdiv/internal/device/device_context_glsl_compute.cc
@@ -18,14 +18,14 @@
#include "internal/device/device_context_glsl_compute.h"
-#include <GL/glew.h>
+#include <epoxy/egl.h>
namespace blender {
namespace opensubdiv {
bool GLSLComputeDeviceContext::isSupported()
{
- return GLEW_VERSION_4_3 || GLEW_ARB_compute_shader;
+ return epoxy_gl_version() >= 43 || epoxy_has_gl_extension("ARB_compute_shader");
}
GLSLComputeDeviceContext::GLSLComputeDeviceContext()
diff --git a/intern/opensubdiv/internal/device/device_context_glsl_transform_feedback.cc b/intern/opensubdiv/internal/device/device_context_glsl_transform_feedback.cc
index ef897608b6e..1768da8e9d4 100644
--- a/intern/opensubdiv/internal/device/device_context_glsl_transform_feedback.cc
+++ b/intern/opensubdiv/internal/device/device_context_glsl_transform_feedback.cc
@@ -18,14 +18,14 @@
#include "internal/device/device_context_glsl_transform_feedback.h"
-#include <GL/glew.h>
+#include <epoxy/gl.h>
namespace blender {
namespace opensubdiv {
bool GLSLTransformFeedbackDeviceContext::isSupported()
{
- return GLEW_VERSION_4_1;
+ return epoxy_gl_version() >= 41;
}
GLSLTransformFeedbackDeviceContext::GLSLTransformFeedbackDeviceContext()
diff --git a/intern/opensubdiv/internal/evaluator/eval_output.h b/intern/opensubdiv/internal/evaluator/eval_output.h
index e8480e8d816..286ffaafecb 100644
--- a/intern/opensubdiv/internal/evaluator/eval_output.h
+++ b/intern/opensubdiv/internal/evaluator/eval_output.h
@@ -19,6 +19,8 @@
#ifndef OPENSUBDIV_EVAL_OUTPUT_H_
#define OPENSUBDIV_EVAL_OUTPUT_H_
+#undef OSD_USES_GLEW
+
#include <opensubdiv/osd/cpuPatchTable.h>
#include <opensubdiv/osd/glPatchTable.h>
#include <opensubdiv/osd/mesh.h>
diff --git a/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.cc b/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.cc
index c2ab2a522d2..9c0e91d63e8 100644
--- a/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.cc
+++ b/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.cc
@@ -22,9 +22,9 @@
// language governing permissions and limitations under the Apache License.
//
-#include "gl_compute_evaluator.h"
+#include <epoxy/gl.h>
-#include <GL/glew.h>
+#include "gl_compute_evaluator.h"
#include <opensubdiv/far/error.h>
#include <opensubdiv/far/patchDescriptor.h>
@@ -57,7 +57,7 @@ template<class T> GLuint createSSBO(std::vector<T> const &src)
GLuint devicePtr = 0;
#if defined(GL_ARB_direct_state_access)
- if (GLEW_ARB_direct_state_access) {
+ if (epoxy_has_gl_extension("ARB_direct_state_access")) {
glCreateBuffers(1, &devicePtr);
glNamedBufferData(devicePtr, src.size() * sizeof(T), &src.at(0), GL_STATIC_DRAW);
}
diff --git a/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.h b/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.h
index 85c12f73b08..07d13aa21bd 100644
--- a/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.h
+++ b/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.h
@@ -25,6 +25,8 @@
#ifndef OPENSUBDIV_GL_COMPUTE_EVALUATOR_H_
#define OPENSUBDIV_GL_COMPUTE_EVALUATOR_H_
+#undef OSD_USES_GLEW
+
#include <opensubdiv/osd/bufferDescriptor.h>
#include <opensubdiv/osd/opengl.h>
#include <opensubdiv/osd/types.h>
More information about the Bf-blender-cvs
mailing list