diff --git a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp index 79189d4309..76e4b8156b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp @@ -306,10 +306,10 @@ void XFBSource::Draw(const MathUtil::Rectangle &sourcerc, glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texture); GLfloat vtx1[] = { - drawrc.left, drawrc.bottom, 1, - drawrc.left, drawrc.top, 1, - drawrc.right, drawrc.top, 1, - drawrc.right, drawrc.bottom, 1 + drawrc.left, drawrc.bottom, + drawrc.left, drawrc.top, + drawrc.right, drawrc.top, + drawrc.right, drawrc.bottom, }; GLfloat tex1[] = { // For TEXTURE0 sourcerc.left, sourcerc.bottom, @@ -319,17 +319,17 @@ void XFBSource::Draw(const MathUtil::Rectangle &sourcerc, }; glClientActiveTexture(GL_TEXTURE0); - glTexCoordPointer(2, GL_FLOAT, 0, tex1); - // Is this correct? - glMultiTexCoord2fARB(GL_TEXTURE1, 0, 0); - glMultiTexCoord2fARB(GL_TEXTURE1, 0, 1); - glMultiTexCoord2fARB(GL_TEXTURE1, 1, 1); - glMultiTexCoord2fARB(GL_TEXTURE1, 1, 0); - - glVertexPointer(3, GL_FLOAT, 0, vtx1); + glMultiTexCoord2f(GL_TEXTURE1, 0, 0); + glMultiTexCoord2f(GL_TEXTURE1, 0, 1); + glMultiTexCoord2f(GL_TEXTURE1, 1, 1); + glMultiTexCoord2f(GL_TEXTURE1, 1, 0); + + glVertexPointer(2, GL_FLOAT, 0, vtx1); + glTexCoordPointer(2, GL_FLOAT, 0, tex1); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + GL_REPORT_ERRORD(); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp index ae20649433..0cbf878799 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp @@ -274,10 +274,6 @@ void GLVertexFormat::EnableComponents(u32 components) if ((components & (VB_HAS_UV0 << i)) != (s_prevcomponents & (VB_HAS_UV0 << i))) { glClientActiveTexture(GL_TEXTURE0 + i); - if (components & (VB_HAS_UV0 << i)) - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - else - glDisableClientState(GL_TEXTURE_COORD_ARRAY); } } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 12f38f89f3..00f971a31b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -474,6 +474,7 @@ Renderer::Renderer() glBlendColorEXT(0, 0, 0, 0.5f); glClearDepth(1.0f); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); // legacy multitexturing: select texture channel only. glActiveTexture(GL_TEXTURE0); glClientActiveTexture(GL_TEXTURE0); @@ -1154,18 +1155,19 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight,cons }; glClientActiveTexture(GL_TEXTURE0); - glTexCoordPointer(2, GL_FLOAT, 0, tex1); if (applyShader) { - glMultiTexCoord2fARB(GL_TEXTURE1, 0, 0); - glMultiTexCoord2fARB(GL_TEXTURE1, 0, 1); - glMultiTexCoord2fARB(GL_TEXTURE1, 1, 1); - glMultiTexCoord2fARB(GL_TEXTURE1, 1, 0); + glMultiTexCoord2f(GL_TEXTURE1, 0, 0); + glMultiTexCoord2f(GL_TEXTURE1, 0, 1); + glMultiTexCoord2f(GL_TEXTURE1, 1, 1); + glMultiTexCoord2f(GL_TEXTURE1, 1, 0); } - + glVertexPointer(3, GL_FLOAT, 0, vtx1); + glTexCoordPointer(2, GL_FLOAT, 0, tex1); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + if(applyShader) PixelShaderCache::DisableShader(); } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp index 052727e1b0..797ba39c10 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp @@ -306,23 +306,22 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo TargetRectangle targetSource = g_renderer->ConvertEFBRectangle(srcRect); GL_REPORT_ERRORD(); - GLfloat tex1[] = { - (GLfloat)targetSource.left, (GLfloat)targetSource.bottom, - (GLfloat)targetSource.left, (GLfloat)targetSource.top, - (GLfloat)targetSource.right, (GLfloat)targetSource.top, - (GLfloat)targetSource.right, (GLfloat)targetSource.bottom + (GLfloat)targetSource.left, (GLfloat)targetSource.bottom, + (GLfloat)targetSource.left, (GLfloat)targetSource.top, + (GLfloat)targetSource.right, (GLfloat)targetSource.top, + (GLfloat)targetSource.right, (GLfloat)targetSource.bottom }; GLfloat vtx1[] = { - -1, 1, 1, - -1, -1, 1, - 1, -1, 1, - 1, 1, 1 + -1.f, 1.f, + -1.f, -1.f, + 1.f, -1.f, + 1.f, 1.f }; + glTexCoordPointer(2, GL_FLOAT, 0, tex1); - glVertexPointer(3, GL_FLOAT, 0, vtx1); + glVertexPointer(2, GL_FLOAT, 0, vtx1); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); - GL_REPORT_ERRORD(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp index 64ac6ba888..306fa5e298 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp @@ -222,13 +222,14 @@ void EncodeToRamUsingShader(FRAGMENTSHADER& shader, GLuint srcTexture, const Tar (float)sourceRc.right, (float)sourceRc.top }; GLfloat vtx1[] = { - -1, -1, 1, - -1, 1, 1, - 1, 1, 1, - 1, -1, 1 + -1.f, -1.f, + -1.f, 1.f, + 1.f, 1.f, + 1.f, -1.f }; + glTexCoordPointer(2, GL_FLOAT, 0, tex1); - glVertexPointer(3, GL_FLOAT, 0, vtx1); + glVertexPointer(2, GL_FLOAT, 0, vtx1); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); GL_REPORT_ERRORD(); @@ -389,20 +390,22 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur GLfloat tex1[] = { (float)srcFmtWidth, (float)srcHeight, - (float)srcFmtWidth, 0, - 0, 0, - 0, (float)srcHeight + (float)srcFmtWidth, 0.f, + 0.f, 0.f, + 0.f, (float)srcHeight }; GLfloat vtx1[] = { - 1, -1, 1, - 1, 1, 1, - -1, 1, 1, - -1, -1, 1 + 1.f, -1.f, + 1.f, 1.f, + -1.f, 1.f, + -1.f, -1.f }; + glTexCoordPointer(2, GL_FLOAT, 0, tex1); - glVertexPointer(3, GL_FLOAT, 0, vtx1); + glVertexPointer(2, GL_FLOAT, 0, vtx1); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + GL_REPORT_ERRORD(); // reset state