mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: create a small macro to load function pointers
This commit is contained in:
parent
95ef4e20f8
commit
de7d127c52
|
@ -28,143 +28,148 @@ void GSWndGL::PopulateGlFunction()
|
||||||
*(void**)&(gl_ActiveTexture) = GetProcAddress("glActiveTexture");
|
*(void**)&(gl_ActiveTexture) = GetProcAddress("glActiveTexture");
|
||||||
*(void**)&(gl_BlendColor) = GetProcAddress("glBlendColor");
|
*(void**)&(gl_BlendColor) = GetProcAddress("glBlendColor");
|
||||||
|
|
||||||
*(void**)&(glBlendEquationSeparate) = GetProcAddress("glBlendEquationSeparate");
|
// Load mandatory function pointer
|
||||||
*(void**)&(glBlendFuncSeparate) = GetProcAddress("glBlendFuncSeparate");
|
#define GL_EXT_LOAD_OPT(ext) *(void**)&(ext) = GetProcAddress(#ext, true)
|
||||||
*(void**)&(glAttachShader) = GetProcAddress("glAttachShader");
|
// Load extra function pointer
|
||||||
*(void**)&(glBindBuffer) = GetProcAddress("glBindBuffer");
|
#define GL_EXT_LOAD(ext) *(void**)&(ext) = GetProcAddress(#ext, true)
|
||||||
*(void**)&(glBindBufferBase) = GetProcAddress("glBindBufferBase");
|
|
||||||
*(void**)&(glBindBufferRange) = GetProcAddress("glBindBufferRange");
|
GL_EXT_LOAD(glBlendEquationSeparate);
|
||||||
*(void**)&(glBindFramebuffer) = GetProcAddress("glBindFramebuffer");
|
GL_EXT_LOAD(glBlendFuncSeparate);
|
||||||
*(void**)&(glBindSampler) = GetProcAddress("glBindSampler");
|
GL_EXT_LOAD(glAttachShader);
|
||||||
*(void**)&(glBindVertexArray) = GetProcAddress("glBindVertexArray");
|
GL_EXT_LOAD(glBindBuffer);
|
||||||
*(void**)&(glBlitFramebuffer) = GetProcAddress("glBlitFramebuffer");
|
GL_EXT_LOAD(glBindBufferBase);
|
||||||
*(void**)&(glBufferData) = GetProcAddress("glBufferData");
|
GL_EXT_LOAD(glBindBufferRange);
|
||||||
*(void**)&(glCheckFramebufferStatus) = GetProcAddress("glCheckFramebufferStatus");
|
GL_EXT_LOAD(glBindFramebuffer);
|
||||||
*(void**)&(glClearBufferfv) = GetProcAddress("glClearBufferfv");
|
GL_EXT_LOAD(glBindSampler);
|
||||||
*(void**)&(glClearBufferiv) = GetProcAddress("glClearBufferiv");
|
GL_EXT_LOAD(glBindVertexArray);
|
||||||
*(void**)&(glClearBufferuiv) = GetProcAddress("glClearBufferuiv");
|
GL_EXT_LOAD(glBlitFramebuffer);
|
||||||
*(void**)&(glColorMaski) = GetProcAddress("glColorMaski");
|
GL_EXT_LOAD(glBufferData);
|
||||||
*(void**)&(glDeleteBuffers) = GetProcAddress("glDeleteBuffers");
|
GL_EXT_LOAD(glCheckFramebufferStatus);
|
||||||
*(void**)&(glDeleteFramebuffers) = GetProcAddress("glDeleteFramebuffers");
|
GL_EXT_LOAD(glClearBufferfv);
|
||||||
*(void**)&(glDeleteSamplers) = GetProcAddress("glDeleteSamplers");
|
GL_EXT_LOAD(glClearBufferiv);
|
||||||
*(void**)&(glDeleteVertexArrays) = GetProcAddress("glDeleteVertexArrays");
|
GL_EXT_LOAD(glClearBufferuiv);
|
||||||
*(void**)&(glDetachShader) = GetProcAddress("glDetachShader");
|
GL_EXT_LOAD(glColorMaski);
|
||||||
*(void**)&(glDrawBuffers) = GetProcAddress("glDrawBuffers");
|
GL_EXT_LOAD(glDeleteBuffers);
|
||||||
*(void**)&(glDrawElementsBaseVertex) = GetProcAddress("glDrawElementsBaseVertex");
|
GL_EXT_LOAD(glDeleteFramebuffers);
|
||||||
*(void**)&(glEnableVertexAttribArray) = GetProcAddress("glEnableVertexAttribArray");
|
GL_EXT_LOAD(glDeleteSamplers);
|
||||||
*(void**)&(glFramebufferRenderbuffer) = GetProcAddress("glFramebufferRenderbuffer");
|
GL_EXT_LOAD(glDeleteVertexArrays);
|
||||||
*(void**)&(glFramebufferTexture2D) = GetProcAddress("glFramebufferTexture2D");
|
GL_EXT_LOAD(glDetachShader);
|
||||||
*(void**)&(glGenBuffers) = GetProcAddress("glGenBuffers");
|
GL_EXT_LOAD(glDrawBuffers);
|
||||||
*(void**)&(glGenFramebuffers) = GetProcAddress("glGenFramebuffers");
|
GL_EXT_LOAD(glDrawElementsBaseVertex);
|
||||||
*(void**)&(glGenSamplers) = GetProcAddress("glGenSamplers");
|
GL_EXT_LOAD(glEnableVertexAttribArray);
|
||||||
*(void**)&(glGenVertexArrays) = GetProcAddress("glGenVertexArrays");
|
GL_EXT_LOAD(glFramebufferRenderbuffer);
|
||||||
*(void**)&(glGetBufferParameteriv) = GetProcAddress("glGetBufferParameteriv");
|
GL_EXT_LOAD(glFramebufferTexture2D);
|
||||||
*(void**)&(glGetDebugMessageLogARB) = GetProcAddress("glGetDebugMessageLogARB");
|
GL_EXT_LOAD(glGenBuffers);
|
||||||
*(void**)&(glDebugMessageCallback) = GetProcAddress("glDebugMessageCallback", true);
|
GL_EXT_LOAD(glGenFramebuffers);
|
||||||
*(void**)&(glGetProgramInfoLog) = GetProcAddress("glGetProgramInfoLog");
|
GL_EXT_LOAD(glGenSamplers);
|
||||||
*(void**)&(glGetProgramiv) = GetProcAddress("glGetProgramiv");
|
GL_EXT_LOAD(glGenVertexArrays);
|
||||||
*(void**)&(glGetShaderiv) = GetProcAddress("glGetShaderiv");
|
GL_EXT_LOAD(glGetBufferParameteriv);
|
||||||
*(void**)&(glGetStringi) = GetProcAddress("glGetStringi");
|
GL_EXT_LOAD(glGetDebugMessageLogARB);
|
||||||
*(void**)&(glIsFramebuffer) = GetProcAddress("glIsFramebuffer");
|
GL_EXT_LOAD_OPT(glDebugMessageCallback);
|
||||||
*(void**)&(glMapBuffer) = GetProcAddress("glMapBuffer");
|
GL_EXT_LOAD(glGetProgramInfoLog);
|
||||||
*(void**)&(glMapBufferRange) = GetProcAddress("glMapBufferRange");
|
GL_EXT_LOAD(glGetProgramiv);
|
||||||
*(void**)&(glProgramParameteri) = GetProcAddress("glProgramParameteri");
|
GL_EXT_LOAD(glGetShaderiv);
|
||||||
*(void**)&(glSamplerParameterf) = GetProcAddress("glSamplerParameterf");
|
GL_EXT_LOAD(glGetStringi);
|
||||||
*(void**)&(glSamplerParameteri) = GetProcAddress("glSamplerParameteri");
|
GL_EXT_LOAD(glIsFramebuffer);
|
||||||
*(void**)&(glShaderSource) = GetProcAddress("glShaderSource");
|
GL_EXT_LOAD(glMapBuffer);
|
||||||
*(void**)&(glUniform1i) = GetProcAddress("glUniform1i");
|
GL_EXT_LOAD(glMapBufferRange);
|
||||||
*(void**)&(glUnmapBuffer) = GetProcAddress("glUnmapBuffer");
|
GL_EXT_LOAD(glProgramParameteri);
|
||||||
*(void**)&(glVertexAttribIPointer) = GetProcAddress("glVertexAttribIPointer");
|
GL_EXT_LOAD(glSamplerParameterf);
|
||||||
*(void**)&(glVertexAttribPointer) = GetProcAddress("glVertexAttribPointer");
|
GL_EXT_LOAD(glSamplerParameteri);
|
||||||
*(void**)&(glBufferSubData) = GetProcAddress("glBufferSubData");
|
GL_EXT_LOAD(glShaderSource);
|
||||||
*(void**)&(glFenceSync) = GetProcAddress("glFenceSync");
|
GL_EXT_LOAD(glUniform1i);
|
||||||
*(void**)&(glDeleteSync) = GetProcAddress("glDeleteSync");
|
GL_EXT_LOAD(glUnmapBuffer);
|
||||||
*(void**)&(glClientWaitSync) = GetProcAddress("glClientWaitSync");
|
GL_EXT_LOAD(glVertexAttribIPointer);
|
||||||
*(void**)&(glFlushMappedBufferRange) = GetProcAddress("glFlushMappedBufferRange");
|
GL_EXT_LOAD(glVertexAttribPointer);
|
||||||
|
GL_EXT_LOAD(glBufferSubData);
|
||||||
|
GL_EXT_LOAD(glFenceSync);
|
||||||
|
GL_EXT_LOAD(glDeleteSync);
|
||||||
|
GL_EXT_LOAD(glClientWaitSync);
|
||||||
|
GL_EXT_LOAD(glFlushMappedBufferRange);
|
||||||
// Query object
|
// Query object
|
||||||
*(void**)&(glBeginQuery) = GetProcAddress("glBeginQuery");
|
GL_EXT_LOAD(glBeginQuery);
|
||||||
*(void**)&(glEndQuery) = GetProcAddress("glEndQuery");
|
GL_EXT_LOAD(glEndQuery);
|
||||||
*(void**)&(glGetQueryiv) = GetProcAddress("glGetQueryiv");
|
GL_EXT_LOAD(glGetQueryiv);
|
||||||
*(void**)&(glGetQueryObjectiv) = GetProcAddress("glGetQueryObjectiv");
|
GL_EXT_LOAD(glGetQueryObjectiv);
|
||||||
*(void**)&(glGetQueryObjectuiv) = GetProcAddress("glGetQueryObjectuiv");
|
GL_EXT_LOAD(glGetQueryObjectuiv);
|
||||||
*(void**)&(glQueryCounter) = GetProcAddress("glQueryCounter");
|
GL_EXT_LOAD(glQueryCounter);
|
||||||
*(void**)&(glGetQueryObjecti64v) = GetProcAddress("glGetQueryObjecti64v");
|
GL_EXT_LOAD(glGetQueryObjecti64v);
|
||||||
*(void**)&(glGetQueryObjectui64v) = GetProcAddress("glGetQueryObjectui64v");
|
GL_EXT_LOAD(glGetQueryObjectui64v);
|
||||||
*(void**)&(glGetInteger64v) = GetProcAddress("glGetInteger64v");
|
GL_EXT_LOAD(glGetInteger64v);
|
||||||
// GL4.0
|
// GL4.0
|
||||||
*(void**)&(glBlendEquationSeparateiARB) = GetProcAddress("glBlendEquationSeparateiARB", true);
|
GL_EXT_LOAD_OPT(glBlendEquationSeparateiARB);
|
||||||
*(void**)&(glBlendFuncSeparateiARB) = GetProcAddress("glBlendFuncSeparateiARB", true);
|
GL_EXT_LOAD_OPT(glBlendFuncSeparateiARB);
|
||||||
// GL4.1
|
// GL4.1
|
||||||
*(void**)&(glCreateShaderProgramv) = GetProcAddress("glCreateShaderProgramv", true);
|
GL_EXT_LOAD_OPT(glCreateShaderProgramv);
|
||||||
*(void**)&(glBindProgramPipeline) = GetProcAddress("glBindProgramPipeline", true);
|
GL_EXT_LOAD_OPT(glBindProgramPipeline);
|
||||||
*(void**)&(glDeleteProgramPipelines) = GetProcAddress("glDeleteProgramPipelines", true);
|
GL_EXT_LOAD_OPT(glDeleteProgramPipelines);
|
||||||
*(void**)&(glGenProgramPipelines) = GetProcAddress("glGenProgramPipelines", true);
|
GL_EXT_LOAD_OPT(glGenProgramPipelines);
|
||||||
*(void**)&(glGetProgramPipelineiv) = GetProcAddress("glGetProgramPipelineiv", true);
|
GL_EXT_LOAD_OPT(glGetProgramPipelineiv);
|
||||||
*(void**)&(glGetProgramPipelineInfoLog) = GetProcAddress("glGetProgramPipelineInfoLog", true);
|
GL_EXT_LOAD_OPT(glGetProgramPipelineInfoLog);
|
||||||
*(void**)&(glValidateProgramPipeline) = GetProcAddress("glValidateProgramPipeline", true);
|
GL_EXT_LOAD_OPT(glValidateProgramPipeline);
|
||||||
*(void**)&(glUseProgramStages) = GetProcAddress("glUseProgramStages", true);
|
GL_EXT_LOAD_OPT(glUseProgramStages);
|
||||||
*(void**)&(glProgramUniform1i) = GetProcAddress("glProgramUniform1i", true); // but no GL4.2
|
GL_EXT_LOAD_OPT(glProgramUniform1i); // but no GL4.2
|
||||||
*(void**)&(glGetProgramBinary) = GetProcAddress("glGetProgramBinary", true);
|
GL_EXT_LOAD_OPT(glGetProgramBinary);
|
||||||
*(void**)&(glViewportIndexedf) = GetProcAddress("glViewportIndexedf", true);
|
GL_EXT_LOAD_OPT(glViewportIndexedf);
|
||||||
*(void**)&(glViewportIndexedfv) = GetProcAddress("glViewportIndexedfv", true);
|
GL_EXT_LOAD_OPT(glViewportIndexedfv);
|
||||||
*(void**)&(glScissorIndexed) = GetProcAddress("glScissorIndexed", true);
|
GL_EXT_LOAD_OPT(glScissorIndexed);
|
||||||
*(void**)&(glScissorIndexedv) = GetProcAddress("glScissorIndexedv", true);
|
GL_EXT_LOAD_OPT(glScissorIndexedv);
|
||||||
// NO GL4.1
|
// NO GL4.1
|
||||||
*(void**)&(glDeleteProgram) = GetProcAddress("glDeleteProgram");
|
GL_EXT_LOAD(glDeleteProgram);
|
||||||
*(void**)&(glDeleteShader) = GetProcAddress("glDeleteShader");
|
GL_EXT_LOAD(glDeleteShader);
|
||||||
*(void**)&(glCompileShader) = GetProcAddress("glCompileShader");
|
GL_EXT_LOAD(glCompileShader);
|
||||||
*(void**)&(glCreateProgram) = GetProcAddress("glCreateProgram");
|
GL_EXT_LOAD(glCreateProgram);
|
||||||
*(void**)&(glCreateShader) = GetProcAddress("glCreateShader");
|
GL_EXT_LOAD(glCreateShader);
|
||||||
*(void**)&(glUseProgram) = GetProcAddress("glUseProgram");
|
GL_EXT_LOAD(glUseProgram);
|
||||||
*(void**)&(glGetShaderInfoLog) = GetProcAddress("glGetShaderInfoLog");
|
GL_EXT_LOAD(glGetShaderInfoLog);
|
||||||
*(void**)&(glLinkProgram) = GetProcAddress("glLinkProgram");
|
GL_EXT_LOAD(glLinkProgram);
|
||||||
// GL4.2
|
// GL4.2
|
||||||
*(void**)&(glBindImageTexture) = GetProcAddress("glBindImageTexture", true);
|
GL_EXT_LOAD_OPT(glBindImageTexture);
|
||||||
*(void**)&(glMemoryBarrier) = GetProcAddress("glMemoryBarrier", true);
|
GL_EXT_LOAD_OPT(glMemoryBarrier);
|
||||||
*(void**)&(glTexStorage2D) = GetProcAddress("glTexStorage2D");
|
GL_EXT_LOAD(glTexStorage2D);
|
||||||
// GL4.3
|
// GL4.3
|
||||||
*(void**)&(glCopyImageSubData) = GetProcAddress("glCopyImageSubData", true);
|
GL_EXT_LOAD_OPT(glCopyImageSubData);
|
||||||
*(void**)&(glInvalidateTexImage) = GetProcAddress("glInvalidateTexImage", true);
|
GL_EXT_LOAD_OPT(glInvalidateTexImage);
|
||||||
*(void**)&(glPushDebugGroup) = GetProcAddress("glPushDebugGroup", true);
|
GL_EXT_LOAD_OPT(glPushDebugGroup);
|
||||||
*(void**)&(glPopDebugGroup) = GetProcAddress("glPopDebugGroup", true);
|
GL_EXT_LOAD_OPT(glPopDebugGroup);
|
||||||
*(void**)&(glDebugMessageInsert) = GetProcAddress("glDebugMessageInsert", true);
|
GL_EXT_LOAD_OPT(glDebugMessageInsert);
|
||||||
*(void**)&(glDebugMessageControl) = GetProcAddress("glDebugMessageControl", true);
|
GL_EXT_LOAD_OPT(glDebugMessageControl);
|
||||||
// GL4.4
|
// GL4.4
|
||||||
*(void**)&(glClearTexImage) = GetProcAddress("glClearTexImage", true);
|
GL_EXT_LOAD_OPT(glClearTexImage);
|
||||||
*(void**)&(glBufferStorage) = GetProcAddress("glBufferStorage", true);
|
GL_EXT_LOAD_OPT(glBufferStorage);
|
||||||
|
|
||||||
// GL4.5
|
// GL4.5
|
||||||
*(void**)&(glCreateTextures) = GetProcAddress("glCreateTextures", true);
|
GL_EXT_LOAD_OPT(glCreateTextures);
|
||||||
*(void**)&(glTextureStorage2D) = GetProcAddress("glTextureStorage2D", true);
|
GL_EXT_LOAD_OPT(glTextureStorage2D);
|
||||||
*(void**)&(glTextureSubImage2D) = GetProcAddress("glTextureSubImage2D", true);
|
GL_EXT_LOAD_OPT(glTextureSubImage2D);
|
||||||
*(void**)&(glCopyTextureSubImage2D) = GetProcAddress("glCopyTextureSubImage2D", true);
|
GL_EXT_LOAD_OPT(glCopyTextureSubImage2D);
|
||||||
*(void**)&(glBindTextureUnit) = GetProcAddress("glBindTextureUnit", true);
|
GL_EXT_LOAD_OPT(glBindTextureUnit);
|
||||||
*(void**)&(glGetTextureImage) = GetProcAddress("glGetTextureImage", true);
|
GL_EXT_LOAD_OPT(glGetTextureImage);
|
||||||
*(void**)&(glTextureParameteri) = GetProcAddress("glTextureParameteri", true);
|
GL_EXT_LOAD_OPT(glTextureParameteri);
|
||||||
|
|
||||||
*(void**)&(glCreateFramebuffers) = GetProcAddress("glCreateFramebuffers", true);
|
GL_EXT_LOAD_OPT(glCreateFramebuffers);
|
||||||
*(void**)&(glClearNamedFramebufferfv) = GetProcAddress("glClearNamedFramebufferfv", true);
|
GL_EXT_LOAD_OPT(glClearNamedFramebufferfv);
|
||||||
*(void**)&(glClearNamedFramebufferuiv) = GetProcAddress("glClearNamedFramebufferuiv", true);
|
GL_EXT_LOAD_OPT(glClearNamedFramebufferuiv);
|
||||||
*(void**)&(glClearNamedFramebufferiv) = GetProcAddress("glClearNamedFramebufferiv", true);
|
GL_EXT_LOAD_OPT(glClearNamedFramebufferiv);
|
||||||
*(void**)&(glNamedFramebufferTexture) = GetProcAddress("glNamedFramebufferTexture", true);
|
GL_EXT_LOAD_OPT(glNamedFramebufferTexture);
|
||||||
*(void**)&(glNamedFramebufferDrawBuffers) = GetProcAddress("glNamedFramebufferDrawBuffers", true);
|
GL_EXT_LOAD_OPT(glNamedFramebufferDrawBuffers);
|
||||||
*(void**)&(glNamedFramebufferReadBuffer) = GetProcAddress("glNamedFramebufferReadBuffer", true);
|
GL_EXT_LOAD_OPT(glNamedFramebufferReadBuffer);
|
||||||
*(void**)&(glCheckNamedFramebufferStatus) = GetProcAddress("glCheckNamedFramebufferStatus", true);
|
GL_EXT_LOAD_OPT(glCheckNamedFramebufferStatus);
|
||||||
|
|
||||||
*(void**)&(glCreateBuffers) = GetProcAddress("glCreateBuffers", true);
|
GL_EXT_LOAD_OPT(glCreateBuffers);
|
||||||
*(void**)&(glNamedBufferStorage) = GetProcAddress("glNamedBufferStorage", true);
|
GL_EXT_LOAD_OPT(glNamedBufferStorage);
|
||||||
*(void**)&(glNamedBufferData) = GetProcAddress("glNamedBufferData", true);
|
GL_EXT_LOAD_OPT(glNamedBufferData);
|
||||||
*(void**)&(glNamedBufferSubData) = GetProcAddress("glNamedBufferSubData", true);
|
GL_EXT_LOAD_OPT(glNamedBufferSubData);
|
||||||
*(void**)&(glMapNamedBuffer) = GetProcAddress("glMapNamedBuffer", true);
|
GL_EXT_LOAD_OPT(glMapNamedBuffer);
|
||||||
*(void**)&(glMapNamedBufferRange) = GetProcAddress("glMapNamedBufferRange", true);
|
GL_EXT_LOAD_OPT(glMapNamedBufferRange);
|
||||||
*(void**)&(glUnmapNamedBuffer) = GetProcAddress("glUnmapNamedBuffer", true);
|
GL_EXT_LOAD_OPT(glUnmapNamedBuffer);
|
||||||
*(void**)&(glFlushMappedNamedBufferRange) = GetProcAddress("glFlushMappedNamedBufferRange", true);
|
GL_EXT_LOAD_OPT(glFlushMappedNamedBufferRange);
|
||||||
|
|
||||||
*(void**)&(glCreateSamplers) = GetProcAddress("glCreateSamplers", true);
|
GL_EXT_LOAD_OPT(glCreateSamplers);
|
||||||
*(void**)&(glCreateProgramPipelines) = GetProcAddress("glCreateProgramPipelines", true);
|
GL_EXT_LOAD_OPT(glCreateProgramPipelines);
|
||||||
|
|
||||||
*(void**)&(glClipControl) = GetProcAddress("glClipControl", true);
|
GL_EXT_LOAD_OPT(glClipControl);
|
||||||
*(void**)&(glTextureBarrier) = GetProcAddress("glTextureBarrier", true);
|
GL_EXT_LOAD_OPT(glTextureBarrier);
|
||||||
|
|
||||||
if (glCreateFramebuffers == NULL) {
|
if (glCreateFramebuffers == NULL) {
|
||||||
Emulate_DSA::Init();
|
Emulate_DSA::Init();
|
||||||
|
|
Loading…
Reference in New Issue