From 41a5578097152c064726f7a3cd6064e2ebc9cd5d Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Tue, 23 Oct 2012 19:59:00 +0000 Subject: [PATCH] zzogl: Check the size of both rectangle and 2D textures. Hopefully will fix Sandybridge system. Tests are welcome. cmake: be sure that EGL is supported git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5438 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg/opengl/CMakeLists.txt | 14 ++++++++------ plugins/zzogl-pg/opengl/ZZoglCreate.cpp | 8 +++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/zzogl-pg/opengl/CMakeLists.txt b/plugins/zzogl-pg/opengl/CMakeLists.txt index 29276b46d0..358a70b15b 100644 --- a/plugins/zzogl-pg/opengl/CMakeLists.txt +++ b/plugins/zzogl-pg/opengl/CMakeLists.txt @@ -54,10 +54,12 @@ else(GLSL_API) endif(GLSL_API) # Select the EGL API -if(EGL_API AND EGL_GL_CONTEXT_SUPPORT) - add_definitions(-DEGL_API) -else() - message(WARNING "Current EGL implementation doesn't support openGL context. Fallback to standard GLX.") +if(EGL_API AND EGL_FOUND) + if (EGL_GL_CONTEXT_SUPPORT) + add_definitions(-DEGL_API) + else() + message(WARNING "Current EGL implementation doesn't support openGL context. Fallback to standard GLX.") + endif() endif() @@ -175,7 +177,7 @@ target_link_libraries(${Output} ${GLEW_LIBRARY}) # link target with opengl target_link_libraries(${Output} ${OPENGL_LIBRARIES}) -if (EGL_API AND EGL_GL_CONTEXT_SUPPORT) +if(EGL_API AND EGL_FOUND AND EGL_GL_CONTEXT_SUPPORT) target_link_libraries(${Output} ${EGL_LIBRARIES}) endif() @@ -239,7 +241,7 @@ if(BUILD_REPLAY_LOADERS) endif(NOT GLSL_API) target_link_libraries(${Static} ${GLEW_LIBRARY}) target_link_libraries(${Static} ${OPENGL_LIBRARIES}) -if (EGL_API AND EGL_GL_CONTEXT_SUPPORT) +if(EGL_API AND EGL_FOUND AND EGL_GL_CONTEXT_SUPPORT) target_link_libraries(${Static} ${EGL_LIBRARIES}) endif() target_link_libraries(${Static} ${X11_LIBRARIES}) diff --git a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp index 2a4ff7429a..caa46e8f11 100644 --- a/plugins/zzogl-pg/opengl/ZZoglCreate.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglCreate.cpp @@ -207,13 +207,13 @@ inline void CreateOtherCheck() ZZLog::Error_Log("Using multitexturing."); GLint Max_Texture_Size_NV = 0; - GLint Max_Texture_Size_2d = 0; glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE_NV, &Max_Texture_Size_NV); - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &Max_Texture_Size_2d); + g_MaxTexHeight = min(Max_Texture_Size_2d, Max_Texture_Size_NV); + ZZLog::Error_Log("Maximum texture size is %d for Tex_2d and %d for Tex_NV.", Max_Texture_Size_2d, Max_Texture_Size_NV); if (Max_Texture_Size_NV < 1024) @@ -446,8 +446,10 @@ bool ZZCreate(int _width, int _height) CreateOtherCheck(); + // Incorrect must check rectangle texture too. Now done directly on CreateOtherCheck() + // // check the max texture width and height - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &g_MaxTexWidth); + ///glGetIntegerv(GL_MAX_TEXTURE_SIZE, &g_MaxTexWidth); // Limit the texture size supported to 8192. We do not need bigger texture. // Besides the following assertion is false when texture are too big. // ZZoglFlush.cpp:2349: assert(fblockstride >= 1.0f)