From 92a3549e9c3817faf6e0bf8d3738e9ef2bfc9f0b Mon Sep 17 00:00:00 2001 From: "gregory.hainaut" Date: Fri, 14 Jun 2013 16:22:22 +0000 Subject: [PATCH] gsdx-ogl-wnd: * Patch from miseru to fix VS2010 * Quick fix for 8-bits textures git-svn-id: http://pcsx2.googlecode.com/svn/branches/gsdx-ogl-wnd@5658 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSTextureOGL.cpp | 2 +- plugins/GSdx/res/tfx.glsl | 13 ++++++------- plugins/GSdx/res/tfx.h | 13 ++++++------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/plugins/GSdx/GSTextureOGL.cpp b/plugins/GSdx/GSTextureOGL.cpp index 29992927ba..7036d96be6 100644 --- a/plugins/GSdx/GSTextureOGL.cpp +++ b/plugins/GSdx/GSTextureOGL.cpp @@ -138,7 +138,7 @@ GSTextureOGL::GSTextureOGL(int type, int w, int h, bool msaa, int format, GLuint GSTextureOGL::~GSTextureOGL() { /* Unbind the texture from our local state */ - for (uint i = 0; i < 7; i++) + for (uint32 i = 0; i < 7; i++) if (g_state_texture_id[i] == m_texture_id) g_state_texture_id[i] = 0; diff --git a/plugins/GSdx/res/tfx.glsl b/plugins/GSdx/res/tfx.glsl index 98f0fe52ea..6e2c0d09ae 100644 --- a/plugins/GSdx/res/tfx.glsl +++ b/plugins/GSdx/res/tfx.glsl @@ -457,13 +457,12 @@ vec4 sample_4a(vec4 uv) { vec4 c; - // XXX - // I think .a is related to 8bit texture in alpha channel - // Opengl is only 8 bits on red channel. Not sure exactly of the impact - c.x = sample_c(uv.xy).a; - c.y = sample_c(uv.zy).a; - c.z = sample_c(uv.xw).a; - c.w = sample_c(uv.zw).a; + // Dx used the alpha channel. + // Opengl is only 8 bits on red channel. + c.x = sample_c(uv.xy).r; + c.y = sample_c(uv.zy).r; + c.z = sample_c(uv.xw).r; + c.w = sample_c(uv.zw).r; return c * 255./256 + 0.5/256; } diff --git a/plugins/GSdx/res/tfx.h b/plugins/GSdx/res/tfx.h index 7404d405b9..876c58f6c5 100644 --- a/plugins/GSdx/res/tfx.h +++ b/plugins/GSdx/res/tfx.h @@ -485,13 +485,12 @@ static const char* tfx_glsl = "{\n" " vec4 c;\n" "\n" - " // XXX\n" - " // I think .a is related to 8bit texture in alpha channel\n" - " // Opengl is only 8 bits on red channel. Not sure exactly of the impact\n" - " c.x = sample_c(uv.xy).a;\n" - " c.y = sample_c(uv.zy).a;\n" - " c.z = sample_c(uv.xw).a;\n" - " c.w = sample_c(uv.zw).a;\n" + " // Dx used the alpha channel.\n" + " // Opengl is only 8 bits on red channel.\n" + " c.x = sample_c(uv.xy).r;\n" + " c.y = sample_c(uv.zy).r;\n" + " c.z = sample_c(uv.xw).r;\n" + " c.w = sample_c(uv.zw).r;\n" "\n" " return c * 255./256 + 0.5/256;\n" "}\n"