mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: use the standard openGL name
Function pointer was mangled to avoid any collision. Nowadays all symbols are hidden so no risk of collision. Syntax is nicer beside it would allow to put back GLES3.2. I think it supports most of the used extension. glActiveTexture & glBlendColor are provided without symbol query.
This commit is contained in:
parent
1c8f8a00b8
commit
0958b9db8e
|
@ -22,135 +22,133 @@
|
|||
#include "GLLoader.h"
|
||||
#include "GSdx.h"
|
||||
|
||||
PFNGLACTIVETEXTUREPROC gl_ActiveTexture = NULL;
|
||||
PFNGLBLENDCOLORPROC gl_BlendColor = NULL;
|
||||
PFNGLATTACHSHADERPROC gl_AttachShader = NULL;
|
||||
PFNGLBINDBUFFERPROC gl_BindBuffer = NULL;
|
||||
PFNGLBINDBUFFERBASEPROC gl_BindBufferBase = NULL;
|
||||
PFNGLBINDBUFFERRANGEPROC gl_BindBufferRange = NULL;
|
||||
PFNGLBINDFRAMEBUFFERPROC gl_BindFramebuffer = NULL;
|
||||
PFNGLBINDSAMPLERPROC gl_BindSampler = NULL;
|
||||
PFNGLBINDVERTEXARRAYPROC gl_BindVertexArray = NULL;
|
||||
PFNGLBLENDEQUATIONSEPARATEIARBPROC gl_BlendEquationSeparateiARB = NULL;
|
||||
PFNGLBLENDFUNCSEPARATEIARBPROC gl_BlendFuncSeparateiARB = NULL;
|
||||
PFNGLBLITFRAMEBUFFERPROC gl_BlitFramebuffer = NULL;
|
||||
PFNGLBUFFERDATAPROC gl_BufferData = NULL;
|
||||
PFNGLCHECKFRAMEBUFFERSTATUSPROC gl_CheckFramebufferStatus = NULL;
|
||||
PFNGLCLEARBUFFERFVPROC gl_ClearBufferfv = NULL;
|
||||
PFNGLCLEARBUFFERIVPROC gl_ClearBufferiv = NULL;
|
||||
PFNGLCLEARBUFFERUIVPROC gl_ClearBufferuiv = NULL;
|
||||
PFNGLCOLORMASKIPROC gl_ColorMaski = NULL;
|
||||
PFNGLCOMPILESHADERPROC gl_CompileShader = NULL;
|
||||
PFNGLCREATEPROGRAMPROC gl_CreateProgram = NULL;
|
||||
PFNGLCREATESHADERPROC gl_CreateShader = NULL;
|
||||
PFNGLCREATESHADERPROGRAMVPROC gl_CreateShaderProgramv = NULL;
|
||||
PFNGLDELETEBUFFERSPROC gl_DeleteBuffers = NULL;
|
||||
PFNGLDELETEFRAMEBUFFERSPROC gl_DeleteFramebuffers = NULL;
|
||||
PFNGLDELETEPROGRAMPROC gl_DeleteProgram = NULL;
|
||||
PFNGLDELETESAMPLERSPROC gl_DeleteSamplers = NULL;
|
||||
PFNGLDELETESHADERPROC gl_DeleteShader = NULL;
|
||||
PFNGLDELETEVERTEXARRAYSPROC gl_DeleteVertexArrays = NULL;
|
||||
PFNGLDETACHSHADERPROC gl_DetachShader = NULL;
|
||||
PFNGLDRAWBUFFERSPROC gl_DrawBuffers = NULL;
|
||||
PFNGLDRAWELEMENTSBASEVERTEXPROC gl_DrawElementsBaseVertex = NULL;
|
||||
PFNGLENABLEVERTEXATTRIBARRAYPROC gl_EnableVertexAttribArray = NULL;
|
||||
PFNGLFRAMEBUFFERRENDERBUFFERPROC gl_FramebufferRenderbuffer = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURE2DPROC gl_FramebufferTexture2D = NULL;
|
||||
PFNGLGENBUFFERSPROC gl_GenBuffers = NULL;
|
||||
PFNGLGENFRAMEBUFFERSPROC gl_GenFramebuffers = NULL;
|
||||
PFNGLGENSAMPLERSPROC gl_GenSamplers = NULL;
|
||||
PFNGLGENVERTEXARRAYSPROC gl_GenVertexArrays = NULL;
|
||||
PFNGLGETBUFFERPARAMETERIVPROC gl_GetBufferParameteriv = NULL;
|
||||
PFNGLGETDEBUGMESSAGELOGARBPROC gl_GetDebugMessageLogARB = NULL;
|
||||
PFNGLDEBUGMESSAGECALLBACKPROC gl_DebugMessageCallback = NULL;
|
||||
PFNGLGETPROGRAMINFOLOGPROC gl_GetProgramInfoLog = NULL;
|
||||
PFNGLGETPROGRAMIVPROC gl_GetProgramiv = NULL;
|
||||
PFNGLGETSHADERIVPROC gl_GetShaderiv = NULL;
|
||||
PFNGLGETSTRINGIPROC gl_GetStringi = NULL;
|
||||
PFNGLISFRAMEBUFFERPROC gl_IsFramebuffer = NULL;
|
||||
PFNGLLINKPROGRAMPROC gl_LinkProgram = NULL;
|
||||
PFNGLMAPBUFFERPROC gl_MapBuffer = NULL;
|
||||
PFNGLMAPBUFFERRANGEPROC gl_MapBufferRange = NULL;
|
||||
PFNGLPROGRAMPARAMETERIPROC gl_ProgramParameteri = NULL;
|
||||
PFNGLSAMPLERPARAMETERFPROC gl_SamplerParameterf = NULL;
|
||||
PFNGLSAMPLERPARAMETERIPROC gl_SamplerParameteri = NULL;
|
||||
PFNGLSHADERSOURCEPROC gl_ShaderSource = NULL;
|
||||
PFNGLUNIFORM1IPROC gl_Uniform1i = NULL;
|
||||
PFNGLUNMAPBUFFERPROC gl_UnmapBuffer = NULL;
|
||||
PFNGLUSEPROGRAMSTAGESPROC gl_UseProgramStages = NULL;
|
||||
PFNGLVERTEXATTRIBIPOINTERPROC gl_VertexAttribIPointer = NULL;
|
||||
PFNGLVERTEXATTRIBPOINTERPROC gl_VertexAttribPointer = NULL;
|
||||
PFNGLBUFFERSUBDATAPROC gl_BufferSubData = NULL;
|
||||
PFNGLFENCESYNCPROC gl_FenceSync = NULL;
|
||||
PFNGLDELETESYNCPROC gl_DeleteSync = NULL;
|
||||
PFNGLCLIENTWAITSYNCPROC gl_ClientWaitSync = NULL;
|
||||
PFNGLFLUSHMAPPEDBUFFERRANGEPROC gl_FlushMappedBufferRange = NULL;
|
||||
PFNGLBLENDEQUATIONSEPARATEPROC gl_BlendEquationSeparate = NULL;
|
||||
PFNGLBLENDFUNCSEPARATEPROC gl_BlendFuncSeparate = NULL;
|
||||
PFNGLATTACHSHADERPROC glAttachShader = NULL;
|
||||
PFNGLBINDBUFFERPROC glBindBuffer = NULL;
|
||||
PFNGLBINDBUFFERBASEPROC glBindBufferBase = NULL;
|
||||
PFNGLBINDBUFFERRANGEPROC glBindBufferRange = NULL;
|
||||
PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer = NULL;
|
||||
PFNGLBINDSAMPLERPROC glBindSampler = NULL;
|
||||
PFNGLBINDVERTEXARRAYPROC glBindVertexArray = NULL;
|
||||
PFNGLBLENDEQUATIONSEPARATEIARBPROC glBlendEquationSeparateiARB = NULL;
|
||||
PFNGLBLENDFUNCSEPARATEIARBPROC glBlendFuncSeparateiARB = NULL;
|
||||
PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer = NULL;
|
||||
PFNGLBUFFERDATAPROC glBufferData = NULL;
|
||||
PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus = NULL;
|
||||
PFNGLCLEARBUFFERFVPROC glClearBufferfv = NULL;
|
||||
PFNGLCLEARBUFFERIVPROC glClearBufferiv = NULL;
|
||||
PFNGLCLEARBUFFERUIVPROC glClearBufferuiv = NULL;
|
||||
PFNGLCOLORMASKIPROC glColorMaski = NULL;
|
||||
PFNGLCOMPILESHADERPROC glCompileShader = NULL;
|
||||
PFNGLCREATEPROGRAMPROC glCreateProgram = NULL;
|
||||
PFNGLCREATESHADERPROC glCreateShader = NULL;
|
||||
PFNGLCREATESHADERPROGRAMVPROC glCreateShaderProgramv = NULL;
|
||||
PFNGLDELETEBUFFERSPROC glDeleteBuffers = NULL;
|
||||
PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers = NULL;
|
||||
PFNGLDELETEPROGRAMPROC glDeleteProgram = NULL;
|
||||
PFNGLDELETESAMPLERSPROC glDeleteSamplers = NULL;
|
||||
PFNGLDELETESHADERPROC glDeleteShader = NULL;
|
||||
PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays = NULL;
|
||||
PFNGLDETACHSHADERPROC glDetachShader = NULL;
|
||||
PFNGLDRAWBUFFERSPROC glDrawBuffers = NULL;
|
||||
PFNGLDRAWELEMENTSBASEVERTEXPROC glDrawElementsBaseVertex = NULL;
|
||||
PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray = NULL;
|
||||
PFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer = NULL;
|
||||
PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D = NULL;
|
||||
PFNGLGENBUFFERSPROC glGenBuffers = NULL;
|
||||
PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers = NULL;
|
||||
PFNGLGENSAMPLERSPROC glGenSamplers = NULL;
|
||||
PFNGLGENVERTEXARRAYSPROC glGenVertexArrays = NULL;
|
||||
PFNGLGETBUFFERPARAMETERIVPROC glGetBufferParameteriv = NULL;
|
||||
PFNGLGETDEBUGMESSAGELOGARBPROC glGetDebugMessageLogARB = NULL;
|
||||
PFNGLDEBUGMESSAGECALLBACKPROC glDebugMessageCallback = NULL;
|
||||
PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog = NULL;
|
||||
PFNGLGETPROGRAMIVPROC glGetProgramiv = NULL;
|
||||
PFNGLGETSHADERIVPROC glGetShaderiv = NULL;
|
||||
PFNGLGETSTRINGIPROC glGetStringi = NULL;
|
||||
PFNGLISFRAMEBUFFERPROC glIsFramebuffer = NULL;
|
||||
PFNGLLINKPROGRAMPROC glLinkProgram = NULL;
|
||||
PFNGLMAPBUFFERPROC glMapBuffer = NULL;
|
||||
PFNGLMAPBUFFERRANGEPROC glMapBufferRange = NULL;
|
||||
PFNGLPROGRAMPARAMETERIPROC glProgramParameteri = NULL;
|
||||
PFNGLSAMPLERPARAMETERFPROC glSamplerParameterf = NULL;
|
||||
PFNGLSAMPLERPARAMETERIPROC glSamplerParameteri = NULL;
|
||||
PFNGLSHADERSOURCEPROC glShaderSource = NULL;
|
||||
PFNGLUNIFORM1IPROC glUniform1i = NULL;
|
||||
PFNGLUNMAPBUFFERPROC glUnmapBuffer = NULL;
|
||||
PFNGLUSEPROGRAMSTAGESPROC glUseProgramStages = NULL;
|
||||
PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer = NULL;
|
||||
PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer = NULL;
|
||||
PFNGLBUFFERSUBDATAPROC glBufferSubData = NULL;
|
||||
PFNGLFENCESYNCPROC glFenceSync = NULL;
|
||||
PFNGLDELETESYNCPROC glDeleteSync = NULL;
|
||||
PFNGLCLIENTWAITSYNCPROC glClientWaitSync = NULL;
|
||||
PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange = NULL;
|
||||
PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate = NULL;
|
||||
PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate = NULL;
|
||||
// GL4.0
|
||||
// GL4.1
|
||||
PFNGLBINDPROGRAMPIPELINEPROC gl_BindProgramPipeline = NULL;
|
||||
PFNGLGENPROGRAMPIPELINESPROC gl_GenProgramPipelines = NULL;
|
||||
PFNGLDELETEPROGRAMPIPELINESPROC gl_DeleteProgramPipelines = NULL;
|
||||
PFNGLGETPROGRAMPIPELINEIVPROC gl_GetProgramPipelineiv = NULL;
|
||||
PFNGLVALIDATEPROGRAMPIPELINEPROC gl_ValidateProgramPipeline = NULL;
|
||||
PFNGLGETPROGRAMPIPELINEINFOLOGPROC gl_GetProgramPipelineInfoLog = NULL;
|
||||
PFNGLGETPROGRAMBINARYPROC gl_GetProgramBinary = NULL;
|
||||
PFNGLBINDPROGRAMPIPELINEPROC glBindProgramPipeline = NULL;
|
||||
PFNGLGENPROGRAMPIPELINESPROC glGenProgramPipelines = NULL;
|
||||
PFNGLDELETEPROGRAMPIPELINESPROC glDeleteProgramPipelines = NULL;
|
||||
PFNGLGETPROGRAMPIPELINEIVPROC glGetProgramPipelineiv = NULL;
|
||||
PFNGLVALIDATEPROGRAMPIPELINEPROC glValidateProgramPipeline = NULL;
|
||||
PFNGLGETPROGRAMPIPELINEINFOLOGPROC glGetProgramPipelineInfoLog = NULL;
|
||||
PFNGLGETPROGRAMBINARYPROC glGetProgramBinary = NULL;
|
||||
// NO GL4.1
|
||||
PFNGLUSEPROGRAMPROC gl_UseProgram = NULL;
|
||||
PFNGLGETSHADERINFOLOGPROC gl_GetShaderInfoLog = NULL;
|
||||
PFNGLPROGRAMUNIFORM1IPROC gl_ProgramUniform1i = NULL;
|
||||
PFNGLUSEPROGRAMPROC glUseProgram = NULL;
|
||||
PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog = NULL;
|
||||
PFNGLPROGRAMUNIFORM1IPROC glProgramUniform1i = NULL;
|
||||
// GL4.3
|
||||
PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData = NULL;
|
||||
PFNGLINVALIDATETEXIMAGEPROC gl_InvalidateTexImage = NULL;
|
||||
PFNGLPUSHDEBUGGROUPPROC gl_PushDebugGroup = NULL;
|
||||
PFNGLPOPDEBUGGROUPPROC gl_PopDebugGroup = NULL;
|
||||
PFNGLDEBUGMESSAGEINSERTPROC gl_DebugMessageInsert = NULL;
|
||||
PFNGLCOPYIMAGESUBDATAPROC glCopyImageSubData = NULL;
|
||||
PFNGLINVALIDATETEXIMAGEPROC glInvalidateTexImage = NULL;
|
||||
PFNGLPUSHDEBUGGROUPPROC glPushDebugGroup = NULL;
|
||||
PFNGLPOPDEBUGGROUPPROC glPopDebugGroup = NULL;
|
||||
PFNGLDEBUGMESSAGEINSERTPROC glDebugMessageInsert = NULL;
|
||||
// GL4.2
|
||||
PFNGLBINDIMAGETEXTUREPROC gl_BindImageTexture = NULL;
|
||||
PFNGLMEMORYBARRIERPROC gl_MemoryBarrier = NULL;
|
||||
PFNGLTEXSTORAGE2DPROC gl_TexStorage2D = NULL;
|
||||
PFNGLBINDIMAGETEXTUREPROC glBindImageTexture = NULL;
|
||||
PFNGLMEMORYBARRIERPROC glMemoryBarrier = NULL;
|
||||
PFNGLTEXSTORAGE2DPROC glTexStorage2D = NULL;
|
||||
// GL4.4
|
||||
PFNGLCLEARTEXIMAGEPROC gl_ClearTexImage = NULL;
|
||||
PFNGLBUFFERSTORAGEPROC gl_BufferStorage = NULL;
|
||||
PFNGLCLEARTEXIMAGEPROC glClearTexImage = NULL;
|
||||
PFNGLBUFFERSTORAGEPROC glBufferStorage = NULL;
|
||||
|
||||
// GL4.5
|
||||
PFNGLCREATETEXTURESPROC gl_CreateTextures = NULL;
|
||||
PFNGLTEXTURESTORAGE2DPROC gl_TextureStorage2D = NULL;
|
||||
PFNGLTEXTURESUBIMAGE2DPROC gl_TextureSubImage2D = NULL;
|
||||
PFNGLCOPYTEXTURESUBIMAGE2DPROC gl_CopyTextureSubImage2D = NULL;
|
||||
PFNGLBINDTEXTUREUNITPROC gl_BindTextureUnit = NULL;
|
||||
PFNGLGETTEXTUREIMAGEPROC gl_GetTextureImage = NULL;
|
||||
PFNGLTEXTUREPARAMETERIPROC gl_TextureParameteri = NULL;
|
||||
PFNGLCREATETEXTURESPROC glCreateTextures = NULL;
|
||||
PFNGLTEXTURESTORAGE2DPROC glTextureStorage2D = NULL;
|
||||
PFNGLTEXTURESUBIMAGE2DPROC glTextureSubImage2D = NULL;
|
||||
PFNGLCOPYTEXTURESUBIMAGE2DPROC glCopyTextureSubImage2D = NULL;
|
||||
PFNGLBINDTEXTUREUNITPROC glBindTextureUnit = NULL;
|
||||
PFNGLGETTEXTUREIMAGEPROC glGetTextureImage = NULL;
|
||||
PFNGLTEXTUREPARAMETERIPROC glTextureParameteri = NULL;
|
||||
|
||||
PFNGLCREATEFRAMEBUFFERSPROC gl_CreateFramebuffers = NULL;
|
||||
PFNGLCLEARNAMEDFRAMEBUFFERFVPROC gl_ClearNamedFramebufferfv = NULL;
|
||||
PFNGLCLEARNAMEDFRAMEBUFFERIVPROC gl_ClearNamedFramebufferiv = NULL;
|
||||
PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC gl_ClearNamedFramebufferuiv = NULL;
|
||||
PFNGLNAMEDFRAMEBUFFERTEXTUREPROC gl_NamedFramebufferTexture = NULL;
|
||||
PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC gl_NamedFramebufferDrawBuffers = NULL;
|
||||
PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC gl_NamedFramebufferReadBuffer = NULL;
|
||||
PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC gl_CheckNamedFramebufferStatus = NULL;
|
||||
PFNGLCREATEFRAMEBUFFERSPROC glCreateFramebuffers = NULL;
|
||||
PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glClearNamedFramebufferfv = NULL;
|
||||
PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glClearNamedFramebufferiv = NULL;
|
||||
PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glClearNamedFramebufferuiv = NULL;
|
||||
PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glNamedFramebufferTexture = NULL;
|
||||
PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glNamedFramebufferDrawBuffers = NULL;
|
||||
PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glNamedFramebufferReadBuffer = NULL;
|
||||
PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glCheckNamedFramebufferStatus = NULL;
|
||||
|
||||
PFNGLCREATEBUFFERSPROC gl_CreateBuffers = NULL;
|
||||
PFNGLNAMEDBUFFERSTORAGEPROC gl_NamedBufferStorage = NULL;
|
||||
PFNGLNAMEDBUFFERDATAPROC gl_NamedBufferData = NULL;
|
||||
PFNGLNAMEDBUFFERSUBDATAPROC gl_NamedBufferSubData = NULL;
|
||||
PFNGLMAPNAMEDBUFFERPROC gl_MapNamedBuffer = NULL;
|
||||
PFNGLMAPNAMEDBUFFERRANGEPROC gl_MapNamedBufferRange = NULL;
|
||||
PFNGLUNMAPNAMEDBUFFERPROC gl_UnmapNamedBuffer = NULL;
|
||||
PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC gl_FlushMappedNamedBufferRange = NULL;
|
||||
PFNGLCREATEBUFFERSPROC glCreateBuffers = NULL;
|
||||
PFNGLNAMEDBUFFERSTORAGEPROC glNamedBufferStorage = NULL;
|
||||
PFNGLNAMEDBUFFERDATAPROC glNamedBufferData = NULL;
|
||||
PFNGLNAMEDBUFFERSUBDATAPROC glNamedBufferSubData = NULL;
|
||||
PFNGLMAPNAMEDBUFFERPROC glMapNamedBuffer = NULL;
|
||||
PFNGLMAPNAMEDBUFFERRANGEPROC glMapNamedBufferRange = NULL;
|
||||
PFNGLUNMAPNAMEDBUFFERPROC glUnmapNamedBuffer = NULL;
|
||||
PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glFlushMappedNamedBufferRange = NULL;
|
||||
|
||||
PFNGLCREATESAMPLERSPROC gl_CreateSamplers = NULL;
|
||||
PFNGLCREATEPROGRAMPIPELINESPROC gl_CreateProgramPipelines = NULL;
|
||||
PFNGLCREATESAMPLERSPROC glCreateSamplers = NULL;
|
||||
PFNGLCREATEPROGRAMPIPELINESPROC glCreateProgramPipelines = NULL;
|
||||
|
||||
PFNGLCLIPCONTROLPROC gl_ClipControl = NULL;
|
||||
PFNGLTEXTUREBARRIERPROC gl_TextureBarrier = NULL;
|
||||
PFNGLCLIPCONTROLPROC glClipControl = NULL;
|
||||
PFNGLTEXTUREBARRIERPROC glTextureBarrier = NULL;
|
||||
|
||||
namespace Emulate_DSA {
|
||||
// Texture entry point
|
||||
void APIENTRY BindTextureUnit(GLuint unit, GLuint texture) {
|
||||
gl_ActiveTexture(GL_TEXTURE0 + unit);
|
||||
glActiveTexture(GL_TEXTURE0 + unit);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
}
|
||||
|
||||
|
@ -160,7 +158,7 @@ namespace Emulate_DSA {
|
|||
|
||||
void APIENTRY TextureStorage(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) {
|
||||
BindTextureUnit(7, texture);
|
||||
gl_TexStorage2D(GL_TEXTURE_2D, levels, internalformat, width, height);
|
||||
glTexStorage2D(GL_TEXTURE_2D, levels, internalformat, width, height);
|
||||
}
|
||||
|
||||
void APIENTRY TextureSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels) {
|
||||
|
@ -190,43 +188,43 @@ namespace Emulate_DSA {
|
|||
}
|
||||
|
||||
void APIENTRY CreateFramebuffers(GLsizei n, GLuint *framebuffers) {
|
||||
gl_GenFramebuffers(n, framebuffers);
|
||||
glGenFramebuffers(n, framebuffers);
|
||||
}
|
||||
|
||||
void APIENTRY ClearNamedFramebufferfv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value) {
|
||||
gl_BindFramebuffer(fb_target, framebuffer);
|
||||
gl_ClearBufferfv(buffer, drawbuffer, value);
|
||||
glBindFramebuffer(fb_target, framebuffer);
|
||||
glClearBufferfv(buffer, drawbuffer, value);
|
||||
}
|
||||
|
||||
void APIENTRY ClearNamedFramebufferiv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value) {
|
||||
gl_BindFramebuffer(fb_target, framebuffer);
|
||||
gl_ClearBufferiv(buffer, drawbuffer, value);
|
||||
glBindFramebuffer(fb_target, framebuffer);
|
||||
glClearBufferiv(buffer, drawbuffer, value);
|
||||
}
|
||||
|
||||
void APIENTRY ClearNamedFramebufferuiv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value) {
|
||||
gl_BindFramebuffer(fb_target, framebuffer);
|
||||
gl_ClearBufferuiv(buffer, drawbuffer, value);
|
||||
glBindFramebuffer(fb_target, framebuffer);
|
||||
glClearBufferuiv(buffer, drawbuffer, value);
|
||||
}
|
||||
|
||||
void APIENTRY NamedFramebufferTexture(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) {
|
||||
gl_BindFramebuffer(fb_target, framebuffer);
|
||||
gl_FramebufferTexture2D(fb_target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
glBindFramebuffer(fb_target, framebuffer);
|
||||
glFramebufferTexture2D(fb_target, attachment, GL_TEXTURE_2D, texture, level);
|
||||
}
|
||||
|
||||
void APIENTRY NamedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n, const GLenum *bufs) {
|
||||
gl_BindFramebuffer(fb_target, framebuffer);
|
||||
gl_DrawBuffers(n, bufs);
|
||||
glBindFramebuffer(fb_target, framebuffer);
|
||||
glDrawBuffers(n, bufs);
|
||||
}
|
||||
|
||||
void APIENTRY NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src) {
|
||||
gl_BindFramebuffer(fb_target, framebuffer);
|
||||
glBindFramebuffer(fb_target, framebuffer);
|
||||
glReadBuffer(src);
|
||||
gl_BindFramebuffer(fb_target, 0);
|
||||
glBindFramebuffer(fb_target, 0);
|
||||
}
|
||||
|
||||
GLenum APIENTRY CheckNamedFramebufferStatus(GLuint framebuffer, GLenum target) {
|
||||
gl_BindFramebuffer(fb_target, framebuffer);
|
||||
return gl_CheckFramebufferStatus(fb_target);
|
||||
glBindFramebuffer(fb_target, framebuffer);
|
||||
return glCheckFramebufferStatus(fb_target);
|
||||
}
|
||||
|
||||
// Buffer entry point
|
||||
|
@ -236,84 +234,84 @@ namespace Emulate_DSA {
|
|||
}
|
||||
|
||||
void APIENTRY CreateBuffers(GLsizei n, GLuint *buffers) {
|
||||
gl_GenBuffers(1, buffers);
|
||||
glGenBuffers(1, buffers);
|
||||
}
|
||||
|
||||
void APIENTRY NamedBufferStorage(GLuint buffer, GLsizei size, const void *data, GLbitfield flags) {
|
||||
gl_BindBuffer(buffer_target, buffer);
|
||||
gl_BufferStorage(buffer_target, size, data, flags);
|
||||
glBindBuffer(buffer_target, buffer);
|
||||
glBufferStorage(buffer_target, size, data, flags);
|
||||
}
|
||||
|
||||
void APIENTRY NamedBufferData(GLuint buffer, GLsizei size, const void *data, GLenum usage) {
|
||||
gl_BindBuffer(buffer_target, buffer);
|
||||
gl_BufferData(buffer_target, size, data, usage);
|
||||
glBindBuffer(buffer_target, buffer);
|
||||
glBufferData(buffer_target, size, data, usage);
|
||||
}
|
||||
|
||||
void APIENTRY NamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, const void *data) {
|
||||
gl_BindBuffer(buffer_target, buffer);
|
||||
gl_BufferSubData(buffer_target, offset, size, data);
|
||||
glBindBuffer(buffer_target, buffer);
|
||||
glBufferSubData(buffer_target, offset, size, data);
|
||||
}
|
||||
|
||||
void *APIENTRY MapNamedBuffer(GLuint buffer, GLenum access) {
|
||||
gl_BindBuffer(buffer_target, buffer);
|
||||
return gl_MapBuffer(buffer_target, access);
|
||||
glBindBuffer(buffer_target, buffer);
|
||||
return glMapBuffer(buffer_target, access);
|
||||
}
|
||||
|
||||
void *APIENTRY MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access) {
|
||||
gl_BindBuffer(buffer_target, buffer);
|
||||
return gl_MapBufferRange(buffer_target, offset, length, access);
|
||||
glBindBuffer(buffer_target, buffer);
|
||||
return glMapBufferRange(buffer_target, offset, length, access);
|
||||
}
|
||||
|
||||
GLboolean APIENTRY UnmapNamedBuffer(GLuint buffer) {
|
||||
gl_BindBuffer(buffer_target, buffer);
|
||||
return gl_UnmapBuffer(buffer_target);
|
||||
glBindBuffer(buffer_target, buffer);
|
||||
return glUnmapBuffer(buffer_target);
|
||||
}
|
||||
|
||||
void APIENTRY FlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length) {
|
||||
gl_BindBuffer(buffer_target, buffer);
|
||||
gl_FlushMappedBufferRange(buffer_target, offset, length);
|
||||
glBindBuffer(buffer_target, buffer);
|
||||
glFlushMappedBufferRange(buffer_target, offset, length);
|
||||
}
|
||||
|
||||
// Misc entry point
|
||||
// (only purpose is to have a consistent API otherwise it is useless)
|
||||
void APIENTRY CreateProgramPipelines(GLsizei n, GLuint *pipelines) {
|
||||
gl_GenProgramPipelines(n, pipelines);
|
||||
glGenProgramPipelines(n, pipelines);
|
||||
}
|
||||
|
||||
void APIENTRY CreateSamplers(GLsizei n, GLuint *samplers) {
|
||||
gl_GenSamplers(n, samplers);
|
||||
glGenSamplers(n, samplers);
|
||||
}
|
||||
|
||||
// Replace function pointer to emulate DSA behavior
|
||||
void Init() {
|
||||
fprintf(stderr, "DSA is not supported. Replacing the GL function pointer to emulate it\n");
|
||||
gl_BindTextureUnit = BindTextureUnit;
|
||||
gl_CreateTextures = CreateTexture;
|
||||
gl_TextureStorage2D = TextureStorage;
|
||||
gl_TextureSubImage2D = TextureSubImage;
|
||||
gl_CopyTextureSubImage2D = CopyTextureSubImage;
|
||||
gl_GetTextureImage = GetTexureImage;
|
||||
gl_TextureParameteri = TextureParameteri;
|
||||
glBindTextureUnit = BindTextureUnit;
|
||||
glCreateTextures = CreateTexture;
|
||||
glTextureStorage2D = TextureStorage;
|
||||
glTextureSubImage2D = TextureSubImage;
|
||||
glCopyTextureSubImage2D = CopyTextureSubImage;
|
||||
glGetTextureImage = GetTexureImage;
|
||||
glTextureParameteri = TextureParameteri;
|
||||
|
||||
gl_CreateFramebuffers = CreateFramebuffers;
|
||||
gl_ClearNamedFramebufferfv = ClearNamedFramebufferfv;
|
||||
gl_ClearNamedFramebufferiv = ClearNamedFramebufferiv;
|
||||
gl_ClearNamedFramebufferuiv = ClearNamedFramebufferuiv;
|
||||
gl_NamedFramebufferDrawBuffers = NamedFramebufferDrawBuffers;
|
||||
gl_NamedFramebufferReadBuffer = NamedFramebufferReadBuffer;
|
||||
gl_CheckNamedFramebufferStatus = CheckNamedFramebufferStatus;
|
||||
glCreateFramebuffers = CreateFramebuffers;
|
||||
glClearNamedFramebufferfv = ClearNamedFramebufferfv;
|
||||
glClearNamedFramebufferiv = ClearNamedFramebufferiv;
|
||||
glClearNamedFramebufferuiv = ClearNamedFramebufferuiv;
|
||||
glNamedFramebufferDrawBuffers = NamedFramebufferDrawBuffers;
|
||||
glNamedFramebufferReadBuffer = NamedFramebufferReadBuffer;
|
||||
glCheckNamedFramebufferStatus = CheckNamedFramebufferStatus;
|
||||
|
||||
gl_CreateBuffers = CreateBuffers;
|
||||
gl_NamedBufferStorage = NamedBufferStorage;
|
||||
gl_NamedBufferData = NamedBufferData;
|
||||
gl_NamedBufferSubData = NamedBufferSubData;
|
||||
gl_MapNamedBuffer = MapNamedBuffer;
|
||||
gl_MapNamedBufferRange = MapNamedBufferRange;
|
||||
gl_UnmapNamedBuffer = UnmapNamedBuffer;
|
||||
gl_FlushMappedNamedBufferRange = FlushMappedNamedBufferRange;
|
||||
glCreateBuffers = CreateBuffers;
|
||||
glNamedBufferStorage = NamedBufferStorage;
|
||||
glNamedBufferData = NamedBufferData;
|
||||
glNamedBufferSubData = NamedBufferSubData;
|
||||
glMapNamedBuffer = MapNamedBuffer;
|
||||
glMapNamedBufferRange = MapNamedBufferRange;
|
||||
glUnmapNamedBuffer = UnmapNamedBuffer;
|
||||
glFlushMappedNamedBufferRange = FlushMappedNamedBufferRange;
|
||||
|
||||
gl_CreateProgramPipelines = CreateProgramPipelines;
|
||||
gl_CreateSamplers = CreateSamplers;
|
||||
glCreateProgramPipelines = CreateProgramPipelines;
|
||||
glCreateSamplers = CreateSamplers;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -421,9 +419,9 @@ namespace GLLoader {
|
|||
int max_ext = 0;
|
||||
glGetIntegerv(GL_NUM_EXTENSIONS, &max_ext);
|
||||
|
||||
if (gl_GetStringi && max_ext) {
|
||||
if (glGetStringi && max_ext) {
|
||||
for (GLint i = 0; i < max_ext; i++) {
|
||||
string ext((const char*)gl_GetStringi(GL_EXTENSIONS, i));
|
||||
string ext((const char*)glGetStringi(GL_EXTENSIONS, i));
|
||||
// Bonus
|
||||
if (ext.compare("GL_EXT_texture_filter_anisotropic") == 0) found_GL_EXT_texture_filter_anisotropic = true;
|
||||
// GL4.0
|
||||
|
@ -479,7 +477,7 @@ namespace GLLoader {
|
|||
if (!found_GL_ARB_direct_state_access) {
|
||||
Emulate_DSA::Init();
|
||||
}
|
||||
if (gl_BindTextureUnit == NULL) {
|
||||
if (glBindTextureUnit == NULL) {
|
||||
fprintf(stderr, "FATAL ERROR !!!! Failed to setup DSA function pointer!!!\n");
|
||||
status = false;
|
||||
}
|
||||
|
|
|
@ -183,130 +183,128 @@ typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void);
|
|||
typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels);
|
||||
#endif /* GL_VERSION_4_5 */
|
||||
|
||||
extern PFNGLACTIVETEXTUREPROC gl_ActiveTexture;
|
||||
extern PFNGLBLENDCOLORPROC gl_BlendColor;
|
||||
extern PFNGLATTACHSHADERPROC gl_AttachShader;
|
||||
extern PFNGLBINDBUFFERPROC gl_BindBuffer;
|
||||
extern PFNGLBINDBUFFERBASEPROC gl_BindBufferBase;
|
||||
extern PFNGLBINDBUFFERRANGEPROC gl_BindBufferRange;
|
||||
extern PFNGLBINDFRAMEBUFFERPROC gl_BindFramebuffer;
|
||||
extern PFNGLBINDSAMPLERPROC gl_BindSampler;
|
||||
extern PFNGLBINDVERTEXARRAYPROC gl_BindVertexArray;
|
||||
extern PFNGLBLENDEQUATIONSEPARATEIARBPROC gl_BlendEquationSeparateiARB;
|
||||
extern PFNGLBLENDFUNCSEPARATEIARBPROC gl_BlendFuncSeparateiARB;
|
||||
extern PFNGLBLITFRAMEBUFFERPROC gl_BlitFramebuffer;
|
||||
extern PFNGLBUFFERDATAPROC gl_BufferData;
|
||||
extern PFNGLCHECKFRAMEBUFFERSTATUSPROC gl_CheckFramebufferStatus;
|
||||
extern PFNGLCLEARBUFFERFVPROC gl_ClearBufferfv;
|
||||
extern PFNGLCLEARBUFFERIVPROC gl_ClearBufferiv;
|
||||
extern PFNGLCLEARBUFFERUIVPROC gl_ClearBufferuiv;
|
||||
extern PFNGLCOMPILESHADERPROC gl_CompileShader;
|
||||
extern PFNGLCOLORMASKIPROC gl_ColorMaski;
|
||||
extern PFNGLCREATEPROGRAMPROC gl_CreateProgram;
|
||||
extern PFNGLCREATESHADERPROC gl_CreateShader;
|
||||
extern PFNGLCREATESHADERPROGRAMVPROC gl_CreateShaderProgramv;
|
||||
extern PFNGLDELETEBUFFERSPROC gl_DeleteBuffers;
|
||||
extern PFNGLDELETEFRAMEBUFFERSPROC gl_DeleteFramebuffers;
|
||||
extern PFNGLDELETEPROGRAMPROC gl_DeleteProgram;
|
||||
extern PFNGLDELETESAMPLERSPROC gl_DeleteSamplers;
|
||||
extern PFNGLDELETESHADERPROC gl_DeleteShader;
|
||||
extern PFNGLDELETEVERTEXARRAYSPROC gl_DeleteVertexArrays;
|
||||
extern PFNGLDETACHSHADERPROC gl_DetachShader;
|
||||
extern PFNGLDRAWBUFFERSPROC gl_DrawBuffers;
|
||||
extern PFNGLDRAWELEMENTSBASEVERTEXPROC gl_DrawElementsBaseVertex;
|
||||
extern PFNGLENABLEVERTEXATTRIBARRAYPROC gl_EnableVertexAttribArray;
|
||||
extern PFNGLFRAMEBUFFERRENDERBUFFERPROC gl_FramebufferRenderbuffer;
|
||||
extern PFNGLFRAMEBUFFERTEXTURE2DPROC gl_FramebufferTexture2D;
|
||||
extern PFNGLGENBUFFERSPROC gl_GenBuffers;
|
||||
extern PFNGLGENFRAMEBUFFERSPROC gl_GenFramebuffers;
|
||||
extern PFNGLGENSAMPLERSPROC gl_GenSamplers;
|
||||
extern PFNGLGENVERTEXARRAYSPROC gl_GenVertexArrays;
|
||||
extern PFNGLGETBUFFERPARAMETERIVPROC gl_GetBufferParameteriv;
|
||||
extern PFNGLGETDEBUGMESSAGELOGARBPROC gl_GetDebugMessageLogARB;
|
||||
extern PFNGLDEBUGMESSAGECALLBACKPROC gl_DebugMessageCallback;
|
||||
extern PFNGLGETPROGRAMINFOLOGPROC gl_GetProgramInfoLog;
|
||||
extern PFNGLGETPROGRAMIVPROC gl_GetProgramiv;
|
||||
extern PFNGLGETSHADERIVPROC gl_GetShaderiv;
|
||||
extern PFNGLGETSTRINGIPROC gl_GetStringi;
|
||||
extern PFNGLISFRAMEBUFFERPROC gl_IsFramebuffer;
|
||||
extern PFNGLLINKPROGRAMPROC gl_LinkProgram;
|
||||
extern PFNGLMAPBUFFERPROC gl_MapBuffer;
|
||||
extern PFNGLMAPBUFFERRANGEPROC gl_MapBufferRange;
|
||||
extern PFNGLPROGRAMPARAMETERIPROC gl_ProgramParameteri;
|
||||
extern PFNGLSAMPLERPARAMETERFPROC gl_SamplerParameterf;
|
||||
extern PFNGLSAMPLERPARAMETERIPROC gl_SamplerParameteri;
|
||||
extern PFNGLSHADERSOURCEPROC gl_ShaderSource;
|
||||
extern PFNGLUNIFORM1IPROC gl_Uniform1i;
|
||||
extern PFNGLUNMAPBUFFERPROC gl_UnmapBuffer;
|
||||
extern PFNGLUSEPROGRAMSTAGESPROC gl_UseProgramStages;
|
||||
extern PFNGLVERTEXATTRIBIPOINTERPROC gl_VertexAttribIPointer;
|
||||
extern PFNGLVERTEXATTRIBPOINTERPROC gl_VertexAttribPointer;
|
||||
extern PFNGLBUFFERSUBDATAPROC gl_BufferSubData;
|
||||
extern PFNGLFENCESYNCPROC gl_FenceSync;
|
||||
extern PFNGLDELETESYNCPROC gl_DeleteSync;
|
||||
extern PFNGLCLIENTWAITSYNCPROC gl_ClientWaitSync;
|
||||
extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC gl_FlushMappedBufferRange;
|
||||
extern PFNGLBLENDEQUATIONSEPARATEPROC gl_BlendEquationSeparate;
|
||||
extern PFNGLBLENDFUNCSEPARATEPROC gl_BlendFuncSeparate;
|
||||
extern PFNGLATTACHSHADERPROC glAttachShader;
|
||||
extern PFNGLBINDBUFFERPROC glBindBuffer;
|
||||
extern PFNGLBINDBUFFERBASEPROC glBindBufferBase;
|
||||
extern PFNGLBINDBUFFERRANGEPROC glBindBufferRange;
|
||||
extern PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer;
|
||||
extern PFNGLBINDSAMPLERPROC glBindSampler;
|
||||
extern PFNGLBINDVERTEXARRAYPROC glBindVertexArray;
|
||||
extern PFNGLBLENDEQUATIONSEPARATEIARBPROC glBlendEquationSeparateiARB;
|
||||
extern PFNGLBLENDFUNCSEPARATEIARBPROC glBlendFuncSeparateiARB;
|
||||
extern PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer;
|
||||
extern PFNGLBUFFERDATAPROC glBufferData;
|
||||
extern PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus;
|
||||
extern PFNGLCLEARBUFFERFVPROC glClearBufferfv;
|
||||
extern PFNGLCLEARBUFFERIVPROC glClearBufferiv;
|
||||
extern PFNGLCLEARBUFFERUIVPROC glClearBufferuiv;
|
||||
extern PFNGLCOMPILESHADERPROC glCompileShader;
|
||||
extern PFNGLCOLORMASKIPROC glColorMaski;
|
||||
extern PFNGLCREATEPROGRAMPROC glCreateProgram;
|
||||
extern PFNGLCREATESHADERPROC glCreateShader;
|
||||
extern PFNGLCREATESHADERPROGRAMVPROC glCreateShaderProgramv;
|
||||
extern PFNGLDELETEBUFFERSPROC glDeleteBuffers;
|
||||
extern PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers;
|
||||
extern PFNGLDELETEPROGRAMPROC glDeleteProgram;
|
||||
extern PFNGLDELETESAMPLERSPROC glDeleteSamplers;
|
||||
extern PFNGLDELETESHADERPROC glDeleteShader;
|
||||
extern PFNGLDELETEVERTEXARRAYSPROC glDeleteVertexArrays;
|
||||
extern PFNGLDETACHSHADERPROC glDetachShader;
|
||||
extern PFNGLDRAWBUFFERSPROC glDrawBuffers;
|
||||
extern PFNGLDRAWELEMENTSBASEVERTEXPROC glDrawElementsBaseVertex;
|
||||
extern PFNGLENABLEVERTEXATTRIBARRAYPROC glEnableVertexAttribArray;
|
||||
extern PFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer;
|
||||
extern PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D;
|
||||
extern PFNGLGENBUFFERSPROC glGenBuffers;
|
||||
extern PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers;
|
||||
extern PFNGLGENSAMPLERSPROC glGenSamplers;
|
||||
extern PFNGLGENVERTEXARRAYSPROC glGenVertexArrays;
|
||||
extern PFNGLGETBUFFERPARAMETERIVPROC glGetBufferParameteriv;
|
||||
extern PFNGLGETDEBUGMESSAGELOGARBPROC glGetDebugMessageLogARB;
|
||||
extern PFNGLDEBUGMESSAGECALLBACKPROC glDebugMessageCallback;
|
||||
extern PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog;
|
||||
extern PFNGLGETPROGRAMIVPROC glGetProgramiv;
|
||||
extern PFNGLGETSHADERIVPROC glGetShaderiv;
|
||||
extern PFNGLGETSTRINGIPROC glGetStringi;
|
||||
extern PFNGLISFRAMEBUFFERPROC glIsFramebuffer;
|
||||
extern PFNGLLINKPROGRAMPROC glLinkProgram;
|
||||
extern PFNGLMAPBUFFERPROC glMapBuffer;
|
||||
extern PFNGLMAPBUFFERRANGEPROC glMapBufferRange;
|
||||
extern PFNGLPROGRAMPARAMETERIPROC glProgramParameteri;
|
||||
extern PFNGLSAMPLERPARAMETERFPROC glSamplerParameterf;
|
||||
extern PFNGLSAMPLERPARAMETERIPROC glSamplerParameteri;
|
||||
extern PFNGLSHADERSOURCEPROC glShaderSource;
|
||||
extern PFNGLUNIFORM1IPROC glUniform1i;
|
||||
extern PFNGLUNMAPBUFFERPROC glUnmapBuffer;
|
||||
extern PFNGLUSEPROGRAMSTAGESPROC glUseProgramStages;
|
||||
extern PFNGLVERTEXATTRIBIPOINTERPROC glVertexAttribIPointer;
|
||||
extern PFNGLVERTEXATTRIBPOINTERPROC glVertexAttribPointer;
|
||||
extern PFNGLBUFFERSUBDATAPROC glBufferSubData;
|
||||
extern PFNGLFENCESYNCPROC glFenceSync;
|
||||
extern PFNGLDELETESYNCPROC glDeleteSync;
|
||||
extern PFNGLCLIENTWAITSYNCPROC glClientWaitSync;
|
||||
extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange;
|
||||
extern PFNGLBLENDEQUATIONSEPARATEPROC glBlendEquationSeparate;
|
||||
extern PFNGLBLENDFUNCSEPARATEPROC glBlendFuncSeparate;
|
||||
// GL4.0
|
||||
// GL4.1
|
||||
extern PFNGLBINDPROGRAMPIPELINEPROC gl_BindProgramPipeline;
|
||||
extern PFNGLDELETEPROGRAMPIPELINESPROC gl_DeleteProgramPipelines;
|
||||
extern PFNGLGENPROGRAMPIPELINESPROC gl_GenProgramPipelines;
|
||||
extern PFNGLGETPROGRAMPIPELINEIVPROC gl_GetProgramPipelineiv;
|
||||
extern PFNGLVALIDATEPROGRAMPIPELINEPROC gl_ValidateProgramPipeline;
|
||||
extern PFNGLGETPROGRAMPIPELINEINFOLOGPROC gl_GetProgramPipelineInfoLog;
|
||||
extern PFNGLGETPROGRAMBINARYPROC gl_GetProgramBinary;
|
||||
extern PFNGLBINDPROGRAMPIPELINEPROC glBindProgramPipeline;
|
||||
extern PFNGLDELETEPROGRAMPIPELINESPROC glDeleteProgramPipelines;
|
||||
extern PFNGLGENPROGRAMPIPELINESPROC glGenProgramPipelines;
|
||||
extern PFNGLGETPROGRAMPIPELINEIVPROC glGetProgramPipelineiv;
|
||||
extern PFNGLVALIDATEPROGRAMPIPELINEPROC glValidateProgramPipeline;
|
||||
extern PFNGLGETPROGRAMPIPELINEINFOLOGPROC glGetProgramPipelineInfoLog;
|
||||
extern PFNGLGETPROGRAMBINARYPROC glGetProgramBinary;
|
||||
// NO GL4.1
|
||||
extern PFNGLUSEPROGRAMPROC gl_UseProgram;
|
||||
extern PFNGLGETSHADERINFOLOGPROC gl_GetShaderInfoLog;
|
||||
extern PFNGLPROGRAMUNIFORM1IPROC gl_ProgramUniform1i;
|
||||
extern PFNGLUSEPROGRAMPROC glUseProgram;
|
||||
extern PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
|
||||
extern PFNGLPROGRAMUNIFORM1IPROC glProgramUniform1i;
|
||||
// GL4.2
|
||||
extern PFNGLBINDIMAGETEXTUREPROC gl_BindImageTexture;
|
||||
extern PFNGLMEMORYBARRIERPROC gl_MemoryBarrier;
|
||||
extern PFNGLTEXSTORAGE2DPROC gl_TexStorage2D;
|
||||
extern PFNGLPOPDEBUGGROUPPROC gl_PopDebugGroup;
|
||||
extern PFNGLBINDIMAGETEXTUREPROC glBindImageTexture;
|
||||
extern PFNGLMEMORYBARRIERPROC glMemoryBarrier;
|
||||
extern PFNGLTEXSTORAGE2DPROC glTexStorage2D;
|
||||
extern PFNGLPOPDEBUGGROUPPROC glPopDebugGroup;
|
||||
// GL4.3
|
||||
extern PFNGLCOPYIMAGESUBDATAPROC gl_CopyImageSubData;
|
||||
extern PFNGLINVALIDATETEXIMAGEPROC gl_InvalidateTexImage;
|
||||
extern PFNGLPUSHDEBUGGROUPPROC gl_PushDebugGroup;
|
||||
extern PFNGLDEBUGMESSAGEINSERTPROC gl_DebugMessageInsert;
|
||||
extern PFNGLCOPYIMAGESUBDATAPROC glCopyImageSubData;
|
||||
extern PFNGLINVALIDATETEXIMAGEPROC glInvalidateTexImage;
|
||||
extern PFNGLPUSHDEBUGGROUPPROC glPushDebugGroup;
|
||||
extern PFNGLDEBUGMESSAGEINSERTPROC glDebugMessageInsert;
|
||||
// GL4.4
|
||||
extern PFNGLCLEARTEXIMAGEPROC gl_ClearTexImage;
|
||||
extern PFNGLBUFFERSTORAGEPROC gl_BufferStorage;
|
||||
extern PFNGLCLEARTEXIMAGEPROC glClearTexImage;
|
||||
extern PFNGLBUFFERSTORAGEPROC glBufferStorage;
|
||||
|
||||
// GL4.5
|
||||
extern PFNGLCREATETEXTURESPROC gl_CreateTextures;
|
||||
extern PFNGLTEXTURESTORAGE2DPROC gl_TextureStorage2D;
|
||||
extern PFNGLTEXTURESUBIMAGE2DPROC gl_TextureSubImage2D;
|
||||
extern PFNGLCOPYTEXTURESUBIMAGE2DPROC gl_CopyTextureSubImage2D;
|
||||
extern PFNGLBINDTEXTUREUNITPROC gl_BindTextureUnit;
|
||||
extern PFNGLGETTEXTUREIMAGEPROC gl_GetTextureImage;
|
||||
extern PFNGLTEXTUREPARAMETERIPROC gl_TextureParameteri;
|
||||
extern PFNGLCREATETEXTURESPROC glCreateTextures;
|
||||
extern PFNGLTEXTURESTORAGE2DPROC glTextureStorage2D;
|
||||
extern PFNGLTEXTURESUBIMAGE2DPROC glTextureSubImage2D;
|
||||
extern PFNGLCOPYTEXTURESUBIMAGE2DPROC glCopyTextureSubImage2D;
|
||||
extern PFNGLBINDTEXTUREUNITPROC glBindTextureUnit;
|
||||
extern PFNGLGETTEXTUREIMAGEPROC glGetTextureImage;
|
||||
extern PFNGLTEXTUREPARAMETERIPROC glTextureParameteri;
|
||||
|
||||
extern PFNGLCREATEFRAMEBUFFERSPROC gl_CreateFramebuffers;
|
||||
extern PFNGLCLEARNAMEDFRAMEBUFFERFVPROC gl_ClearNamedFramebufferfv;
|
||||
extern PFNGLCLEARNAMEDFRAMEBUFFERIVPROC gl_ClearNamedFramebufferiv;
|
||||
extern PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC gl_ClearNamedFramebufferuiv;
|
||||
extern PFNGLNAMEDFRAMEBUFFERTEXTUREPROC gl_NamedFramebufferTexture;
|
||||
extern PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC gl_NamedFramebufferDrawBuffers;
|
||||
extern PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC gl_NamedFramebufferReadBuffer;
|
||||
extern PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC gl_CheckNamedFramebufferStatus;
|
||||
extern PFNGLCREATEFRAMEBUFFERSPROC glCreateFramebuffers;
|
||||
extern PFNGLCLEARNAMEDFRAMEBUFFERFVPROC glClearNamedFramebufferfv;
|
||||
extern PFNGLCLEARNAMEDFRAMEBUFFERIVPROC glClearNamedFramebufferiv;
|
||||
extern PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC glClearNamedFramebufferuiv;
|
||||
extern PFNGLNAMEDFRAMEBUFFERTEXTUREPROC glNamedFramebufferTexture;
|
||||
extern PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC glNamedFramebufferDrawBuffers;
|
||||
extern PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC glNamedFramebufferReadBuffer;
|
||||
extern PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC glCheckNamedFramebufferStatus;
|
||||
|
||||
extern PFNGLCREATEBUFFERSPROC gl_CreateBuffers;
|
||||
extern PFNGLNAMEDBUFFERSTORAGEPROC gl_NamedBufferStorage;
|
||||
extern PFNGLNAMEDBUFFERDATAPROC gl_NamedBufferData;
|
||||
extern PFNGLNAMEDBUFFERSUBDATAPROC gl_NamedBufferSubData;
|
||||
extern PFNGLMAPNAMEDBUFFERPROC gl_MapNamedBuffer;
|
||||
extern PFNGLMAPNAMEDBUFFERRANGEPROC gl_MapNamedBufferRange;
|
||||
extern PFNGLUNMAPNAMEDBUFFERPROC gl_UnmapNamedBuffer;
|
||||
extern PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC gl_FlushMappedNamedBufferRange;
|
||||
extern PFNGLCREATEBUFFERSPROC glCreateBuffers;
|
||||
extern PFNGLNAMEDBUFFERSTORAGEPROC glNamedBufferStorage;
|
||||
extern PFNGLNAMEDBUFFERDATAPROC glNamedBufferData;
|
||||
extern PFNGLNAMEDBUFFERSUBDATAPROC glNamedBufferSubData;
|
||||
extern PFNGLMAPNAMEDBUFFERPROC glMapNamedBuffer;
|
||||
extern PFNGLMAPNAMEDBUFFERRANGEPROC glMapNamedBufferRange;
|
||||
extern PFNGLUNMAPNAMEDBUFFERPROC glUnmapNamedBuffer;
|
||||
extern PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC glFlushMappedNamedBufferRange;
|
||||
|
||||
extern PFNGLCREATESAMPLERSPROC gl_CreateSamplers;
|
||||
extern PFNGLCREATEPROGRAMPIPELINESPROC gl_CreateProgramPipelines;
|
||||
extern PFNGLCREATESAMPLERSPROC glCreateSamplers;
|
||||
extern PFNGLCREATEPROGRAMPIPELINESPROC glCreateProgramPipelines;
|
||||
|
||||
extern PFNGLCLIPCONTROLPROC gl_ClipControl;
|
||||
extern PFNGLTEXTUREBARRIERPROC gl_TextureBarrier;
|
||||
extern PFNGLCLIPCONTROLPROC glClipControl;
|
||||
extern PFNGLTEXTUREBARRIERPROC glTextureBarrier;
|
||||
|
||||
namespace Emulate_DSA {
|
||||
extern void SetFramebufferTarget(GLenum target);
|
||||
|
|
|
@ -126,13 +126,13 @@ GSDeviceOGL::~GSDeviceOGL()
|
|||
|
||||
|
||||
// Clean various opengl allocation
|
||||
gl_DeleteFramebuffers(1, &m_fbo);
|
||||
gl_DeleteFramebuffers(1, &m_fbo_read);
|
||||
glDeleteFramebuffers(1, &m_fbo);
|
||||
glDeleteFramebuffers(1, &m_fbo_read);
|
||||
|
||||
// Delete HW FX
|
||||
delete m_vs_cb;
|
||||
delete m_ps_cb;
|
||||
gl_DeleteSamplers(1, &m_palette_ss);
|
||||
glDeleteSamplers(1, &m_palette_ss);
|
||||
m_shader->Delete(m_apitrace);
|
||||
|
||||
for (uint32 key = 0; key < countof(m_vs); key++) m_shader->Delete(m_vs[key]);
|
||||
|
@ -141,7 +141,7 @@ GSDeviceOGL::~GSDeviceOGL()
|
|||
|
||||
m_ps.clear();
|
||||
|
||||
gl_DeleteSamplers(countof(m_ps_ss), m_ps_ss);
|
||||
glDeleteSamplers(countof(m_ps_ss), m_ps_ss);
|
||||
|
||||
for (uint32 key = 0; key < countof(m_om_dss); key++) delete m_om_dss[key];
|
||||
|
||||
|
@ -199,8 +199,8 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
|
|||
// Debug helper
|
||||
// ****************************************************************
|
||||
#ifdef ENABLE_OGL_DEBUG
|
||||
if (theApp.GetConfig("debug_opengl", 0) && gl_DebugMessageCallback) {
|
||||
gl_DebugMessageCallback((GLDEBUGPROC)DebugOutputToFile, NULL);
|
||||
if (theApp.GetConfig("debug_opengl", 0) && glDebugMessageCallback) {
|
||||
glDebugMessageCallback((GLDEBUGPROC)DebugOutputToFile, NULL);
|
||||
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
||||
}
|
||||
#endif
|
||||
|
@ -210,18 +210,18 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
|
|||
// ****************************************************************
|
||||
m_shader = new GSShaderOGL(!!theApp.GetConfig("debug_glsl_shader", 0));
|
||||
|
||||
gl_GenFramebuffers(1, &m_fbo);
|
||||
glGenFramebuffers(1, &m_fbo);
|
||||
// Always write to the first buffer
|
||||
OMSetFBO(m_fbo);
|
||||
GLenum target[1] = {GL_COLOR_ATTACHMENT0};
|
||||
gl_DrawBuffers(1, target);
|
||||
glDrawBuffers(1, target);
|
||||
OMSetFBO(0);
|
||||
|
||||
gl_GenFramebuffers(1, &m_fbo_read);
|
||||
glGenFramebuffers(1, &m_fbo_read);
|
||||
// Always read from the first buffer
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
|
||||
// ****************************************************************
|
||||
// Vertex buffer state
|
||||
|
@ -335,7 +335,7 @@ bool GSDeviceOGL::Create(GSWnd* wnd)
|
|||
// gl_position.z could range from [0, 1]
|
||||
if (GLLoader::found_GL_ARB_clip_control) {
|
||||
// Change depth convention
|
||||
gl_ClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);
|
||||
glClipControl(GL_LOWER_LEFT, GL_ZERO_TO_ONE);
|
||||
}
|
||||
|
||||
// ****************************************************************
|
||||
|
@ -456,12 +456,12 @@ void GSDeviceOGL::ClearRenderTarget(GSTexture* t, const GSVector4& c)
|
|||
|
||||
// glDrawBuffer(GL_BACK); // this is the default when there is no FB
|
||||
// 0 will select the first drawbuffer ie GL_BACK
|
||||
gl_ClearBufferfv(GL_COLOR, 0, c.v);
|
||||
glClearBufferfv(GL_COLOR, 0, c.v);
|
||||
} else {
|
||||
OMSetFBO(m_fbo);
|
||||
OMAttachRt(T);
|
||||
|
||||
gl_ClearBufferfv(GL_COLOR, 0, c.v);
|
||||
glClearBufferfv(GL_COLOR, 0, c.v);
|
||||
|
||||
}
|
||||
|
||||
|
@ -505,7 +505,7 @@ void GSDeviceOGL::ClearRenderTarget_i(GSTexture* t, int32 c)
|
|||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
gl_ClearBufferiv(GL_COLOR, 0, col);
|
||||
glClearBufferiv(GL_COLOR, 0, col);
|
||||
|
||||
OMSetColorMaskState(OMColorMaskSelector(old_color_mask));
|
||||
|
||||
|
@ -530,10 +530,10 @@ void GSDeviceOGL::ClearDepth(GSTexture* t, float c)
|
|||
// TODO: check size of scissor before toggling it
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
if (GLState::depth_mask) {
|
||||
gl_ClearBufferfv(GL_DEPTH, 0, &c);
|
||||
glClearBufferfv(GL_DEPTH, 0, &c);
|
||||
} else {
|
||||
glDepthMask(true);
|
||||
gl_ClearBufferfv(GL_DEPTH, 0, &c);
|
||||
glClearBufferfv(GL_DEPTH, 0, &c);
|
||||
glDepthMask(false);
|
||||
}
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
|
@ -555,7 +555,7 @@ void GSDeviceOGL::ClearStencil(GSTexture* t, uint8 c)
|
|||
OMAttachDs(T);
|
||||
GLint color = c;
|
||||
|
||||
gl_ClearBufferiv(GL_STENCIL, 0, &color);
|
||||
glClearBufferiv(GL_STENCIL, 0, &color);
|
||||
|
||||
GL_POP();
|
||||
}
|
||||
|
@ -570,32 +570,32 @@ GLuint GSDeviceOGL::CreateSampler(bool bilinear, bool tau, bool tav)
|
|||
GL_PUSH("Create Sampler");
|
||||
|
||||
GLuint sampler;
|
||||
gl_GenSamplers(1, &sampler);
|
||||
glGenSamplers(1, &sampler);
|
||||
if (bilinear) {
|
||||
gl_SamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
gl_SamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
} else {
|
||||
gl_SamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
gl_SamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
}
|
||||
|
||||
if (tau)
|
||||
gl_SamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
else
|
||||
gl_SamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
if (tav)
|
||||
gl_SamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
else
|
||||
gl_SamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
|
||||
gl_SamplerParameteri(sampler, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
|
||||
glSamplerParameteri(sampler, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
|
||||
|
||||
gl_SamplerParameterf(sampler, GL_TEXTURE_MIN_LOD, 0);
|
||||
gl_SamplerParameterf(sampler, GL_TEXTURE_MAX_LOD, 6);
|
||||
glSamplerParameterf(sampler, GL_TEXTURE_MIN_LOD, 0);
|
||||
glSamplerParameterf(sampler, GL_TEXTURE_MAX_LOD, 6);
|
||||
|
||||
int anisotropy = theApp.GetConfig("MaxAnisotropy", 0);
|
||||
if (GLLoader::found_GL_EXT_texture_filter_anisotropic && anisotropy && !theApp.GetConfig("paltex", 0))
|
||||
gl_SamplerParameterf(sampler, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)anisotropy);
|
||||
glSamplerParameterf(sampler, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)anisotropy);
|
||||
|
||||
GL_POP();
|
||||
return sampler;
|
||||
|
@ -612,7 +612,7 @@ void GSDeviceOGL::InitPrimDateTexture(GSTexture* rt)
|
|||
// Clean with the max signed value
|
||||
ClearRenderTarget_i(m_date.t, 0x7FFFFFFF);
|
||||
|
||||
gl_BindImageTexture(2, m_date.t->GetID(), 0, false, 0, GL_READ_WRITE, GL_R32I);
|
||||
glBindImageTexture(2, m_date.t->GetID(), 0, false, 0, GL_READ_WRITE, GL_R32I);
|
||||
}
|
||||
|
||||
void GSDeviceOGL::RecycleDateTexture()
|
||||
|
@ -627,7 +627,7 @@ void GSDeviceOGL::RecycleDateTexture()
|
|||
|
||||
void GSDeviceOGL::Barrier(GLbitfield b)
|
||||
{
|
||||
gl_MemoryBarrier(b);
|
||||
glMemoryBarrier(b);
|
||||
}
|
||||
|
||||
/* Note: must be here because tfx_glsl is static */
|
||||
|
@ -897,15 +897,15 @@ void GSDeviceOGL::CopyRectConv(GSTexture* sTex, GSTexture* dTex, const GSVector4
|
|||
|
||||
GL_PUSH(format("CopyRectConv from %d to %d", sid, did).c_str());
|
||||
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
|
||||
gl_FramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sid, 0);
|
||||
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, sid, 0);
|
||||
if (at_origin)
|
||||
gl_CopyTextureSubImage2D(did, GL_TEX_LEVEL_0, 0, 0, r.x, r.y, r.width(), r.height());
|
||||
glCopyTextureSubImage2D(did, GL_TEX_LEVEL_0, 0, 0, r.x, r.y, r.width(), r.height());
|
||||
else
|
||||
gl_CopyTextureSubImage2D(did, GL_TEX_LEVEL_0, r.x, r.y, r.x, r.y, r.width(), r.height());
|
||||
glCopyTextureSubImage2D(did, GL_TEX_LEVEL_0, r.x, r.y, r.x, r.y, r.width(), r.height());
|
||||
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
|
||||
GL_POP();
|
||||
}
|
||||
|
@ -921,7 +921,7 @@ void GSDeviceOGL::CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r
|
|||
GL_PUSH("CopyRect from %d to %d", sid, did);
|
||||
|
||||
if (GLLoader::found_GL_ARB_copy_image) {
|
||||
gl_CopyImageSubData( sid, GL_TEXTURE_2D,
|
||||
glCopyImageSubData( sid, GL_TEXTURE_2D,
|
||||
0, r.x, r.y, 0,
|
||||
did, GL_TEXTURE_2D,
|
||||
0, 0, 0, 0,
|
||||
|
@ -1271,7 +1271,7 @@ void GSDeviceOGL::PSSetShaderResource(int i, GSTexture* sr)
|
|||
GLuint id = sr->GetID();
|
||||
if (GLState::tex_unit[i] != id) {
|
||||
GLState::tex_unit[i] = id;
|
||||
gl_BindTextureUnit(i, id);
|
||||
glBindTextureUnit(i, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1286,7 +1286,7 @@ void GSDeviceOGL::PSSetSamplerState(GLuint ss)
|
|||
{
|
||||
if (GLState::ps_ss != ss) {
|
||||
GLState::ps_ss = ss;
|
||||
gl_BindSampler(0, ss);
|
||||
glBindSampler(0, ss);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1302,7 +1302,7 @@ void GSDeviceOGL::OMAttachRt(GSTextureOGL* rt)
|
|||
|
||||
if (GLState::rt != id) {
|
||||
GLState::rt = id;
|
||||
gl_FramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, id, 0);
|
||||
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, id, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1318,7 +1318,7 @@ void GSDeviceOGL::OMAttachDs(GSTextureOGL* ds)
|
|||
|
||||
if (GLState::ds != id) {
|
||||
GLState::ds = id;
|
||||
gl_FramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, id, 0);
|
||||
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, id, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1326,7 +1326,7 @@ void GSDeviceOGL::OMSetFBO(GLuint fbo)
|
|||
{
|
||||
if (GLState::fbo != fbo) {
|
||||
GLState::fbo = fbo;
|
||||
gl_BindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1341,7 +1341,7 @@ void GSDeviceOGL::OMSetColorMaskState(OMColorMaskSelector sel)
|
|||
if (sel.wrgba != GLState::wrgba) {
|
||||
GLState::wrgba = sel.wrgba;
|
||||
|
||||
gl_ColorMaski(0, sel.wr, sel.wg, sel.wb, sel.wa);
|
||||
glColorMaski(0, sel.wr, sel.wg, sel.wb, sel.wa);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1356,26 +1356,26 @@ void GSDeviceOGL::OMSetBlendState(uint8 blend_index, uint8 blend_factor, bool is
|
|||
if (is_blend_constant && GLState::bf != blend_factor) {
|
||||
GLState::bf = blend_factor;
|
||||
float bf = (float)blend_factor / 128.0f;
|
||||
gl_BlendColor(bf, bf, bf, bf);
|
||||
glBlendColor(bf, bf, bf, bf);
|
||||
}
|
||||
|
||||
const OGLBlend& b = m_blendMapOGL[blend_index];
|
||||
|
||||
if (GLState::eq_RGB != b.op) {
|
||||
GLState::eq_RGB = b.op;
|
||||
if (gl_BlendEquationSeparateiARB)
|
||||
gl_BlendEquationSeparateiARB(0, b.op, GL_FUNC_ADD);
|
||||
if (glBlendEquationSeparateiARB)
|
||||
glBlendEquationSeparateiARB(0, b.op, GL_FUNC_ADD);
|
||||
else
|
||||
gl_BlendEquationSeparate(b.op, GL_FUNC_ADD);
|
||||
glBlendEquationSeparate(b.op, GL_FUNC_ADD);
|
||||
}
|
||||
|
||||
if (GLState::f_sRGB != b.src || GLState::f_dRGB != b.dst) {
|
||||
GLState::f_sRGB = b.src;
|
||||
GLState::f_dRGB = b.dst;
|
||||
if (gl_BlendFuncSeparateiARB)
|
||||
gl_BlendFuncSeparateiARB(0, b.src, b.dst, GL_ONE, GL_ZERO);
|
||||
if (glBlendFuncSeparateiARB)
|
||||
glBlendFuncSeparateiARB(0, b.src, b.dst, GL_ONE, GL_ZERO);
|
||||
else
|
||||
gl_BlendFuncSeparate(b.src, b.dst, GL_ONE, GL_ZERO);
|
||||
glBlendFuncSeparate(b.src, b.dst, GL_ONE, GL_ZERO);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -1442,7 +1442,7 @@ void GSDeviceOGL::CheckDebugLog()
|
|||
int lengths[16] = {};
|
||||
char* messageLog = new char[bufsize];
|
||||
|
||||
unsigned int retVal = gl_GetDebugMessageLogARB(count, bufsize, sources, types, ids, severities, lengths, messageLog);
|
||||
unsigned int retVal = glGetDebugMessageLogARB(count, bufsize, sources, types, ids, severities, lengths, messageLog);
|
||||
|
||||
if(retVal > 0)
|
||||
{
|
||||
|
|
|
@ -536,7 +536,7 @@ void GSRendererOGL::SendDraw(bool require_barrier)
|
|||
dev->DrawIndexedPrimitive();
|
||||
} else if (m_prim_overlap == PRIM_OVERLAP_NO) {
|
||||
ASSERT(GLLoader::found_GL_ARB_texture_barrier);
|
||||
gl_TextureBarrier();
|
||||
glTextureBarrier();
|
||||
dev->DrawIndexedPrimitive();
|
||||
} else {
|
||||
// FIXME: Investigate: a dynamic check to pack as many primitives as possibles
|
||||
|
@ -554,7 +554,7 @@ void GSRendererOGL::SendDraw(bool require_barrier)
|
|||
GL_PERF("Split single draw in %d draw", m_index.tail/nb_vertex);
|
||||
|
||||
for (size_t p = 0; p < m_index.tail; p += nb_vertex) {
|
||||
gl_TextureBarrier();
|
||||
glTextureBarrier();
|
||||
dev->DrawIndexedPrimitive(p, nb_vertex);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,17 +29,17 @@ GSShaderOGL::GSShaderOGL(bool debug) :
|
|||
{
|
||||
m_single_prog.clear();
|
||||
if (GLLoader::found_GL_ARB_separate_shader_objects) {
|
||||
gl_GenProgramPipelines(1, &m_pipeline);
|
||||
gl_BindProgramPipeline(m_pipeline);
|
||||
glGenProgramPipelines(1, &m_pipeline);
|
||||
glBindProgramPipeline(m_pipeline);
|
||||
}
|
||||
}
|
||||
|
||||
GSShaderOGL::~GSShaderOGL()
|
||||
{
|
||||
if (GLLoader::found_GL_ARB_separate_shader_objects)
|
||||
gl_DeleteProgramPipelines(1, &m_pipeline);
|
||||
glDeleteProgramPipelines(1, &m_pipeline);
|
||||
|
||||
for (auto it = m_single_prog.begin(); it != m_single_prog.end() ; it++) gl_DeleteProgram(it->second);
|
||||
for (auto it = m_single_prog.begin(); it != m_single_prog.end() ; it++) glDeleteProgram(it->second);
|
||||
m_single_prog.clear();
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ void GSShaderOGL::VS(GLuint s)
|
|||
GLState::vs = s;
|
||||
GLState::dirty_prog = true;
|
||||
if (GLLoader::found_GL_ARB_separate_shader_objects)
|
||||
gl_UseProgramStages(m_pipeline, GL_VERTEX_SHADER_BIT, s);
|
||||
glUseProgramStages(m_pipeline, GL_VERTEX_SHADER_BIT, s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ void GSShaderOGL::PS(GLuint s)
|
|||
GLState::ps = s;
|
||||
GLState::dirty_prog = true;
|
||||
if (GLLoader::found_GL_ARB_separate_shader_objects) {
|
||||
gl_UseProgramStages(m_pipeline, GL_FRAGMENT_SHADER_BIT, s);
|
||||
glUseProgramStages(m_pipeline, GL_FRAGMENT_SHADER_BIT, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ void GSShaderOGL::GS(GLuint s)
|
|||
GLState::gs = s;
|
||||
GLState::dirty_prog = true;
|
||||
if (GLLoader::found_GL_ARB_separate_shader_objects)
|
||||
gl_UseProgramStages(m_pipeline, GL_GEOMETRY_SHADER_BIT, s);
|
||||
glUseProgramStages(m_pipeline, GL_GEOMETRY_SHADER_BIT, s);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -87,14 +87,14 @@ bool GSShaderOGL::ValidateShader(GLuint s)
|
|||
if (!m_debug_shader) return true;
|
||||
|
||||
GLint status = 0;
|
||||
gl_GetShaderiv(s, GL_COMPILE_STATUS, &status);
|
||||
glGetShaderiv(s, GL_COMPILE_STATUS, &status);
|
||||
if (status) return true;
|
||||
|
||||
GLint log_length = 0;
|
||||
gl_GetShaderiv(s, GL_INFO_LOG_LENGTH, &log_length);
|
||||
glGetShaderiv(s, GL_INFO_LOG_LENGTH, &log_length);
|
||||
if (log_length > 0) {
|
||||
char* log = new char[log_length];
|
||||
gl_GetShaderInfoLog(s, log_length, NULL, log);
|
||||
glGetShaderInfoLog(s, log_length, NULL, log);
|
||||
fprintf(stderr, "%s", log);
|
||||
delete[] log;
|
||||
}
|
||||
|
@ -108,14 +108,14 @@ bool GSShaderOGL::ValidateProgram(GLuint p)
|
|||
if (!m_debug_shader) return true;
|
||||
|
||||
GLint status = 0;
|
||||
gl_GetProgramiv(p, GL_LINK_STATUS, &status);
|
||||
glGetProgramiv(p, GL_LINK_STATUS, &status);
|
||||
if (status) return true;
|
||||
|
||||
GLint log_length = 0;
|
||||
gl_GetProgramiv(p, GL_INFO_LOG_LENGTH, &log_length);
|
||||
glGetProgramiv(p, GL_INFO_LOG_LENGTH, &log_length);
|
||||
if (log_length > 0) {
|
||||
char* log = new char[log_length];
|
||||
gl_GetProgramInfoLog(p, log_length, NULL, log);
|
||||
glGetProgramInfoLog(p, log_length, NULL, log);
|
||||
fprintf(stderr, "%s", log);
|
||||
delete[] log;
|
||||
}
|
||||
|
@ -129,17 +129,17 @@ bool GSShaderOGL::ValidatePipeline(GLuint p)
|
|||
if (!m_debug_shader) return true;
|
||||
|
||||
// FIXME: might be mandatory to validate the pipeline
|
||||
gl_ValidateProgramPipeline(p);
|
||||
glValidateProgramPipeline(p);
|
||||
|
||||
GLint status = 0;
|
||||
gl_GetProgramPipelineiv(p, GL_VALIDATE_STATUS, &status);
|
||||
glGetProgramPipelineiv(p, GL_VALIDATE_STATUS, &status);
|
||||
if (status) return true;
|
||||
|
||||
GLint log_length = 0;
|
||||
gl_GetProgramPipelineiv(p, GL_INFO_LOG_LENGTH, &log_length);
|
||||
glGetProgramPipelineiv(p, GL_INFO_LOG_LENGTH, &log_length);
|
||||
if (log_length > 0) {
|
||||
char* log = new char[log_length];
|
||||
gl_GetProgramPipelineInfoLog(p, log_length, NULL, log);
|
||||
glGetProgramPipelineInfoLog(p, log_length, NULL, log);
|
||||
fprintf(stderr, "%s", log);
|
||||
delete[] log;
|
||||
}
|
||||
|
@ -150,12 +150,12 @@ bool GSShaderOGL::ValidatePipeline(GLuint p)
|
|||
|
||||
GLuint GSShaderOGL::LinkNewProgram()
|
||||
{
|
||||
GLuint p = gl_CreateProgram();
|
||||
if (GLState::vs) gl_AttachShader(p, GLState::vs);
|
||||
if (GLState::ps) gl_AttachShader(p, GLState::ps);
|
||||
if (GLState::gs) gl_AttachShader(p, GLState::gs);
|
||||
GLuint p = glCreateProgram();
|
||||
if (GLState::vs) glAttachShader(p, GLState::vs);
|
||||
if (GLState::ps) glAttachShader(p, GLState::ps);
|
||||
if (GLState::gs) glAttachShader(p, GLState::gs);
|
||||
|
||||
gl_LinkProgram(p);
|
||||
glLinkProgram(p);
|
||||
|
||||
ValidateProgram(p);
|
||||
|
||||
|
@ -180,12 +180,12 @@ void GSShaderOGL::UseProgram()
|
|||
|
||||
ValidateProgram(GLState::program);
|
||||
|
||||
gl_UseProgram(GLState::program);
|
||||
glUseProgram(GLState::program);
|
||||
} else {
|
||||
GLuint prog = it->second;
|
||||
if (prog != GLState::program) {
|
||||
GLState::program = prog;
|
||||
gl_UseProgram(GLState::program);
|
||||
glUseProgram(GLState::program);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -267,11 +267,11 @@ GLuint GSShaderOGL::Compile(const std::string& glsl_file, const std::string& ent
|
|||
#endif
|
||||
|
||||
if (GLLoader::found_GL_ARB_separate_shader_objects) {
|
||||
program = gl_CreateShaderProgramv(type, shader_nb, sources);
|
||||
program = glCreateShaderProgramv(type, shader_nb, sources);
|
||||
} else {
|
||||
program = gl_CreateShader(type);
|
||||
gl_ShaderSource(program, shader_nb, sources, NULL);
|
||||
gl_CompileShader(program);
|
||||
program = glCreateShader(type);
|
||||
glShaderSource(program, shader_nb, sources, NULL);
|
||||
glCompileShader(program);
|
||||
}
|
||||
|
||||
bool status;
|
||||
|
@ -299,11 +299,11 @@ int GSShaderOGL::DumpAsm(const std::string& file, GLuint p)
|
|||
if (!GLLoader::nvidia_buggy_driver) return 0;
|
||||
|
||||
GLint binaryLength;
|
||||
gl_GetProgramiv(p, GL_PROGRAM_BINARY_LENGTH, &binaryLength);
|
||||
glGetProgramiv(p, GL_PROGRAM_BINARY_LENGTH, &binaryLength);
|
||||
|
||||
char* binary = new char[binaryLength+4];
|
||||
GLenum binaryFormat;
|
||||
gl_GetProgramBinary(p, binaryLength, NULL, &binaryFormat, binary);
|
||||
glGetProgramBinary(p, binaryLength, NULL, &binaryFormat, binary);
|
||||
|
||||
FILE* outfile = fopen(file.c_str(), "w");
|
||||
ASSERT(outfile);
|
||||
|
@ -351,8 +351,8 @@ int GSShaderOGL::DumpAsm(const std::string& file, GLuint p)
|
|||
void GSShaderOGL::Delete(GLuint s)
|
||||
{
|
||||
if (GLLoader::found_GL_ARB_separate_shader_objects) {
|
||||
gl_DeleteProgram(s);
|
||||
glDeleteProgram(s);
|
||||
} else {
|
||||
gl_DeleteShader(s);
|
||||
glDeleteShader(s);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ void GSDeviceOGL::CreateTextureFX()
|
|||
|
||||
// warning 1 sampler by image unit. So you cannot reuse m_ps_ss...
|
||||
m_palette_ss = CreateSampler(false, false, false);
|
||||
gl_BindSampler(1, m_palette_ss);
|
||||
glBindSampler(1, m_palette_ss);
|
||||
|
||||
// Pre compile all Geometry & Vertex Shader
|
||||
// It might cost a seconds at startup but it would reduce benchmark pollution
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace PboPool {
|
|||
// (bound to GL_PIXEL_UNPACK_BUFFER_ARB, usage hint is GL_DYNAMIC_DRAW)
|
||||
// will use DMA CACHED memory as the source for buffer object operations
|
||||
void Init() {
|
||||
gl_GenBuffers(countof(m_pool), m_pool);
|
||||
glGenBuffers(countof(m_pool), m_pool);
|
||||
m_texture_storage = GLLoader::found_GL_ARB_buffer_storage;
|
||||
// Code is really faster on MT driver. So far only nvidia support it
|
||||
if (!GLLoader::nvidia_buggy_driver)
|
||||
|
@ -71,11 +71,11 @@ namespace PboPool {
|
|||
BindPbo();
|
||||
|
||||
if (m_texture_storage) {
|
||||
gl_BufferStorage(GL_PIXEL_UNPACK_BUFFER, m_pbo_size, NULL, create_flags);
|
||||
m_map[m_current_pbo] = (char*)gl_MapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, m_pbo_size, map_flags);
|
||||
glBufferStorage(GL_PIXEL_UNPACK_BUFFER, m_pbo_size, NULL, create_flags);
|
||||
m_map[m_current_pbo] = (char*)glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, m_pbo_size, map_flags);
|
||||
m_fence[m_current_pbo] = 0;
|
||||
} else {
|
||||
gl_BufferData(GL_PIXEL_UNPACK_BUFFER, m_pbo_size, NULL, GL_STREAM_COPY);
|
||||
glBufferData(GL_PIXEL_UNPACK_BUFFER, m_pbo_size, NULL, GL_STREAM_COPY);
|
||||
m_map[m_current_pbo] = NULL;
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ namespace PboPool {
|
|||
BindPbo();
|
||||
|
||||
// Be sure the map is aligned
|
||||
map = (char*)gl_MapBufferRange(GL_PIXEL_UNPACK_BUFFER, m_offset[m_current_pbo], m_size, flags);
|
||||
map = (char*)glMapBufferRange(GL_PIXEL_UNPACK_BUFFER, m_offset[m_current_pbo], m_size, flags);
|
||||
}
|
||||
|
||||
return map;
|
||||
|
@ -126,9 +126,9 @@ namespace PboPool {
|
|||
|
||||
void Unmap() {
|
||||
if (m_texture_storage) {
|
||||
gl_FlushMappedBufferRange(GL_PIXEL_UNPACK_BUFFER, m_offset[m_current_pbo], m_size);
|
||||
glFlushMappedBufferRange(GL_PIXEL_UNPACK_BUFFER, m_offset[m_current_pbo], m_size);
|
||||
} else {
|
||||
gl_UnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
||||
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,19 +141,19 @@ namespace PboPool {
|
|||
for (size_t i = 0; i < countof(m_pool); i++) {
|
||||
m_map[i] = NULL;
|
||||
m_offset[i] = 0;
|
||||
gl_DeleteSync(m_fence[i]);
|
||||
glDeleteSync(m_fence[i]);
|
||||
|
||||
// Don't know if we must do it
|
||||
gl_BindBuffer(GL_PIXEL_UNPACK_BUFFER, m_pool[i]);
|
||||
gl_UnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, m_pool[i]);
|
||||
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
|
||||
}
|
||||
gl_BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
}
|
||||
gl_DeleteBuffers(countof(m_pool), m_pool);
|
||||
glDeleteBuffers(countof(m_pool), m_pool);
|
||||
}
|
||||
|
||||
void BindPbo() {
|
||||
gl_BindBuffer(GL_PIXEL_UNPACK_BUFFER, m_pool[m_current_pbo]);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, m_pool[m_current_pbo]);
|
||||
}
|
||||
|
||||
void NextPbo() {
|
||||
|
@ -163,15 +163,15 @@ namespace PboPool {
|
|||
}
|
||||
|
||||
void NextPboWithSync() {
|
||||
m_fence[m_current_pbo] = gl_FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
m_fence[m_current_pbo] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
NextPbo();
|
||||
if (m_fence[m_current_pbo]) {
|
||||
#ifdef ENABLE_OGL_DEBUG_FENCE
|
||||
GLenum status = gl_ClientWaitSync(m_fence[m_current_pbo], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
GLenum status = glClientWaitSync(m_fence[m_current_pbo], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
#else
|
||||
gl_ClientWaitSync(m_fence[m_current_pbo], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
glClientWaitSync(m_fence[m_current_pbo], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
#endif
|
||||
gl_DeleteSync(m_fence[m_current_pbo]);
|
||||
glDeleteSync(m_fence[m_current_pbo]);
|
||||
m_fence[m_current_pbo] = 0;
|
||||
|
||||
#ifdef ENABLE_OGL_DEBUG_FENCE
|
||||
|
@ -183,7 +183,7 @@ namespace PboPool {
|
|||
}
|
||||
|
||||
void UnbindPbo() {
|
||||
gl_BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
|
||||
}
|
||||
|
||||
void EndTransfer() {
|
||||
|
@ -290,12 +290,12 @@ GSTextureOGL::GSTextureOGL(int type, int w, int h, int format, GLuint fbo_read)
|
|||
case GSTexture::Texture:
|
||||
case GSTexture::RenderTarget:
|
||||
case GSTexture::DepthStencil:
|
||||
gl_CreateTextures(GL_TEXTURE_2D, 1, &m_texture_id);
|
||||
gl_TextureStorage2D(m_texture_id, 1+GL_TEX_LEVEL_0, m_format, m_size.x, m_size.y);
|
||||
glCreateTextures(GL_TEXTURE_2D, 1, &m_texture_id);
|
||||
glTextureStorage2D(m_texture_id, 1+GL_TEX_LEVEL_0, m_format, m_size.x, m_size.y);
|
||||
if (m_format == GL_R8) {
|
||||
// Emulate DX behavior, beside it avoid special code in shader to differentiate
|
||||
// palette texture from a GL_RGBA target or a GL_R texture.
|
||||
gl_TextureParameteri(m_texture_id, GL_TEXTURE_SWIZZLE_A, GL_RED);
|
||||
glTextureParameteri(m_texture_id, GL_TEXTURE_SWIZZLE_A, GL_RED);
|
||||
}
|
||||
break;
|
||||
case GSTexture::Backbuffer:
|
||||
|
@ -325,8 +325,8 @@ GSTextureOGL::~GSTextureOGL()
|
|||
|
||||
void GSTextureOGL::Invalidate()
|
||||
{
|
||||
if (m_dirty && gl_InvalidateTexImage) {
|
||||
gl_InvalidateTexImage(m_texture_id, GL_TEX_LEVEL_0);
|
||||
if (m_dirty && glInvalidateTexImage) {
|
||||
glInvalidateTexImage(m_texture_id, GL_TEX_LEVEL_0);
|
||||
m_dirty = false;
|
||||
}
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch)
|
|||
|
||||
PboPool::Unmap();
|
||||
|
||||
gl_TextureSubImage2D(m_texture_id, GL_TEX_LEVEL_0, r.x, r.y, r.width(), r.height(), m_int_format, m_int_type, (const void*)PboPool::Offset());
|
||||
glTextureSubImage2D(m_texture_id, GL_TEX_LEVEL_0, r.x, r.y, r.width(), r.height(), m_int_format, m_int_type, (const void*)PboPool::Offset());
|
||||
|
||||
// FIXME OGL4: investigate, only 1 unpack buffer always bound
|
||||
PboPool::UnbindPbo();
|
||||
|
@ -376,7 +376,7 @@ bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch)
|
|||
glPixelStorei(GL_UNPACK_ALIGNMENT, m_int_alignment);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, pitch >> m_int_shift);
|
||||
|
||||
gl_TextureSubImage2D(m_texture_id, GL_TEX_LEVEL_0, r.x, r.y, r.width(), r.height(), m_int_format, m_int_type, data);
|
||||
glTextureSubImage2D(m_texture_id, GL_TEX_LEVEL_0, r.x, r.y, r.width(), r.height(), m_int_format, m_int_type, data);
|
||||
|
||||
// FIXME useful?
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); // Restore default behavior
|
||||
|
@ -396,17 +396,17 @@ bool GSTextureOGL::Map(GSMap& m, const GSVector4i* r)
|
|||
#if 0
|
||||
// Maybe it is as good as the code below. I don't know
|
||||
|
||||
gl_GetTextureImage(m_texture_id, GL_TEX_LEVEL_0, m_int_format, m_int_type, 1024*1024*16, m_local_buffer);
|
||||
glGetTextureImage(m_texture_id, GL_TEX_LEVEL_0, m_int_format, m_int_type, 1024*1024*16, m_local_buffer);
|
||||
|
||||
#else
|
||||
|
||||
// Bind the texture to the read framebuffer to avoid any disturbance
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
gl_FramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture_id, 0);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture_id, 0);
|
||||
|
||||
glPixelStorei(GL_PACK_ALIGNMENT, m_int_alignment);
|
||||
glReadPixels(0, 0, m_size.x, m_size.y, m_int_format, m_int_type, m_local_buffer);
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -540,16 +540,16 @@ bool GSTextureOGL::Save(const string& fn, bool dds)
|
|||
if (IsBackbuffer()) {
|
||||
glReadPixels(0, 0, m_size.x, m_size.y, GL_RGBA, GL_UNSIGNED_BYTE, image);
|
||||
} else if(IsDss()) {
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
|
||||
gl_FramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_texture_id, 0);
|
||||
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_texture_id, 0);
|
||||
glReadPixels(0, 0, m_size.x, m_size.y, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image);
|
||||
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
|
||||
fmt = GSPng::DEPTH_PNG;
|
||||
} else if(m_format == GL_R32I) {
|
||||
gl_GetTextureImage(m_texture_id, 0, GL_RED_INTEGER, GL_INT, buf_size, image);
|
||||
glGetTextureImage(m_texture_id, 0, GL_RED_INTEGER, GL_INT, buf_size, image);
|
||||
|
||||
fmt = GSPng::R32I_PNG;
|
||||
|
||||
|
@ -557,9 +557,9 @@ bool GSTextureOGL::Save(const string& fn, bool dds)
|
|||
status = false;
|
||||
|
||||
} else {
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo_read);
|
||||
|
||||
gl_FramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture_id, 0);
|
||||
glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_texture_id, 0);
|
||||
|
||||
if (m_format == GL_RGBA8) {
|
||||
glReadPixels(0, 0, m_size.x, m_size.y, GL_RGBA, GL_UNSIGNED_BYTE, image);
|
||||
|
@ -579,7 +579,7 @@ bool GSTextureOGL::Save(const string& fn, bool dds)
|
|||
status = false;
|
||||
}
|
||||
|
||||
gl_BindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_OGL_PNG
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
GSUniformBufferOGL(GLuint index, uint32 size) : index(index)
|
||||
, size(size)
|
||||
{
|
||||
gl_GenBuffers(1, &buffer);
|
||||
glGenBuffers(1, &buffer);
|
||||
bind();
|
||||
allocate();
|
||||
attach();
|
||||
|
@ -47,13 +47,13 @@ public:
|
|||
{
|
||||
if (GLState::ubo != buffer) {
|
||||
GLState::ubo = buffer;
|
||||
gl_BindBuffer(GL_UNIFORM_BUFFER, buffer);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
void allocate()
|
||||
{
|
||||
gl_BufferData(GL_UNIFORM_BUFFER, size, NULL, GL_DYNAMIC_DRAW);
|
||||
glBufferData(GL_UNIFORM_BUFFER, size, NULL, GL_DYNAMIC_DRAW);
|
||||
}
|
||||
|
||||
void attach()
|
||||
|
@ -61,7 +61,7 @@ public:
|
|||
// From the opengl manpage:
|
||||
// glBindBufferBase also binds buffer to the generic buffer binding point specified by target
|
||||
GLState::ubo = buffer;
|
||||
gl_BindBufferBase(GL_UNIFORM_BUFFER, index, buffer);
|
||||
glBindBufferBase(GL_UNIFORM_BUFFER, index, buffer);
|
||||
}
|
||||
|
||||
void upload(const void* src)
|
||||
|
@ -70,14 +70,14 @@ public:
|
|||
// glMapBufferRange allow to set various parameter but the call is
|
||||
// synchronous whereas glBufferSubData could be asynchronous.
|
||||
// TODO: investigate the extension ARB_invalidate_subdata
|
||||
gl_BufferSubData(GL_UNIFORM_BUFFER, 0, size, src);
|
||||
glBufferSubData(GL_UNIFORM_BUFFER, 0, size, src);
|
||||
#ifdef ENABLE_OGL_DEBUG_MEM_BW
|
||||
g_uniform_upload_byte += size;
|
||||
#endif
|
||||
}
|
||||
|
||||
~GSUniformBufferOGL() {
|
||||
gl_DeleteBuffers(1, &buffer);
|
||||
glDeleteBuffers(1, &buffer);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -94,7 +94,7 @@ public:
|
|||
GSUniformBufferStorageOGL(GLuint index, uint32 size) : index(index)
|
||||
, size(size), m_offset(0)
|
||||
{
|
||||
gl_GenBuffers(1, &buffer);
|
||||
glGenBuffers(1, &buffer);
|
||||
bind();
|
||||
allocate();
|
||||
attach();
|
||||
|
@ -104,7 +104,7 @@ public:
|
|||
{
|
||||
if (GLState::ubo != buffer) {
|
||||
GLState::ubo = buffer;
|
||||
gl_BindBuffer(GL_UNIFORM_BUFFER, buffer);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,8 +115,8 @@ public:
|
|||
const GLbitfield create_flags = common_flags /*| GL_CLIENT_STORAGE_BIT */;
|
||||
|
||||
GLsizei buffer_size = UBO_BUFFER_SIZE;
|
||||
gl_BufferStorage(GL_UNIFORM_BUFFER, buffer_size, NULL, create_flags);
|
||||
m_buffer_ptr = (uint8*) gl_MapBufferRange(GL_UNIFORM_BUFFER, 0, buffer_size, map_flags);
|
||||
glBufferStorage(GL_UNIFORM_BUFFER, buffer_size, NULL, create_flags);
|
||||
m_buffer_ptr = (uint8*) glMapBufferRange(GL_UNIFORM_BUFFER, 0, buffer_size, map_flags);
|
||||
ASSERT(m_buffer_ptr);
|
||||
}
|
||||
|
||||
|
@ -125,8 +125,8 @@ public:
|
|||
// From the opengl manpage:
|
||||
// glBindBufferBase also binds buffer to the generic buffer binding point specified by target
|
||||
GLState::ubo = buffer;
|
||||
//gl_BindBufferBase(GL_UNIFORM_BUFFER, index, buffer);
|
||||
gl_BindBufferRange(GL_UNIFORM_BUFFER, index, buffer, m_offset, size);
|
||||
//glBindBufferBase(GL_UNIFORM_BUFFER, index, buffer);
|
||||
glBindBufferRange(GL_UNIFORM_BUFFER, index, buffer, m_offset, size);
|
||||
}
|
||||
|
||||
void upload(const void* src)
|
||||
|
@ -138,7 +138,7 @@ public:
|
|||
memcpy(m_buffer_ptr + m_offset, src, size);
|
||||
|
||||
attach();
|
||||
gl_FlushMappedBufferRange(GL_UNIFORM_BUFFER, m_offset, size);
|
||||
glFlushMappedBufferRange(GL_UNIFORM_BUFFER, m_offset, size);
|
||||
|
||||
m_offset = (m_offset + size + 255u) & ~0xFF;
|
||||
if (m_offset >= UBO_BUFFER_SIZE)
|
||||
|
@ -147,8 +147,8 @@ public:
|
|||
|
||||
~GSUniformBufferStorageOGL() {
|
||||
bind();
|
||||
gl_UnmapBuffer(GL_UNIFORM_BUFFER);
|
||||
gl_DeleteBuffers(1, &buffer);
|
||||
glUnmapBuffer(GL_UNIFORM_BUFFER);
|
||||
glDeleteBuffers(1, &buffer);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class GSBufferOGL {
|
|||
, m_target(target)
|
||||
, m_buffer_storage(GLLoader::found_GL_ARB_buffer_storage)
|
||||
{
|
||||
gl_GenBuffers(1, &m_buffer_name);
|
||||
glGenBuffers(1, &m_buffer_name);
|
||||
// Opengl works best with 1-4MB buffer.
|
||||
// Warning m_limit is the number of object (not the size in Bytes)
|
||||
m_limit = 8 * 1024 * 1024 / m_stride;
|
||||
|
@ -73,8 +73,8 @@ class GSBufferOGL {
|
|||
const GLbitfield map_flags = common_flags | GL_MAP_FLUSH_EXPLICIT_BIT;
|
||||
const GLbitfield create_flags = common_flags | GL_CLIENT_STORAGE_BIT;
|
||||
|
||||
gl_BufferStorage(m_target, m_stride*m_limit, NULL, create_flags );
|
||||
m_buffer_ptr = (uint8*) gl_MapBufferRange(m_target, 0, m_stride*m_limit, map_flags);
|
||||
glBufferStorage(m_target, m_stride*m_limit, NULL, create_flags );
|
||||
m_buffer_ptr = (uint8*) glMapBufferRange(m_target, 0, m_stride*m_limit, map_flags);
|
||||
if (!m_buffer_ptr) {
|
||||
fprintf(stderr, "Failed to map buffer\n");
|
||||
throw GSDXError();
|
||||
|
@ -87,13 +87,13 @@ class GSBufferOGL {
|
|||
~GSBufferOGL() {
|
||||
if (m_buffer_storage) {
|
||||
for (size_t i = 0; i < 5; i++) {
|
||||
gl_DeleteSync(m_fence[i]);
|
||||
glDeleteSync(m_fence[i]);
|
||||
}
|
||||
// Don't know if we must do it
|
||||
bind();
|
||||
gl_UnmapBuffer(m_target);
|
||||
glUnmapBuffer(m_target);
|
||||
}
|
||||
gl_DeleteBuffers(1, &m_buffer_name);
|
||||
glDeleteBuffers(1, &m_buffer_name);
|
||||
}
|
||||
|
||||
void allocate() { allocate(m_limit); }
|
||||
|
@ -103,13 +103,13 @@ class GSBufferOGL {
|
|||
if (!m_buffer_storage) {
|
||||
m_start = 0;
|
||||
m_limit = new_limit;
|
||||
gl_BufferData(m_target, m_limit * m_stride, NULL, GL_STREAM_DRAW);
|
||||
glBufferData(m_target, m_limit * m_stride, NULL, GL_STREAM_DRAW);
|
||||
}
|
||||
}
|
||||
|
||||
void bind()
|
||||
{
|
||||
gl_BindBuffer(m_target, m_buffer_name);
|
||||
glBindBuffer(m_target, m_buffer_name);
|
||||
}
|
||||
|
||||
void subdata_upload(const void* src)
|
||||
|
@ -128,7 +128,7 @@ class GSBufferOGL {
|
|||
allocate(m_limit);
|
||||
}
|
||||
|
||||
gl_BufferSubData(m_target, m_stride * m_start, m_stride * m_count, src);
|
||||
glBufferSubData(m_target, m_stride * m_start, m_stride * m_count, src);
|
||||
}
|
||||
|
||||
void map_upload(const void* src)
|
||||
|
@ -146,7 +146,7 @@ class GSBufferOGL {
|
|||
#endif
|
||||
ASSERT(current_chunk > 0 && current_chunk < 5);
|
||||
if (m_fence[current_chunk] == 0) {
|
||||
m_fence[current_chunk] = gl_FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
m_fence[current_chunk] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
}
|
||||
|
||||
// Wrap at startup
|
||||
|
@ -156,14 +156,14 @@ class GSBufferOGL {
|
|||
// Only check first chunk
|
||||
if (m_fence[0]) {
|
||||
#ifdef ENABLE_OGL_DEBUG_FENCE
|
||||
GLenum status = gl_ClientWaitSync(m_fence[0], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
GLenum status = glClientWaitSync(m_fence[0], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
if (status != GL_ALREADY_SIGNALED) {
|
||||
fprintf(stderr, "%x: Sync Sync! Buffer too small\n", m_target);
|
||||
}
|
||||
#else
|
||||
gl_ClientWaitSync(m_fence[0], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
glClientWaitSync(m_fence[0], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
#endif
|
||||
gl_DeleteSync(m_fence[0]);
|
||||
glDeleteSync(m_fence[0]);
|
||||
m_fence[0] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -176,14 +176,14 @@ class GSBufferOGL {
|
|||
fprintf(stderr, "%x: Insert a fence in chunk %d\n", m_target, c-1);
|
||||
#endif
|
||||
ASSERT(c > 0 && c < 5);
|
||||
m_fence[c-1] = gl_FenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
m_fence[c-1] = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
if (m_fence[c]) {
|
||||
#ifdef ENABLE_OGL_DEBUG_FENCE
|
||||
GLenum status = gl_ClientWaitSync(m_fence[c], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
GLenum status = glClientWaitSync(m_fence[c], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
#else
|
||||
gl_ClientWaitSync(m_fence[c], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
glClientWaitSync(m_fence[c], GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
|
||||
#endif
|
||||
gl_DeleteSync(m_fence[c]);
|
||||
glDeleteSync(m_fence[c]);
|
||||
m_fence[c] = 0;
|
||||
|
||||
#ifdef ENABLE_OGL_DEBUG_FENCE
|
||||
|
@ -197,7 +197,7 @@ class GSBufferOGL {
|
|||
void* dst = m_buffer_ptr + offset;
|
||||
|
||||
memcpy(dst, src, length);
|
||||
gl_FlushMappedBufferRange(m_target, offset, length);
|
||||
glFlushMappedBufferRange(m_target, offset, length);
|
||||
}
|
||||
|
||||
void upload(const void* src, uint32 count)
|
||||
|
@ -234,12 +234,12 @@ class GSBufferOGL {
|
|||
|
||||
void Draw(GLenum mode, GLint basevertex)
|
||||
{
|
||||
gl_DrawElementsBaseVertex(mode, m_count, GL_UNSIGNED_INT, (void*)(m_start * m_stride), basevertex);
|
||||
glDrawElementsBaseVertex(mode, m_count, GL_UNSIGNED_INT, (void*)(m_start * m_stride), basevertex);
|
||||
}
|
||||
|
||||
void Draw(GLenum mode, GLint basevertex, int offset, int count)
|
||||
{
|
||||
gl_DrawElementsBaseVertex(mode, count, GL_UNSIGNED_INT, (void*)((m_start + offset) * m_stride), basevertex);
|
||||
glDrawElementsBaseVertex(mode, count, GL_UNSIGNED_INT, (void*)((m_start + offset) * m_stride), basevertex);
|
||||
}
|
||||
|
||||
size_t GetStart() { return m_start; }
|
||||
|
@ -256,8 +256,8 @@ class GSVertexBufferStateOGL {
|
|||
public:
|
||||
GSVertexBufferStateOGL(size_t stride, GSInputLayoutOGL* layout, uint32 layout_nbr) : m_vb(NULL), m_ib(NULL), m_topology(0)
|
||||
{
|
||||
gl_GenVertexArrays(1, &m_va);
|
||||
gl_BindVertexArray(m_va);
|
||||
glGenVertexArrays(1, &m_va);
|
||||
glBindVertexArray(m_va);
|
||||
|
||||
m_vb = new GSBufferOGL(GL_ARRAY_BUFFER, stride);
|
||||
m_ib = new GSBufferOGL(GL_ELEMENT_ARRAY_BUFFER, sizeof(uint32));
|
||||
|
@ -273,7 +273,7 @@ public:
|
|||
void bind()
|
||||
{
|
||||
// Note: index array are part of the VA state so it need to be bound only once.
|
||||
gl_BindVertexArray(m_va);
|
||||
glBindVertexArray(m_va);
|
||||
if (m_vb)
|
||||
m_vb->bind();
|
||||
}
|
||||
|
@ -282,19 +282,19 @@ public:
|
|||
{
|
||||
for (uint32 i = 0; i < layout_nbr; i++) {
|
||||
// Note this function need both a vertex array object and a GL_ARRAY_BUFFER buffer
|
||||
gl_EnableVertexAttribArray(i);
|
||||
glEnableVertexAttribArray(i);
|
||||
switch (layout[i].type) {
|
||||
case GL_UNSIGNED_SHORT:
|
||||
case GL_UNSIGNED_INT:
|
||||
if (layout[i].normalize) {
|
||||
gl_VertexAttribPointer(i, layout[i].size, layout[i].type, layout[i].normalize, layout[i].stride, layout[i].offset);
|
||||
glVertexAttribPointer(i, layout[i].size, layout[i].type, layout[i].normalize, layout[i].stride, layout[i].offset);
|
||||
} else {
|
||||
// Rule: when shader use integral (not normalized) you must use gl_VertexAttribIPointer (note the extra I)
|
||||
gl_VertexAttribIPointer(i, layout[i].size, layout[i].type, layout[i].stride, layout[i].offset);
|
||||
// Rule: when shader use integral (not normalized) you must use glVertexAttribIPointer (note the extra I)
|
||||
glVertexAttribIPointer(i, layout[i].size, layout[i].type, layout[i].stride, layout[i].offset);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
gl_VertexAttribPointer(i, layout[i].size, layout[i].type, layout[i].normalize, layout[i].stride, layout[i].offset);
|
||||
glVertexAttribPointer(i, layout[i].size, layout[i].type, layout[i].normalize, layout[i].stride, layout[i].offset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -324,7 +324,7 @@ public:
|
|||
|
||||
~GSVertexBufferStateOGL()
|
||||
{
|
||||
gl_DeleteVertexArrays(1, &m_va);
|
||||
glDeleteVertexArrays(1, &m_va);
|
||||
delete m_vb;
|
||||
delete m_ib;
|
||||
}
|
||||
|
|
|
@ -25,132 +25,130 @@
|
|||
|
||||
void GSWndGL::PopulateGlFunction()
|
||||
{
|
||||
*(void**)&(gl_ActiveTexture) = GetProcAddress("glActiveTexture");
|
||||
*(void**)&(gl_BlendColor) = GetProcAddress("glBlendColor");
|
||||
*(void**)&(gl_BlendEquationSeparate) = GetProcAddress("glBlendEquationSeparate");
|
||||
*(void**)&(gl_BlendFuncSeparate) = GetProcAddress("glBlendFuncSeparate");
|
||||
*(void**)&(gl_AttachShader) = GetProcAddress("glAttachShader");
|
||||
*(void**)&(gl_BindBuffer) = GetProcAddress("glBindBuffer");
|
||||
*(void**)&(gl_BindBufferBase) = GetProcAddress("glBindBufferBase");
|
||||
*(void**)&(gl_BindBufferRange) = GetProcAddress("glBindBufferRange");
|
||||
*(void**)&(gl_BindFramebuffer) = GetProcAddress("glBindFramebuffer");
|
||||
*(void**)&(gl_BindSampler) = GetProcAddress("glBindSampler");
|
||||
*(void**)&(gl_BindVertexArray) = GetProcAddress("glBindVertexArray");
|
||||
*(void**)&(gl_BlitFramebuffer) = GetProcAddress("glBlitFramebuffer");
|
||||
*(void**)&(gl_BufferData) = GetProcAddress("glBufferData");
|
||||
*(void**)&(gl_CheckFramebufferStatus) = GetProcAddress("glCheckFramebufferStatus");
|
||||
*(void**)&(gl_ClearBufferfv) = GetProcAddress("glClearBufferfv");
|
||||
*(void**)&(gl_ClearBufferiv) = GetProcAddress("glClearBufferiv");
|
||||
*(void**)&(gl_ClearBufferuiv) = GetProcAddress("glClearBufferuiv");
|
||||
*(void**)&(gl_ColorMaski) = GetProcAddress("glColorMaski");
|
||||
*(void**)&(gl_DeleteBuffers) = GetProcAddress("glDeleteBuffers");
|
||||
*(void**)&(gl_DeleteFramebuffers) = GetProcAddress("glDeleteFramebuffers");
|
||||
*(void**)&(gl_DeleteSamplers) = GetProcAddress("glDeleteSamplers");
|
||||
*(void**)&(gl_DeleteVertexArrays) = GetProcAddress("glDeleteVertexArrays");
|
||||
*(void**)&(gl_DetachShader) = GetProcAddress("glDetachShader");
|
||||
*(void**)&(gl_DrawBuffers) = GetProcAddress("glDrawBuffers");
|
||||
*(void**)&(gl_DrawElementsBaseVertex) = GetProcAddress("glDrawElementsBaseVertex");
|
||||
*(void**)&(gl_EnableVertexAttribArray) = GetProcAddress("glEnableVertexAttribArray");
|
||||
*(void**)&(gl_FramebufferRenderbuffer) = GetProcAddress("glFramebufferRenderbuffer");
|
||||
*(void**)&(gl_FramebufferTexture2D) = GetProcAddress("glFramebufferTexture2D");
|
||||
*(void**)&(gl_GenBuffers) = GetProcAddress("glGenBuffers");
|
||||
*(void**)&(gl_GenFramebuffers) = GetProcAddress("glGenFramebuffers");
|
||||
*(void**)&(gl_GenSamplers) = GetProcAddress("glGenSamplers");
|
||||
*(void**)&(gl_GenVertexArrays) = GetProcAddress("glGenVertexArrays");
|
||||
*(void**)&(gl_GetBufferParameteriv) = GetProcAddress("glGetBufferParameteriv");
|
||||
*(void**)&(gl_GetDebugMessageLogARB) = GetProcAddress("glGetDebugMessageLogARB");
|
||||
*(void**)&(gl_DebugMessageCallback) = GetProcAddress("glDebugMessageCallback", true);
|
||||
*(void**)&(gl_GetProgramInfoLog) = GetProcAddress("glGetProgramInfoLog");
|
||||
*(void**)&(gl_GetProgramiv) = GetProcAddress("glGetProgramiv");
|
||||
*(void**)&(gl_GetShaderiv) = GetProcAddress("glGetShaderiv");
|
||||
*(void**)&(gl_GetStringi) = GetProcAddress("glGetStringi");
|
||||
*(void**)&(gl_IsFramebuffer) = GetProcAddress("glIsFramebuffer");
|
||||
*(void**)&(gl_MapBuffer) = GetProcAddress("glMapBuffer");
|
||||
*(void**)&(gl_MapBufferRange) = GetProcAddress("glMapBufferRange");
|
||||
*(void**)&(gl_ProgramParameteri) = GetProcAddress("glProgramParameteri");
|
||||
*(void**)&(gl_SamplerParameterf) = GetProcAddress("glSamplerParameterf");
|
||||
*(void**)&(gl_SamplerParameteri) = GetProcAddress("glSamplerParameteri");
|
||||
*(void**)&(gl_ShaderSource) = GetProcAddress("glShaderSource");
|
||||
*(void**)&(gl_Uniform1i) = GetProcAddress("glUniform1i");
|
||||
*(void**)&(gl_UnmapBuffer) = GetProcAddress("glUnmapBuffer");
|
||||
*(void**)&(gl_VertexAttribIPointer) = GetProcAddress("glVertexAttribIPointer");
|
||||
*(void**)&(gl_VertexAttribPointer) = GetProcAddress("glVertexAttribPointer");
|
||||
*(void**)&(gl_BufferSubData) = GetProcAddress("glBufferSubData");
|
||||
*(void**)&(gl_FenceSync) = GetProcAddress("glFenceSync");
|
||||
*(void**)&(gl_DeleteSync) = GetProcAddress("glDeleteSync");
|
||||
*(void**)&(gl_ClientWaitSync) = GetProcAddress("glClientWaitSync");
|
||||
*(void**)&(gl_FlushMappedBufferRange) = GetProcAddress("glFlushMappedBufferRange");
|
||||
*(void**)&(glBlendEquationSeparate) = GetProcAddress("glBlendEquationSeparate");
|
||||
*(void**)&(glBlendFuncSeparate) = GetProcAddress("glBlendFuncSeparate");
|
||||
*(void**)&(glAttachShader) = GetProcAddress("glAttachShader");
|
||||
*(void**)&(glBindBuffer) = GetProcAddress("glBindBuffer");
|
||||
*(void**)&(glBindBufferBase) = GetProcAddress("glBindBufferBase");
|
||||
*(void**)&(glBindBufferRange) = GetProcAddress("glBindBufferRange");
|
||||
*(void**)&(glBindFramebuffer) = GetProcAddress("glBindFramebuffer");
|
||||
*(void**)&(glBindSampler) = GetProcAddress("glBindSampler");
|
||||
*(void**)&(glBindVertexArray) = GetProcAddress("glBindVertexArray");
|
||||
*(void**)&(glBlitFramebuffer) = GetProcAddress("glBlitFramebuffer");
|
||||
*(void**)&(glBufferData) = GetProcAddress("glBufferData");
|
||||
*(void**)&(glCheckFramebufferStatus) = GetProcAddress("glCheckFramebufferStatus");
|
||||
*(void**)&(glClearBufferfv) = GetProcAddress("glClearBufferfv");
|
||||
*(void**)&(glClearBufferiv) = GetProcAddress("glClearBufferiv");
|
||||
*(void**)&(glClearBufferuiv) = GetProcAddress("glClearBufferuiv");
|
||||
*(void**)&(glColorMaski) = GetProcAddress("glColorMaski");
|
||||
*(void**)&(glDeleteBuffers) = GetProcAddress("glDeleteBuffers");
|
||||
*(void**)&(glDeleteFramebuffers) = GetProcAddress("glDeleteFramebuffers");
|
||||
*(void**)&(glDeleteSamplers) = GetProcAddress("glDeleteSamplers");
|
||||
*(void**)&(glDeleteVertexArrays) = GetProcAddress("glDeleteVertexArrays");
|
||||
*(void**)&(glDetachShader) = GetProcAddress("glDetachShader");
|
||||
*(void**)&(glDrawBuffers) = GetProcAddress("glDrawBuffers");
|
||||
*(void**)&(glDrawElementsBaseVertex) = GetProcAddress("glDrawElementsBaseVertex");
|
||||
*(void**)&(glEnableVertexAttribArray) = GetProcAddress("glEnableVertexAttribArray");
|
||||
*(void**)&(glFramebufferRenderbuffer) = GetProcAddress("glFramebufferRenderbuffer");
|
||||
*(void**)&(glFramebufferTexture2D) = GetProcAddress("glFramebufferTexture2D");
|
||||
*(void**)&(glGenBuffers) = GetProcAddress("glGenBuffers");
|
||||
*(void**)&(glGenFramebuffers) = GetProcAddress("glGenFramebuffers");
|
||||
*(void**)&(glGenSamplers) = GetProcAddress("glGenSamplers");
|
||||
*(void**)&(glGenVertexArrays) = GetProcAddress("glGenVertexArrays");
|
||||
*(void**)&(glGetBufferParameteriv) = GetProcAddress("glGetBufferParameteriv");
|
||||
*(void**)&(glGetDebugMessageLogARB) = GetProcAddress("glGetDebugMessageLogARB");
|
||||
*(void**)&(glDebugMessageCallback) = GetProcAddress("glDebugMessageCallback", true);
|
||||
*(void**)&(glGetProgramInfoLog) = GetProcAddress("glGetProgramInfoLog");
|
||||
*(void**)&(glGetProgramiv) = GetProcAddress("glGetProgramiv");
|
||||
*(void**)&(glGetShaderiv) = GetProcAddress("glGetShaderiv");
|
||||
*(void**)&(glGetStringi) = GetProcAddress("glGetStringi");
|
||||
*(void**)&(glIsFramebuffer) = GetProcAddress("glIsFramebuffer");
|
||||
*(void**)&(glMapBuffer) = GetProcAddress("glMapBuffer");
|
||||
*(void**)&(glMapBufferRange) = GetProcAddress("glMapBufferRange");
|
||||
*(void**)&(glProgramParameteri) = GetProcAddress("glProgramParameteri");
|
||||
*(void**)&(glSamplerParameterf) = GetProcAddress("glSamplerParameterf");
|
||||
*(void**)&(glSamplerParameteri) = GetProcAddress("glSamplerParameteri");
|
||||
*(void**)&(glShaderSource) = GetProcAddress("glShaderSource");
|
||||
*(void**)&(glUniform1i) = GetProcAddress("glUniform1i");
|
||||
*(void**)&(glUnmapBuffer) = GetProcAddress("glUnmapBuffer");
|
||||
*(void**)&(glVertexAttribIPointer) = GetProcAddress("glVertexAttribIPointer");
|
||||
*(void**)&(glVertexAttribPointer) = GetProcAddress("glVertexAttribPointer");
|
||||
*(void**)&(glBufferSubData) = GetProcAddress("glBufferSubData");
|
||||
*(void**)&(glFenceSync) = GetProcAddress("glFenceSync");
|
||||
*(void**)&(glDeleteSync) = GetProcAddress("glDeleteSync");
|
||||
*(void**)&(glClientWaitSync) = GetProcAddress("glClientWaitSync");
|
||||
*(void**)&(glFlushMappedBufferRange) = GetProcAddress("glFlushMappedBufferRange");
|
||||
// GL4.0
|
||||
*(void**)&(gl_BlendEquationSeparateiARB) = GetProcAddress("glBlendEquationSeparateiARB", true);
|
||||
*(void**)&(gl_BlendFuncSeparateiARB) = GetProcAddress("glBlendFuncSeparateiARB", true);
|
||||
*(void**)&(glBlendEquationSeparateiARB) = GetProcAddress("glBlendEquationSeparateiARB", true);
|
||||
*(void**)&(glBlendFuncSeparateiARB) = GetProcAddress("glBlendFuncSeparateiARB", true);
|
||||
// GL4.1
|
||||
*(void**)&(gl_CreateShaderProgramv) = GetProcAddress("glCreateShaderProgramv", true);
|
||||
*(void**)&(gl_BindProgramPipeline) = GetProcAddress("glBindProgramPipeline", true);
|
||||
*(void**)&(gl_DeleteProgramPipelines) = GetProcAddress("glDeleteProgramPipelines", true);
|
||||
*(void**)&(gl_GenProgramPipelines) = GetProcAddress("glGenProgramPipelines", true);
|
||||
*(void**)&(gl_GetProgramPipelineiv) = GetProcAddress("glGetProgramPipelineiv", true);
|
||||
*(void**)&(gl_GetProgramPipelineInfoLog) = GetProcAddress("glGetProgramPipelineInfoLog", true);
|
||||
*(void**)&(gl_ValidateProgramPipeline) = GetProcAddress("glValidateProgramPipeline", true);
|
||||
*(void**)&(gl_UseProgramStages) = GetProcAddress("glUseProgramStages", true);
|
||||
*(void**)&(gl_ProgramUniform1i) = GetProcAddress("glProgramUniform1i", true); // but no GL4.2
|
||||
*(void**)&(gl_GetProgramBinary) = GetProcAddress("glGetProgramBinary", true);
|
||||
*(void**)&(glCreateShaderProgramv) = GetProcAddress("glCreateShaderProgramv", true);
|
||||
*(void**)&(glBindProgramPipeline) = GetProcAddress("glBindProgramPipeline", true);
|
||||
*(void**)&(glDeleteProgramPipelines) = GetProcAddress("glDeleteProgramPipelines", true);
|
||||
*(void**)&(glGenProgramPipelines) = GetProcAddress("glGenProgramPipelines", true);
|
||||
*(void**)&(glGetProgramPipelineiv) = GetProcAddress("glGetProgramPipelineiv", true);
|
||||
*(void**)&(glGetProgramPipelineInfoLog) = GetProcAddress("glGetProgramPipelineInfoLog", true);
|
||||
*(void**)&(glValidateProgramPipeline) = GetProcAddress("glValidateProgramPipeline", true);
|
||||
*(void**)&(glUseProgramStages) = GetProcAddress("glUseProgramStages", true);
|
||||
*(void**)&(glProgramUniform1i) = GetProcAddress("glProgramUniform1i", true); // but no GL4.2
|
||||
*(void**)&(glGetProgramBinary) = GetProcAddress("glGetProgramBinary", true);
|
||||
// NO GL4.1
|
||||
*(void**)&(gl_DeleteProgram) = GetProcAddress("glDeleteProgram");
|
||||
*(void**)&(gl_DeleteShader) = GetProcAddress("glDeleteShader");
|
||||
*(void**)&(gl_CompileShader) = GetProcAddress("glCompileShader");
|
||||
*(void**)&(gl_CreateProgram) = GetProcAddress("glCreateProgram");
|
||||
*(void**)&(gl_CreateShader) = GetProcAddress("glCreateShader");
|
||||
*(void**)&(gl_UseProgram) = GetProcAddress("glUseProgram");
|
||||
*(void**)&(gl_GetShaderInfoLog) = GetProcAddress("glGetShaderInfoLog");
|
||||
*(void**)&(gl_LinkProgram) = GetProcAddress("glLinkProgram");
|
||||
*(void**)&(glDeleteProgram) = GetProcAddress("glDeleteProgram");
|
||||
*(void**)&(glDeleteShader) = GetProcAddress("glDeleteShader");
|
||||
*(void**)&(glCompileShader) = GetProcAddress("glCompileShader");
|
||||
*(void**)&(glCreateProgram) = GetProcAddress("glCreateProgram");
|
||||
*(void**)&(glCreateShader) = GetProcAddress("glCreateShader");
|
||||
*(void**)&(glUseProgram) = GetProcAddress("glUseProgram");
|
||||
*(void**)&(glGetShaderInfoLog) = GetProcAddress("glGetShaderInfoLog");
|
||||
*(void**)&(glLinkProgram) = GetProcAddress("glLinkProgram");
|
||||
// GL4.2
|
||||
*(void**)&(gl_BindImageTexture) = GetProcAddress("glBindImageTexture", true);
|
||||
*(void**)&(gl_MemoryBarrier) = GetProcAddress("glMemoryBarrier", true);
|
||||
*(void**)&(gl_TexStorage2D) = GetProcAddress("glTexStorage2D");
|
||||
*(void**)&(glBindImageTexture) = GetProcAddress("glBindImageTexture", true);
|
||||
*(void**)&(glMemoryBarrier) = GetProcAddress("glMemoryBarrier", true);
|
||||
*(void**)&(glTexStorage2D) = GetProcAddress("glTexStorage2D");
|
||||
// GL4.3
|
||||
*(void**)&(gl_CopyImageSubData) = GetProcAddress("glCopyImageSubData", true);
|
||||
*(void**)&(gl_InvalidateTexImage) = GetProcAddress("glInvalidateTexImage", true);
|
||||
*(void**)&(gl_PushDebugGroup) = GetProcAddress("glPushDebugGroup", true);
|
||||
*(void**)&(gl_PopDebugGroup) = GetProcAddress("glPopDebugGroup", true);
|
||||
*(void**)&(gl_DebugMessageInsert) = GetProcAddress("glDebugMessageInsert", true);
|
||||
*(void**)&(glCopyImageSubData) = GetProcAddress("glCopyImageSubData", true);
|
||||
*(void**)&(glInvalidateTexImage) = GetProcAddress("glInvalidateTexImage", true);
|
||||
*(void**)&(glPushDebugGroup) = GetProcAddress("glPushDebugGroup", true);
|
||||
*(void**)&(glPopDebugGroup) = GetProcAddress("glPopDebugGroup", true);
|
||||
*(void**)&(glDebugMessageInsert) = GetProcAddress("glDebugMessageInsert", true);
|
||||
// GL4.4
|
||||
*(void**)&(gl_ClearTexImage) = GetProcAddress("glClearTexImage", true);
|
||||
*(void**)&(gl_BufferStorage) = GetProcAddress("glBufferStorage", true);
|
||||
*(void**)&(glClearTexImage) = GetProcAddress("glClearTexImage", true);
|
||||
*(void**)&(glBufferStorage) = GetProcAddress("glBufferStorage", true);
|
||||
|
||||
// GL4.5
|
||||
*(void**)&(gl_CreateTextures) = GetProcAddress("glCreateTextures", true);
|
||||
*(void**)&(gl_TextureStorage2D) = GetProcAddress("glTextureStorage2D", true);
|
||||
*(void**)&(gl_TextureSubImage2D) = GetProcAddress("glTextureSubImage2D", true);
|
||||
*(void**)&(gl_CopyTextureSubImage2D) = GetProcAddress("glCopyTextureSubImage2D", true);
|
||||
*(void**)&(gl_BindTextureUnit) = GetProcAddress("glBindTextureUnit", true);
|
||||
*(void**)&(gl_GetTextureImage) = GetProcAddress("glGetTextureImage", true);
|
||||
*(void**)&(gl_TextureParameteri) = GetProcAddress("glTextureParameteri", true);
|
||||
*(void**)&(glCreateTextures) = GetProcAddress("glCreateTextures", true);
|
||||
*(void**)&(glTextureStorage2D) = GetProcAddress("glTextureStorage2D", true);
|
||||
*(void**)&(glTextureSubImage2D) = GetProcAddress("glTextureSubImage2D", true);
|
||||
*(void**)&(glCopyTextureSubImage2D) = GetProcAddress("glCopyTextureSubImage2D", true);
|
||||
*(void**)&(glBindTextureUnit) = GetProcAddress("glBindTextureUnit", true);
|
||||
*(void**)&(glGetTextureImage) = GetProcAddress("glGetTextureImage", true);
|
||||
*(void**)&(glTextureParameteri) = GetProcAddress("glTextureParameteri", true);
|
||||
|
||||
*(void**)&(gl_CreateFramebuffers) = GetProcAddress("glCreateFramebuffers", true);
|
||||
*(void**)&(gl_ClearNamedFramebufferfv) = GetProcAddress("glClearNamedFramebufferfv", true);
|
||||
*(void**)&(gl_ClearNamedFramebufferuiv) = GetProcAddress("glClearNamedFramebufferuiv", true);
|
||||
*(void**)&(gl_ClearNamedFramebufferiv) = GetProcAddress("glClearNamedFramebufferiv", true);
|
||||
*(void**)&(gl_NamedFramebufferTexture) = GetProcAddress("glNamedFramebufferTexture", true);
|
||||
*(void**)&(gl_NamedFramebufferDrawBuffers) = GetProcAddress("glNamedFramebufferDrawBuffers", true);
|
||||
*(void**)&(gl_NamedFramebufferReadBuffer) = GetProcAddress("glNamedFramebufferReadBuffer", true);
|
||||
*(void**)&(gl_CheckNamedFramebufferStatus) = GetProcAddress("glCheckNamedFramebufferStatus", true);
|
||||
*(void**)&(glCreateFramebuffers) = GetProcAddress("glCreateFramebuffers", true);
|
||||
*(void**)&(glClearNamedFramebufferfv) = GetProcAddress("glClearNamedFramebufferfv", true);
|
||||
*(void**)&(glClearNamedFramebufferuiv) = GetProcAddress("glClearNamedFramebufferuiv", true);
|
||||
*(void**)&(glClearNamedFramebufferiv) = GetProcAddress("glClearNamedFramebufferiv", true);
|
||||
*(void**)&(glNamedFramebufferTexture) = GetProcAddress("glNamedFramebufferTexture", true);
|
||||
*(void**)&(glNamedFramebufferDrawBuffers) = GetProcAddress("glNamedFramebufferDrawBuffers", true);
|
||||
*(void**)&(glNamedFramebufferReadBuffer) = GetProcAddress("glNamedFramebufferReadBuffer", true);
|
||||
*(void**)&(glCheckNamedFramebufferStatus) = GetProcAddress("glCheckNamedFramebufferStatus", true);
|
||||
|
||||
*(void**)&(gl_CreateBuffers) = GetProcAddress("glCreateBuffers", true);
|
||||
*(void**)&(gl_NamedBufferStorage) = GetProcAddress("glNamedBufferStorage", true);
|
||||
*(void**)&(gl_NamedBufferData) = GetProcAddress("glNamedBufferData", true);
|
||||
*(void**)&(gl_NamedBufferSubData) = GetProcAddress("glNamedBufferSubData", true);
|
||||
*(void**)&(gl_MapNamedBuffer) = GetProcAddress("glMapNamedBuffer", true);
|
||||
*(void**)&(gl_MapNamedBufferRange) = GetProcAddress("glMapNamedBufferRange", true);
|
||||
*(void**)&(gl_UnmapNamedBuffer) = GetProcAddress("glUnmapNamedBuffer", true);
|
||||
*(void**)&(gl_FlushMappedNamedBufferRange) = GetProcAddress("glFlushMappedNamedBufferRange", true);
|
||||
*(void**)&(glCreateBuffers) = GetProcAddress("glCreateBuffers", true);
|
||||
*(void**)&(glNamedBufferStorage) = GetProcAddress("glNamedBufferStorage", true);
|
||||
*(void**)&(glNamedBufferData) = GetProcAddress("glNamedBufferData", true);
|
||||
*(void**)&(glNamedBufferSubData) = GetProcAddress("glNamedBufferSubData", true);
|
||||
*(void**)&(glMapNamedBuffer) = GetProcAddress("glMapNamedBuffer", true);
|
||||
*(void**)&(glMapNamedBufferRange) = GetProcAddress("glMapNamedBufferRange", true);
|
||||
*(void**)&(glUnmapNamedBuffer) = GetProcAddress("glUnmapNamedBuffer", true);
|
||||
*(void**)&(glFlushMappedNamedBufferRange) = GetProcAddress("glFlushMappedNamedBufferRange", true);
|
||||
|
||||
*(void**)&(gl_CreateSamplers) = GetProcAddress("glCreateSamplers", true);
|
||||
*(void**)&(gl_CreateProgramPipelines) = GetProcAddress("glCreateProgramPipelines", true);
|
||||
*(void**)&(glCreateSamplers) = GetProcAddress("glCreateSamplers", true);
|
||||
*(void**)&(glCreateProgramPipelines) = GetProcAddress("glCreateProgramPipelines", true);
|
||||
|
||||
*(void**)&(gl_ClipControl) = GetProcAddress("glClipControl", true);
|
||||
*(void**)&(gl_TextureBarrier) = GetProcAddress("glTextureBarrier", true);
|
||||
*(void**)&(glClipControl) = GetProcAddress("glClipControl", true);
|
||||
*(void**)&(glTextureBarrier) = GetProcAddress("glTextureBarrier", true);
|
||||
|
||||
if (gl_CreateFramebuffers == NULL) {
|
||||
if (glCreateFramebuffers == NULL) {
|
||||
Emulate_DSA::Init();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -493,7 +493,7 @@ extern void vmfree(void* ptr, size_t size);
|
|||
#endif
|
||||
|
||||
#define GL_INSERT(type, code, sev, ...) \
|
||||
do if (gl_DebugMessageInsert) gl_DebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, type, code, sev, -1, format(__VA_ARGS__).c_str()); while(0);
|
||||
do if (glDebugMessageInsert) glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, type, code, sev, -1, format(__VA_ARGS__).c_str()); while(0);
|
||||
|
||||
// Except apple any sane driver support this extension
|
||||
#if defined(_DEBUG)
|
||||
|
@ -503,8 +503,8 @@ extern void vmfree(void* ptr, size_t size);
|
|||
#endif
|
||||
|
||||
#if defined(ENABLE_OGL_DEBUG)
|
||||
#define GL_PUSH(...) do if (gl_PushDebugGroup) gl_PushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0xBAD, -1, format(__VA_ARGS__).c_str()); while(0);
|
||||
#define GL_POP() do if (gl_PopDebugGroup) gl_PopDebugGroup(); while(0);
|
||||
#define GL_PUSH(...) do if (glPushDebugGroup) glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0xBAD, -1, format(__VA_ARGS__).c_str()); while(0);
|
||||
#define GL_POP() do if (glPopDebugGroup) glPopDebugGroup(); while(0);
|
||||
#define GL_INS(...) GL_INSERT(GL_DEBUG_TYPE_ERROR, 0xDEAD, GL_DEBUG_SEVERITY_MEDIUM, __VA_ARGS__)
|
||||
#define GL_PERF(...) GL_INSERT(GL_DEBUG_TYPE_PERFORMANCE, 0xFEE1, GL_DEBUG_SEVERITY_NOTIFICATION, __VA_ARGS__)
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue