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
This commit is contained in:
gregory.hainaut 2013-06-14 16:22:22 +00:00
parent e021630bb9
commit 92a3549e9c
3 changed files with 13 additions and 15 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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"