win_opengl: use persistent buffer for pixel transfer

This commit is contained in:
ts-korhonen
2021-04-29 13:47:05 +03:00
parent 1b3a870388
commit a5910189f3
4 changed files with 297 additions and 134 deletions

View File

@@ -1,22 +1,23 @@
/*
OpenGL loader generated by glad 0.1.34 on Fri Apr 9 15:21:10 2021.
OpenGL loader generated by glad 0.1.34 on Tue Apr 27 15:16:07 2021.
Language/Generator: C/C++
Specification: gl
APIs: gl=3.3
Profile: core
Extensions:
GL_ARB_buffer_storage,
GL_ARB_debug_output
Loader: True
Local files: False
Omit khrplatform: False
Reproducible: False
Commandline:
--profile="core" --api="gl=3.3" --generator="c" --spec="gl" --extensions=""
--profile="core" --api="gl=3.3" --generator="c" --spec="gl" --extensions="GL_ARB_buffer_storage,GL_ARB_debug_output"
Online:
https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.3
https://glad.dav1d.de/#profile=core&language=c&specification=gl&loader=on&api=gl%3D3.3&extensions=GL_ARB_buffer_storage&extensions=GL_ARB_debug_output
*/
#include <stdio.h>
@@ -641,6 +642,13 @@ PFNGLVERTEXP4UIPROC glad_glVertexP4ui = NULL;
PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv = NULL;
PFNGLVIEWPORTPROC glad_glViewport = NULL;
PFNGLWAITSYNCPROC glad_glWaitSync = NULL;
int GLAD_GL_ARB_buffer_storage = 0;
int GLAD_GL_ARB_debug_output = 0;
PFNGLBUFFERSTORAGEPROC glad_glBufferStorage = NULL;
PFNGLDEBUGMESSAGECONTROLARBPROC glad_glDebugMessageControlARB = NULL;
PFNGLDEBUGMESSAGEINSERTARBPROC glad_glDebugMessageInsertARB = NULL;
PFNGLDEBUGMESSAGECALLBACKARBPROC glad_glDebugMessageCallbackARB = NULL;
PFNGLGETDEBUGMESSAGELOGARBPROC glad_glGetDebugMessageLogARB = NULL;
static void load_GL_VERSION_1_0(GLADloadproc load) {
if(!GLAD_GL_VERSION_1_0) return;
glad_glCullFace = (PFNGLCULLFACEPROC)load("glCullFace");
@@ -1054,9 +1062,21 @@ static void load_GL_VERSION_3_3(GLADloadproc load) {
glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)load("glSecondaryColorP3ui");
glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)load("glSecondaryColorP3uiv");
}
static void load_GL_ARB_buffer_storage(GLADloadproc load) {
if(!GLAD_GL_ARB_buffer_storage) return;
glad_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)load("glBufferStorage");
}
static void load_GL_ARB_debug_output(GLADloadproc load) {
if(!GLAD_GL_ARB_debug_output) return;
glad_glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)load("glDebugMessageControlARB");
glad_glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)load("glDebugMessageInsertARB");
glad_glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)load("glDebugMessageCallbackARB");
glad_glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)load("glGetDebugMessageLogARB");
}
static int find_extensionsGL(void) {
if (!get_exts()) return 0;
(void)&has_ext;
GLAD_GL_ARB_buffer_storage = has_ext("GL_ARB_buffer_storage");
GLAD_GL_ARB_debug_output = has_ext("GL_ARB_debug_output");
free_exts();
return 1;
}
@@ -1135,6 +1155,8 @@ int gladLoadGLLoader(GLADloadproc load) {
load_GL_VERSION_3_3(load);
if (!find_extensionsGL()) return 0;
load_GL_ARB_buffer_storage(load);
load_GL_ARB_debug_output(load);
return GLVersion.major != 0 || GLVersion.minor != 0;
}