diff --git a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp index c74e10a2b5..53d2f85552 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/FramebufferManager.cpp @@ -345,7 +345,7 @@ XFBSourceBase* FramebufferManager::CreateXFBSource(unsigned int target_width, un glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_RECTANGLE, texture); - glTexImage2D(GL_TEXTURE_RECTANGLE, 0, 4, target_width, target_height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, target_width, target_height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); glBindTexture(GL_TEXTURE_RECTANGLE, 0); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index 1ff4a7b3d4..168fee7e9f 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -429,7 +429,6 @@ Renderer::Renderer() glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); - glDisable(GL_LIGHTING); glDepthFunc(GL_LEQUAL); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); // 4-byte pixel alignment @@ -441,11 +440,6 @@ Renderer::Renderer() glBlendColor(0, 0, 0, 0.5f); glClearDepth(1.0f); - // legacy multitexturing: select texture channel only. - glActiveTexture(GL_TEXTURE0); - glClientActiveTexture(GL_TEXTURE0); - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - UpdateActiveConfig(); //return GL_REPORT_ERROR() == GL_NO_ERROR && bSuccess; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp index e7b46081af..231b89cbdc 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureCache.cpp @@ -166,13 +166,13 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width, PanicAlert("Invalid PC texture format %i", pcfmt); case PC_TEX_FMT_BGRA32: gl_format = GL_BGRA; - gl_iformat = 4; + gl_iformat = GL_RGBA; gl_type = GL_UNSIGNED_BYTE; break; case PC_TEX_FMT_RGBA32: gl_format = GL_RGBA; - gl_iformat = 4; + gl_iformat = GL_RGBA; gl_type = GL_UNSIGNED_BYTE; break; @@ -232,9 +232,8 @@ void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height, if (bHaveMipMaps && autogen_mips) { - glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE); glTexImage2D(GL_TEXTURE_2D, level, gl_iformat, width, height, 0, gl_format, gl_type, temp); - glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_FALSE); + glGenerateMipmap(GL_TEXTURE_2D); } else { @@ -262,7 +261,7 @@ TextureCache::TCacheEntryBase* TextureCache::CreateRenderTargetTexture( const GLenum gl_format = GL_RGBA, - gl_iformat = 4, + gl_iformat = GL_RGBA, gl_type = GL_UNSIGNED_BYTE; glTexImage2D(GL_TEXTURE_2D, 0, gl_iformat, scaled_tex_w, scaled_tex_h, 0, gl_format, gl_type, NULL); @@ -313,7 +312,6 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo glDrawBuffer(GL_COLOR_ATTACHMENT0); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, 0); - glEnable(GL_TEXTURE_RECTANGLE); glBindTexture(GL_TEXTURE_RECTANGLE, read_texture); glViewport(0, 0, virtual_width, virtual_height); @@ -449,7 +447,6 @@ void TextureCache::TCacheEntry::SetTextureParameters(const TexMode0 &newmode, co glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, c_MinLinearFilter[filt & 7]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, newmode1.min_lod >> 4); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, newmode1.max_lod >> 4); - glTexEnvf(GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, (newmode.lod_bias / 32.0f)); } else glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, @@ -575,9 +572,6 @@ TextureCache::~TextureCache() void TextureCache::DisableStage(unsigned int stage) { - glActiveTexture(GL_TEXTURE0 + stage); - glDisable(GL_TEXTURE_2D); - glDisable(GL_TEXTURE_RECTANGLE); } } diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp index 3c5d2f4f14..cd4f9e6d5b 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureConverter.cpp @@ -247,7 +247,6 @@ void EncodeToRamUsingShader(GLuint srcTexture, const TargetRectangle& sourceRc, // set source texture glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, 0); - glEnable(GL_TEXTURE_RECTANGLE); glBindTexture(GL_TEXTURE_RECTANGLE, srcTexture); if (linearFilter) @@ -433,7 +432,6 @@ void DecodeToTexture(u32 xfbAddr, int srcWidth, int srcHeight, GLuint destTextur // set srcAddr as data for source texture glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, 0); - glEnable(GL_TEXTURE_RECTANGLE); glBindTexture(GL_TEXTURE_RECTANGLE, s_srcTexture); // TODO: make this less slow. (How?)