summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-07-23 16:06:34 +0200
committerbunnei <bunneidev@gmail.com>2015-07-23 16:06:34 +0200
commitf602bb9af661122713c82d39f0fcca75f32fafb1 (patch)
tree9ddbe44bb6d92112a0ec514df3e7557a9a5f9d0a /src/video_core/renderer_opengl
parentMerge pull request #968 from Subv/texture_filtering (diff)
parentRasterizer/GL: Set the border color when binding a texture. (diff)
downloadyuzu-f602bb9af661122713c82d39f0fcca75f32fafb1.tar
yuzu-f602bb9af661122713c82d39f0fcca75f32fafb1.tar.gz
yuzu-f602bb9af661122713c82d39f0fcca75f32fafb1.tar.bz2
yuzu-f602bb9af661122713c82d39f0fcca75f32fafb1.tar.lz
yuzu-f602bb9af661122713c82d39f0fcca75f32fafb1.tar.xz
yuzu-f602bb9af661122713c82d39f0fcca75f32fafb1.tar.zst
yuzu-f602bb9af661122713c82d39f0fcca75f32fafb1.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 0e4f8e1ec..dc3ffdf22 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -34,8 +34,15 @@ void RasterizerCacheOpenGL::LoadAndBindTexture(OpenGLState &state, unsigned text
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, PicaToGL::TextureFilterMode(config.config.mag_filter));
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, PicaToGL::TextureFilterMode(config.config.min_filter));
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, PicaToGL::WrapMode(config.config.wrap_s));
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, PicaToGL::WrapMode(config.config.wrap_t));
+ GLenum wrap_s = PicaToGL::WrapMode(config.config.wrap_s);
+ GLenum wrap_t = PicaToGL::WrapMode(config.config.wrap_t);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_s);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_t);
+
+ if (wrap_s == GL_CLAMP_TO_BORDER || wrap_t == GL_CLAMP_TO_BORDER) {
+ auto border_color = PicaToGL::ColorRGBA8((u8*)&config.config.border_color.r);
+ glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, border_color.data());
+ }
const auto info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config.config, config.format);