diff options
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 4 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 5e97e2f7a..66a80730c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -549,6 +549,8 @@ CachedSurface::CachedSurface(const SurfaceParams& params) // alternatives. This signals a bug on those functions. const auto width = static_cast<GLsizei>(params.MipWidth(0)); const auto height = static_cast<GLsizei>(params.MipHeight(0)); + memory_size = params.MemorySize(); + reinterpreted = false; const auto& format_tuple = GetFormatTuple(params.pixel_format, params.component_type); gl_internal_format = format_tuple.internal_format; @@ -995,6 +997,7 @@ void RasterizerCacheOpenGL::LoadSurface(const Surface& surface) { surface->LoadGLBuffer(); surface->UploadGLTexture(read_framebuffer.handle, draw_framebuffer.handle); surface->MarkAsModified(false, *this); + surface->MarkForReload(false); } Surface RasterizerCacheOpenGL::GetSurface(const SurfaceParams& params, bool preserve_contents) { @@ -1388,7 +1391,6 @@ bool RasterizerCacheOpenGL::PartialReinterpretSurface(Surface triggering_surface return true; } - void RasterizerCacheOpenGL::NotifyFrameBufferChange(Surface triggering_surface) { if (triggering_surface == nullptr) return; diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index 8c3cddf6a..67841d554 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -150,7 +150,7 @@ struct SurfaceParams { } u32 MipWidthGobAligned(u32 mip_level) const { - return std::max(64U*8U / GetFormatBpp(), width >> mip_level); + return Common::AlignUp(std::max(1U, width >> mip_level), 64U * 8U / GetFormatBpp()); } u32 MipHeight(u32 mip_level) const { @@ -564,7 +564,6 @@ protected: } RasterizerCache<Surface>::Unregister(object); } - }; } // namespace OpenGL |