summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2013-12-30 07:44:11 -0600
committerdegasus <wickmarkus@web.de>2014-01-17 15:52:34 +0100
commitcf8865a6e5a3c7375fb10ce29ee4ce00cfdd878b (patch)
tree756af3e09fa8805d2a2e5226b0381cc18fa4acc3 /Source/Core/VideoBackends
parent71681de81a79c6508f44dfc949026ec2f51943ae (diff)
[GLExtensions] Add ARB_buffer_storage to negate at least one null pointer instance.
Diffstat (limited to 'Source/Core/VideoBackends')
-rw-r--r--Source/Core/VideoBackends/OGL/GLExtensions/ARB_buffer_storage.h27
-rw-r--r--Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp15
-rw-r--r--Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.h1
3 files changed, 43 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/ARB_buffer_storage.h b/Source/Core/VideoBackends/OGL/GLExtensions/ARB_buffer_storage.h
new file mode 100644
index 0000000000..ef224a5af7
--- /dev/null
+++ b/Source/Core/VideoBackends/OGL/GLExtensions/ARB_buffer_storage.h
@@ -0,0 +1,27 @@
+// Copyright 2013 Dolphin Emulator Project
+// Licensed under GPLv2
+// Refer to the license.txt file included.
+
+#include "gl_common.h"
+
+#ifndef GL_ARB_buffer_storage
+#define GL_ARB_buffer_storage 1
+
+#define GL_MAP_READ_BIT 0x0001
+#define GL_MAP_WRITE_BIT 0x0002
+#define GL_MAP_PERSISTENT_BIT 0x00000040
+#define GL_MAP_COHERENT_BIT 0x00000080
+#define GL_DYNAMIC_STORAGE_BIT 0x0100
+#define GL_CLIENT_STORAGE_BIT 0x0200
+#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000
+#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F
+#define GL_BUFFER_STORAGE_FLAGS 0x8220
+
+typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLbitfield flags);
+typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid* data, GLbitfield flags);
+
+#endif
+
+extern PFNGLBUFFERSTORAGEPROC glBufferStorage;
+extern PFNGLNAMEDBUFFERSTORAGEEXTPROC glNamedBufferStorageEXT;
+
diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp
index 2299e08801..7b6c9458c2 100644
--- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp
+++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.cpp
@@ -427,6 +427,10 @@ PFNGLOBJECTPTRLABELKHRPROC glObjectPtrLabelKHR;
PFNGLGETOBJECTPTRLABELKHRPROC glGetObjectPtrLabelKHR;
PFNGLGETPOINTERVKHRPROC glGetPoitnervKHR;
+// ARB_buffer_storage
+PFNGLBUFFERSTORAGEPROC glBufferStorage;
+PFNGLNAMEDBUFFERSTORAGEEXTPROC glNamedBufferStorageEXT;
+
namespace GLExtensions
{
// Private members and functions
@@ -459,6 +463,7 @@ namespace GLExtensions
bool init_arb_sample_shading();
bool init_arb_debug_output();
bool init_khr_debug();
+ bool init_arb_buffer_storage();
void InitExtensionList()
{
@@ -561,6 +566,7 @@ namespace GLExtensions
if (success && !init_arb_debug_output()) success = false;
if (success && !init_nv_framebuffer_multisample_coverage()) success = false;
if (success && !init_khr_debug()) success = false;
+ if (success && !init_arb_buffer_storage()) success = false;
#if defined(__linux__)
dlclose(_dlsym);
@@ -1115,4 +1121,13 @@ namespace GLExtensions
GrabFunction(glGetPoitnervKHR)
return true;
}
+
+ bool init_arb_buffer_storage()
+ {
+ if (!Supports("GL_ARB_buffer_storage"))
+ return true;
+ GrabFunction(glBufferStorage)
+ GrabFunction(glNamedBufferStorageEXT)
+ return true;
+ }
}
diff --git a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.h b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.h
index 58304cc158..37852c4f84 100644
--- a/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.h
+++ b/Source/Core/VideoBackends/OGL/GLExtensions/GLExtensions.h
@@ -29,6 +29,7 @@
#include "ARB_sample_shading.h"
#include "ARB_debug_output.h"
#include "KHR_debug.h"
+#include "ARB_buffer_storage.h"
namespace GLExtensions
{