mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[client] egl: dynamically import glBufferStorageEXT
On some implementations (e.g. llvmpipe), the function can only be queried via eglGetProcAddress.
This commit is contained in:
parent
5a906131eb
commit
429620c48b
@ -37,6 +37,8 @@ typedef void (*DEBUGPROC_t)(GLenum source,
|
|||||||
const GLchar *message, const void *userParam);
|
const GLchar *message, const void *userParam);
|
||||||
typedef void (*glDebugMessageCallback_t)(DEBUGPROC_t callback,
|
typedef void (*glDebugMessageCallback_t)(DEBUGPROC_t callback,
|
||||||
const void * userParam);
|
const void * userParam);
|
||||||
|
typedef void (*glBufferStorageEXT_t)(GLenum target, GLsizeiptr size,
|
||||||
|
const void * data, GLbitfield flags);
|
||||||
|
|
||||||
struct EGLDynProcs
|
struct EGLDynProcs
|
||||||
{
|
{
|
||||||
@ -47,6 +49,7 @@ struct EGLDynProcs
|
|||||||
glEGLImageTargetTexture2DOES_t glEGLImageTargetTexture2DOES;
|
glEGLImageTargetTexture2DOES_t glEGLImageTargetTexture2DOES;
|
||||||
glDebugMessageCallback_t glDebugMessageCallback;
|
glDebugMessageCallback_t glDebugMessageCallback;
|
||||||
glDebugMessageCallback_t glDebugMessageCallbackKHR;
|
glDebugMessageCallback_t glDebugMessageCallbackKHR;
|
||||||
|
glBufferStorageEXT_t glBufferStorageEXT;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct EGLDynProcs g_egl_dynProcs;
|
extern struct EGLDynProcs g_egl_dynProcs;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <GLES2/gl2ext.h>
|
#include <GLES2/gl2ext.h>
|
||||||
|
|
||||||
#include "egldebug.h"
|
#include "egldebug.h"
|
||||||
|
#include "egl_dynprocs.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the following comes from drm_fourcc.h and is included here to avoid the
|
* the following comes from drm_fourcc.h and is included here to avoid the
|
||||||
@ -108,7 +109,7 @@ bool egl_texUtilGenBuffers(const EGL_TexFormat * fmt, EGL_TexBuffer * buffers,
|
|||||||
buffer->size = fmt->bufferSize;
|
buffer->size = fmt->bufferSize;
|
||||||
glGenBuffers(1, &buffer->pbo);
|
glGenBuffers(1, &buffer->pbo);
|
||||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buffer->pbo);
|
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, buffer->pbo);
|
||||||
glBufferStorageEXT(
|
g_egl_dynProcs.glBufferStorageEXT(
|
||||||
GL_PIXEL_UNPACK_BUFFER,
|
GL_PIXEL_UNPACK_BUFFER,
|
||||||
fmt->bufferSize,
|
fmt->bufferSize,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -40,6 +40,8 @@ void egl_dynProcsInit(void)
|
|||||||
eglGetProcAddress("glDebugMessageCallback");
|
eglGetProcAddress("glDebugMessageCallback");
|
||||||
g_egl_dynProcs.glDebugMessageCallbackKHR = (glDebugMessageCallback_t)
|
g_egl_dynProcs.glDebugMessageCallbackKHR = (glDebugMessageCallback_t)
|
||||||
eglGetProcAddress("glDebugMessageCallbackKHR");
|
eglGetProcAddress("glDebugMessageCallbackKHR");
|
||||||
|
g_egl_dynProcs.glBufferStorageEXT = (glBufferStorageEXT_t)
|
||||||
|
eglGetProcAddress("glBufferStorageEXT");
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user