summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-09 20:04:16 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-09 20:27:19 +0300
commit820ed443d5c96fb96cdc7b1f945ac7c6aaf95cbc (patch)
tree78c2212ce15c202e12685d8a6dcce4a1937edea5
parent4ef3a45641bc2c1ada931951c120c4f8b8eb2301 (diff)
downloadmanaplus-820ed443d5c96fb96cdc7b1f945ac7c6aaf95cbc.tar.gz
manaplus-820ed443d5c96fb96cdc7b1f945ac7c6aaf95cbc.tar.bz2
manaplus-820ed443d5c96fb96cdc7b1f945ac7c6aaf95cbc.tar.xz
manaplus-820ed443d5c96fb96cdc7b1f945ac7c6aaf95cbc.zip
Fix issue with DSO.
EXT and ARB extensions have bit different signatures. Disable DSO black list for now.
-rw-r--r--src/graphicsmanager.cpp17
-rw-r--r--src/render/opengl/mgl.hpp1
-rw-r--r--src/render/opengl/mglemu.cpp12
-rw-r--r--src/render/opengl/mglemu.h20
-rw-r--r--src/render/opengl/mgltypes.h11
-rw-r--r--src/resources/openglimagehelper.cpp23
-rw-r--r--src/resources/safeopenglimagehelper.cpp23
7 files changed, 70 insertions, 37 deletions
diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp
index e6bc335bd..f19f1ee8f 100644
--- a/src/graphicsmanager.cpp
+++ b/src/graphicsmanager.cpp
@@ -984,7 +984,7 @@ void GraphicsManager::deleteFBO(FBOInfo *const fbo)
void GraphicsManager::initOpenGLFunctions()
{
#ifdef __native_client__
- emulateFunction(glTextureSubImage2D);
+ emulateFunction(glTextureSubImage2DEXT);
#else
const bool is10 = checkGLVersion(1, 0);
const bool is11 = checkGLVersion(1, 1);
@@ -1029,11 +1029,11 @@ void GraphicsManager::initOpenGLFunctions()
if (!is11)
{
mSupportModernOpengl = false;
- emulateFunction(glTextureSubImage2D);
- emulateFunction(glActiveTexture);
+ emulateFunction(glTextureSubImage2DEXT);
return;
}
+/*
if (findI(mGlVendor, "NVIDIA") != std::string::npos ||
mGlVersionString.find("Mesa 10.6.") != std::string::npos ||
mGlVersionString.find("Mesa 11.1.1") != std::string::npos ||
@@ -1048,32 +1048,33 @@ void GraphicsManager::initOpenGLFunctions()
{
logger->log1("Not checked for DSA because on "
"NVIDIA or AMD or in Mesa it broken");
- emulateFunction(glTextureSubImage2D);
+ emulateFunction(glTextureSubImage2DEXT);
}
else
+*/
{ // not for NVIDIA. in NVIDIA atleast in windows drivers DSA is broken
// Mesa 10.6.3 show support for DSA, but it broken. Works in 10.7 dev
if (is45)
{
logger->log1("found GL_EXT_direct_state_access");
- assignFunctionEmu2(glTextureSubImage2D, "glTextureSubImage2D");
+ assignFunction(glTextureSubImage2D);
}
else if (supportExtension("GL_EXT_direct_state_access"))
{
logger->log1("found GL_EXT_direct_state_access");
- assignFunctionEmu2(glTextureSubImage2D, "glTextureSubImage2DEXT");
+ assignFunctionEmu2(glTextureSubImage2DEXT, "glTextureSubImage2DEXT");
}
else if (supportExtension("GL_ARB_direct_state_access"))
{
logger->log1("found GL_ARB_direct_state_access");
logger->log1("GL_EXT_direct_state_access not found");
- assignFunctionEmu2(glTextureSubImage2D, "glTextureSubImage2DEXT");
+ assignFunction(glTextureSubImage2D);
}
else
{
logger->log1("GL_EXT_direct_state_access not found");
logger->log1("GL_ARB_direct_state_access not found");
- emulateFunction(glTextureSubImage2D);
+ emulateFunction(glTextureSubImage2DEXT);
}
}
diff --git a/src/render/opengl/mgl.hpp b/src/render/opengl/mgl.hpp
index 1d8a33f3c..7bc2fa5e8 100644
--- a/src/render/opengl/mgl.hpp
+++ b/src/render/opengl/mgl.hpp
@@ -134,6 +134,7 @@ defName(glDeleteQueries);
defName(glGetQueryObjectiv);
defName(glGetQueryObjectui64v);
defName(glTextureSubImage2D);
+defName(glTextureSubImage2DEXT);
defName(glClearTexImage);
defName(glClearTexSubImage);
#ifdef WIN32
diff --git a/src/render/opengl/mglemu.cpp b/src/render/opengl/mglemu.cpp
index 80bc36d6a..297dae3e1 100644
--- a/src/render/opengl/mglemu.cpp
+++ b/src/render/opengl/mglemu.cpp
@@ -26,12 +26,12 @@
#include "debug.h"
-void APIENTRY emuglTextureSubImage2D(GLuint texture, GLenum target,
- GLint level,
- GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height,
- GLenum format, GLenum type,
- const void *pixels)
+void APIENTRY emuglTextureSubImage2DEXT(GLuint texture, GLenum target,
+ GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type,
+ const void *pixels)
{
OpenGLImageHelper::bindTexture(texture);
glTexSubImage2D(target, level,
diff --git a/src/render/opengl/mglemu.h b/src/render/opengl/mglemu.h
index 1ae73d67c..eb291dafd 100644
--- a/src/render/opengl/mglemu.h
+++ b/src/render/opengl/mglemu.h
@@ -24,16 +24,16 @@
#include "render/opengl/mgltypes.h"
-void APIENTRY emuglTextureSubImage2D(GLuint texture,
- GLenum target,
- GLint level,
- GLint xoffset,
- GLint yoffset,
- GLsizei width,
- GLsizei height,
- GLenum format,
- GLenum type,
- const void *pixels);
+void APIENTRY emuglTextureSubImage2DEXT(GLuint texture,
+ GLenum target,
+ GLint level,
+ GLint xoffset,
+ GLint yoffset,
+ GLsizei width,
+ GLsizei height,
+ GLenum format,
+ GLenum type,
+ const void *pixels);
void APIENTRY emuglActiveTexture(GLenum texture);
diff --git a/src/render/opengl/mgltypes.h b/src/render/opengl/mgltypes.h
index 96f86bde3..2d02979d4 100644
--- a/src/render/opengl/mgltypes.h
+++ b/src/render/opengl/mgltypes.h
@@ -187,9 +187,14 @@ typedef void (APIENTRY *glGetQueryObjectiv_t) (GLuint id,
GLenum pname, GLint *params);
typedef void (APIENTRY *glGetQueryObjectui64v_t) (GLuint id,
GLenum pname, uint64_t *params);
-typedef void (APIENTRY *glTextureSubImage2D_t) (GLuint texture, GLenum target,
- GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- GLenum format, GLenum type, const void *pixels);
+typedef void (APIENTRY *glTextureSubImage2DEXT_t) (GLuint texture,
+ GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height, GLenum format, GLenum type,
+ const void *pixels);
+typedef void (APIENTRY *glTextureSubImage2D_t) (GLuint texture,
+ GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height, GLenum format, GLenum type,
+ const void *pixels);
typedef void (APIENTRY *glClearTexImage_t) (GLuint texture, GLint level,
GLenum format, GLenum type, const void * data);
typedef void (APIENTRY *glClearTexSubImage_t) (GLuint texture, GLint level,
diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp
index 111dbe58e..9e3e5dc2d 100644
--- a/src/resources/openglimagehelper.cpp
+++ b/src/resources/openglimagehelper.cpp
@@ -474,11 +474,24 @@ void OpenGLImageHelper::copySurfaceToImage(const Image *const image,
if (!surface)
return;
- mglTextureSubImage2D(image->mGLImage,
- mTextureType, 0,
- x, y,
- surface->w, surface->h,
- GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels);
+ // +++ probably need combine
+ // mglTextureSubImage2D and mglTextureSubImage2DEXT
+ if (mglTextureSubImage2D)
+ {
+ mglTextureSubImage2D(image->mGLImage,
+ 0,
+ x, y,
+ surface->w, surface->h,
+ GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels);
+ }
+ else
+ {
+ mglTextureSubImage2DEXT(image->mGLImage,
+ mTextureType, 0,
+ x, y,
+ surface->w, surface->h,
+ GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels);
+ }
if (surface != oldSurface)
MSDL_FreeSurface(surface);
diff --git a/src/resources/safeopenglimagehelper.cpp b/src/resources/safeopenglimagehelper.cpp
index 41b2c5d89..c57e2a104 100644
--- a/src/resources/safeopenglimagehelper.cpp
+++ b/src/resources/safeopenglimagehelper.cpp
@@ -473,11 +473,24 @@ void SafeOpenGLImageHelper::copySurfaceToImage(const Image *const image,
if (!surface)
return;
- mglTextureSubImage2D(image->mGLImage,
- mTextureType, 0,
- x, y,
- surface->w, surface->h,
- GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels);
+ // +++ probably need combine
+ // mglTextureSubImage2D and mglTextureSubImage2DEXT
+ if (mglTextureSubImage2D)
+ {
+ mglTextureSubImage2D(image->mGLImage,
+ 0,
+ x, y,
+ surface->w, surface->h,
+ GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels);
+ }
+ else
+ {
+ mglTextureSubImage2DEXT(image->mGLImage,
+ mTextureType, 0,
+ x, y,
+ surface->w, surface->h,
+ GL_RGBA, GL_UNSIGNED_BYTE, surface->pixels);
+ }
if (surface != oldSurface)
MSDL_FreeSurface(surface);