From 662c348b6cefc7dbdf086ccdde51a514abaa5229 Mon Sep 17 00:00:00 2001 From: BreadFish64 Date: Sat, 27 Jun 2020 13:23:34 -0500 Subject: [PATCH] fix --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 2 +- src/video_core/renderer_opengl/gl_resource_manager.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 9411663264..cf3290109a 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -779,7 +779,7 @@ bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) { temp_tex.Create(); glBindTexture(GL_TEXTURE_2D, temp_tex.handle); auto [internal_format, format, type] = GetFormatTuple(color_surface->pixel_format); - OGLTexture::Allocate(GL_TEXTURE_2D, color_surface->max_level, internal_format, format, type, + OGLTexture::Allocate(GL_TEXTURE_2D, color_surface->max_level + 1, internal_format, format, type, color_surface->GetScaledWidth(), color_surface->GetScaledHeight()); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); diff --git a/src/video_core/renderer_opengl/gl_resource_manager.cpp b/src/video_core/renderer_opengl/gl_resource_manager.cpp index 19bc83aa37..846edd0662 100644 --- a/src/video_core/renderer_opengl/gl_resource_manager.cpp +++ b/src/video_core/renderer_opengl/gl_resource_manager.cpp @@ -64,8 +64,8 @@ void OGLTexture::Allocate(GLenum target, GLsizei levels, GLenum internalformat, glTexStorage1D(target, levels, internalformat, width); } else { for (GLsizei level{0}; level < levels; ++level) { - width >>= 1; glTexImage1D(target, level, internalformat, width, 0, format, type, nullptr); + width >>= 1; } } break; @@ -77,11 +77,11 @@ void OGLTexture::Allocate(GLenum target, GLsizei levels, GLenum internalformat, glTexStorage2D(target, levels, internalformat, width, height); } else { for (GLsizei level{0}; level < levels; ++level) { + glTexImage2D(target, level, internalformat, width, height, 0, format, type, + nullptr); width >>= 1; if (target != GL_TEXTURE_1D_ARRAY) height >>= 1; - glTexImage2D(target, level, internalformat, width, height, 0, format, type, - nullptr); } } break;