summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorFernandoS27 <fsahmkow27@gmail.com>2018-10-28 23:58:07 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2018-10-29 00:00:49 +0100
commitdde3094058358cfeaa436b4324adda305b4570bf (patch)
treef93b34ebf4907a4377b6eb2900a3364adda7bd32 /src/video_core
parentFixed mipmap block autosizing algorithm (diff)
downloadyuzu-dde3094058358cfeaa436b4324adda305b4570bf.tar
yuzu-dde3094058358cfeaa436b4324adda305b4570bf.tar.gz
yuzu-dde3094058358cfeaa436b4324adda305b4570bf.tar.bz2
yuzu-dde3094058358cfeaa436b4324adda305b4570bf.tar.lz
yuzu-dde3094058358cfeaa436b4324adda305b4570bf.tar.xz
yuzu-dde3094058358cfeaa436b4324adda305b4570bf.tar.zst
yuzu-dde3094058358cfeaa436b4324adda305b4570bf.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index b2250e6be..81b86b7a5 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -878,6 +878,8 @@ CachedSurface::CachedSurface(const SurfaceParams& params)
glTexParameteri(SurfaceTargetToGL(params.target), GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(SurfaceTargetToGL(params.target), GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(SurfaceTargetToGL(params.target), GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexParameteri(SurfaceTargetToGL(params.target), GL_TEXTURE_MAX_LEVEL,
+ params.max_mip_level - 1);
if (params.max_mip_level == 1) {
glTexParameterf(SurfaceTargetToGL(params.target), GL_TEXTURE_LOD_BIAS, 1000.0);
}
@@ -1196,20 +1198,6 @@ void CachedSurface::UploadGLTexture(GLuint read_fb_handle, GLuint draw_fb_handle
for (u32 i = 0; i < params.max_mip_level; i++)
UploadGLMipmapTexture(i, read_fb_handle, draw_fb_handle);
-
- if (params.max_mip_level == 1) {
- const GLuint target_tex = texture.handle;
- OpenGLState cur_state = OpenGLState::GetCurState();
- const auto& old_tex = cur_state.texture_units[0];
- SCOPE_EXIT({
- cur_state.texture_units[0] = old_tex;
- cur_state.Apply();
- });
- cur_state.texture_units[0].texture = target_tex;
- cur_state.texture_units[0].target = SurfaceTargetToGL(params.target);
- cur_state.Apply();
- glGenerateMipmap(SurfaceTargetToGL(params.target));
- }
}
RasterizerCacheOpenGL::RasterizerCacheOpenGL() {