Merge pull request #459 from mp3butcher/bufferstorage

add more extensions
This commit is contained in:
OpenSceneGraph git repository
2018-01-27 09:20:12 +00:00
committed by GitHub
2 changed files with 10 additions and 6 deletions

View File

@@ -386,6 +386,8 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
void (GL_APIENTRY * glDeleteBuffers) (GLsizei n, const GLuint *buffers);
GLboolean (GL_APIENTRY * glIsBuffer) (GLuint buffer);
void (GL_APIENTRY * glGetBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data);
GLvoid* (GL_APIENTRY * glBufferStorage) (GLenum target, GLintptr size, const GLvoid * data, GLbitfield flags);
GLvoid* (GL_APIENTRY * glNamedBufferStorage) (GLuint buffer, GLsizei size, const void * data, GLbitfield flags);
GLvoid* (GL_APIENTRY * glMapBuffer) (GLenum target, GLenum access);
GLvoid* (GL_APIENTRY * glMapBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
GLboolean (GL_APIENTRY * glUnmapBuffer) (GLenum target);

View File

@@ -722,6 +722,8 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
setGLExtensionFuncPtr(glDeleteBuffers, "glDeleteBuffers","glDeleteBuffersARB", validContext);
setGLExtensionFuncPtr(glIsBuffer, "glIsBuffer","glIsBufferARB", validContext);
setGLExtensionFuncPtr(glGetBufferSubData, "glGetBufferSubData","glGetBufferSubDataARB", validContext);
setGLExtensionFuncPtr(glBufferStorage, "glBufferStorage","glBufferStorageARB", validContext);
setGLExtensionFuncPtr(glNamedBufferStorage, "glNamedBufferStorage","glNamedBufferStorageARB", validContext);
setGLExtensionFuncPtr(glMapBuffer, "glMapBuffer","glMapBufferARB", validContext);
setGLExtensionFuncPtr(glMapBufferRange, "glMapBufferRange", "glMapBufferRangeARB" , validContext);
setGLExtensionFuncPtr(glUnmapBuffer, "glUnmapBuffer","glUnmapBufferARB", validContext);
@@ -869,18 +871,18 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
isTextureCompressionRGTCSupported = validContext && isGLExtensionSupported(contextID,"GL_EXT_texture_compression_rgtc");
isTextureCompressionPVRTCSupported = validContext && isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc");
isTextureMirroredRepeatSupported = validContext &&
isTextureMirroredRepeatSupported = validContext &&
(builtInSupport ||
isGLExtensionOrVersionSupported(contextID,"GL_IBM_texture_mirrored_repeat", 1.4f) ||
isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_mirrored_repeat", 1.4f));
isTextureEdgeClampSupported = validContext &&
isTextureEdgeClampSupported = validContext &&
(builtInSupport ||
isGLExtensionOrVersionSupported(contextID,"GL_EXT_texture_edge_clamp", 1.2f) ||
isGLExtensionOrVersionSupported(contextID,"GL_SGIS_texture_edge_clamp", 1.2f));
isTextureBorderClampSupported = validContext &&
isTextureBorderClampSupported = validContext &&
(OSG_GL3_FEATURES ||
((OSG_GL1_FEATURES || OSG_GL2_FEATURES) && isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_border_clamp", 1.3f)) ||
((OSG_GLES2_FEATURES || OSG_GLES3_FEATURES) && isGLExtensionSupported(contextID,"GL_EXT_texture_border_clamp")));
@@ -975,7 +977,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
setGLExtensionFuncPtr(glIsTextureHandleResident, "glIsTextureHandleResident","glIsTextureHandleResidentARB", "glIsTextureHandleResidentNV", validContext);
// Blending
isBlendColorSupported = validContext &&
isBlendColorSupported = validContext &&
(OSG_GLES2_FEATURES || OSG_GLES3_FEATURES || OSG_GL3_FEATURES ||
isGLExtensionSupported(contextID,"GL_EXT_blend_color") ||
(glVersion >= 1.2f));
@@ -983,13 +985,13 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
setGLExtensionFuncPtr(glBlendColor, "glBlendColor", "glBlendColorEXT", validContext);
bool bultInSupport = OSG_GLES2_FEATURES || OSG_GLES3_FEATURES || OSG_GL3_FEATURES;
isBlendEquationSupported = validContext &&
isBlendEquationSupported = validContext &&
(bultInSupport ||
isGLExtensionSupported(contextID, "GL_EXT_blend_equation") ||
(glVersion >= 1.2f));
isBlendEquationSeparateSupported = validContext &&
isBlendEquationSeparateSupported = validContext &&
(bultInSupport ||
isGLExtensionSupported(contextID, "GL_EXT_blend_equation_separate") ||
(glVersion >= 2.0f));