From eb257d929565bb5453bab57d0c79f5ead0a8a73d Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sat, 25 Apr 2015 11:41:46 +0200 Subject: [PATCH] gsdx-ogl: add dsa function place holder --- plugins/GSdx/GLLoader.cpp | 65 +++++++++++++++++++++++++++++++++++++++ plugins/GSdx/GLLoader.h | 1 + plugins/GSdx/GSWnd.cpp | 1 + 3 files changed, 67 insertions(+) diff --git a/plugins/GSdx/GLLoader.cpp b/plugins/GSdx/GLLoader.cpp index 49b85e299..c5115f12d 100644 --- a/plugins/GSdx/GLLoader.cpp +++ b/plugins/GSdx/GLLoader.cpp @@ -137,6 +137,7 @@ PFNGLNAMEDBUFFERSUBDATAPROC gl_NamedBufferSubData = NU PFNGLMAPNAMEDBUFFERPROC gl_MapNamedBuffer = NULL; PFNGLMAPNAMEDBUFFERRANGEPROC gl_MapNamedBufferRange = NULL; PFNGLUNMAPNAMEDBUFFERPROC gl_UnmapNamedBuffer = NULL; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC gl_FlushMappedNamedBufferRange = NULL; PFNGLCREATESAMPLERSPROC gl_CreateSamplers = NULL; PFNGLCREATEPROGRAMPIPELINESPROC gl_CreateProgramPipelines = NULL; @@ -147,6 +148,7 @@ PFNGLTEXTUREBARRIERPROC gl_TextureBarrier = NU #endif namespace Emulate_DSA { + // Texture entry point void APIENTRY BindTextureUnit(GLuint unit, GLuint texture) { gl_ActiveTexture(GL_TEXTURE0 + unit); glBindTexture(GL_TEXTURE_2D, texture); @@ -176,6 +178,69 @@ namespace Emulate_DSA { glGetTexImage(GL_TEXTURE_2D, level, format, type, pixels); } + // Framebuffer entry point + void APIENTRY CreateFramebuffers(GLsizei n, GLuint *framebuffers) { + } + + void APIENTRY ClearNamedFramebufferfv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat *value) { + } + + void APIENTRY ClearNamedFramebufferiv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint *value) { + } + + void APIENTRY ClearNamedFramebufferuiv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint *value) { + } + + void APIENTRY NamedFramebufferTexture(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) { + } + + void APIENTRY NamedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n, const GLenum *bufs) { + } + + void APIENTRY NamedFramebufferReadBuffer(GLuint framebuffer, GLenum src) { + } + + GLenum APIENTRY CheckNamedFramebufferStatus(GLuint framebuffer, GLenum target) { + return 0; + } + + // Buffer entry point + void APIENTRY CreateBuffers(GLsizei n, GLuint *buffers) { + } + + void APIENTRY NamedBufferStorage(GLuint buffer, GLsizei size, const void *data, GLbitfield flags) { + } + + void APIENTRY NamedBufferData(GLuint buffer, GLsizei size, const void *data, GLenum usage) { + } + + void APIENTRY NamedBufferSubData(GLuint buffer, GLintptr offset, GLsizei size, const void *data) { + } + + void *APIENTRY MapNamedBuffer(GLuint buffer, GLenum access) { + return NULL; + } + + void *APIENTRY MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length, GLbitfield access) { + return NULL; + } + + GLboolean APIENTRY UnmapNamedBuffer(GLuint buffer) { + return false; + } + + void APIENTRY FlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizei length) { + } + + // Misc entry point + // (only purpose is to have a consistent API otherwise it is useless) + void APIENTRY CreateProgramPipelines(GLsizei n, GLuint *pipelines) { + } + + void APIENTRY CreateSamplers(GLsizei n, GLuint *samplers) { + } + + // Replace function pointer to emulate DSA behavior void Init() { fprintf(stderr, "DSA is not supported. Replace GL function pointer to emulate it\n"); gl_BindTextureUnit = BindTextureUnit; diff --git a/plugins/GSdx/GLLoader.h b/plugins/GSdx/GLLoader.h index 25f329552..53e5656f5 100644 --- a/plugins/GSdx/GLLoader.h +++ b/plugins/GSdx/GLLoader.h @@ -325,6 +325,7 @@ extern PFNGLNAMEDBUFFERSUBDATAPROC gl_NamedBufferSubData; extern PFNGLMAPNAMEDBUFFERPROC gl_MapNamedBuffer; extern PFNGLMAPNAMEDBUFFERRANGEPROC gl_MapNamedBufferRange; extern PFNGLUNMAPNAMEDBUFFERPROC gl_UnmapNamedBuffer; +extern PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC gl_FlushMappedNamedBufferRange; extern PFNGLCREATESAMPLERSPROC gl_CreateSamplers; extern PFNGLCREATEPROGRAMPIPELINESPROC gl_CreateProgramPipelines; diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index fc6bc8a5c..747e85700 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -140,6 +140,7 @@ void GSWndGL::PopulateGlFunction() *(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**)&(gl_CreateSamplers) = GetProcAddress("glCreateSamplers", true); *(void**)&(gl_CreateProgramPipelines) = GetProcAddress("glCreateProgramPipelines", true);