diff --git a/plugins/GSdx/GSDeviceOGL.cpp b/plugins/GSdx/GSDeviceOGL.cpp index 690c5a8039..fd47ee0b5f 100644 --- a/plugins/GSdx/GSDeviceOGL.cpp +++ b/plugins/GSdx/GSDeviceOGL.cpp @@ -186,7 +186,10 @@ bool GSDeviceOGL::Create(GSWnd* wnd) GLuint major = s[dot-1]-'0'; GLuint minor = s[dot+1]-'0'; - if ( (major < 4) || ( major == 4 && minor < 2 ) ) return false; + // Note: 4.2 crash on latest nvidia drivers! + // So only check 4.1 + // if ( (major < 4) || ( major == 4 && minor < 2 ) ) return false; + if ( (major < 4) || ( major == 4 && minor < 1 ) ) return false; @@ -479,7 +482,7 @@ bool GSDeviceOGL::Reset(int w, int h) // Opengl allocate the backbuffer with the window. The render is done in the backbuffer when // there isn't any FBO. Only a dummy texture is created to easily detect when the rendering is done // in the backbuffer - m_backbuffer = new GSTextureOGL(0, w, h, false, GSTextureOGL::Backbuffer); + m_backbuffer = new GSTextureOGL(GSTextureOGL::Backbuffer, w, h, false, 0); return true; } @@ -619,8 +622,11 @@ void GSDeviceOGL::CopyRect(GSTexture* st, GSTexture* dt, const GSVector4i& r) return; } + // This function is useless on opengl. The only call I found copy the whole texture data to another one assert(0); + // GL_NV_copy_image seem like the good extension but not supported on AMD... + // Maybe opengl 4.3 ! // FIXME attach the texture to the FBO GSTextureOGL* st_ogl = (GSTextureOGL*) st; diff --git a/plugins/GSdx/GSTextureOGL.cpp b/plugins/GSdx/GSTextureOGL.cpp index 1f398f638d..f38c6ad7f7 100644 --- a/plugins/GSdx/GSTextureOGL.cpp +++ b/plugins/GSdx/GSTextureOGL.cpp @@ -103,6 +103,9 @@ GSTextureOGL::GSTextureOGL(int type, int w, int h, bool msaa, int format) // gvec texelFetch(gsampler sampler, ivec texCoord, int lod[, int sample]); // corollary we can maybe use it for multisample stuff break; + case GSTexture::Backbuffer: + m_texture_target = 0; + m_texture_id = 0; default: break; } diff --git a/plugins/GSdx/GSWnd.cpp b/plugins/GSdx/GSWnd.cpp index 3ef9cf3c2b..cefeba6e55 100644 --- a/plugins/GSdx/GSWnd.cpp +++ b/plugins/GSdx/GSWnd.cpp @@ -370,10 +370,12 @@ bool GSWnd::Attach(void* handle, bool managed) int context_attribs[] = { GLX_CONTEXT_MAJOR_VERSION_ARB, 4, - GLX_CONTEXT_MINOR_VERSION_ARB, 2, + // Note: 4.2 crash on latest nvidia drivers! + GLX_CONTEXT_MINOR_VERSION_ARB, 1, // FIXME : Request a debug context to ease opengl development // Note: don't support deprecated feature (pre openg 3.1) - GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, + //GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, + GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB, None }; m_context = glXCreateContextAttribsARB(m_XDisplay, fbc[0], 0, true, context_attribs); diff --git a/plugins/GSdx/res/tfx.glsl b/plugins/GSdx/res/tfx.glsl index 11f50b8b98..1a47366e48 100644 --- a/plugins/GSdx/res/tfx.glsl +++ b/plugins/GSdx/res/tfx.glsl @@ -74,13 +74,11 @@ void vs_main() { uint z; if(VS_BPPZ == 1) // 24 - { z = i_z & 0xffffff; - } else if(VS_BPPZ == 2) // 16 - { z = i_z & 0xffff; - } + else + z = i_z; // pos -= 0.05 (1/320 pixel) helps avoiding rounding problems (integral part of pos is usually 5 digits, 0.05 is about as low as we can go) // example: ceil(afterseveralvertextransformations(y = 133)) => 134 => line 133 stays empty @@ -371,7 +369,7 @@ mat4 sample_4p(vec4 u) vec4 sample_color(vec2 st, float q) { - if(!PS_FST) + if(PS_FST == 0) { st /= q; }