summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-02-09 01:33:11 +0100
committerFernandoS27 <fsahmkow27@gmail.com>2019-02-28 02:58:44 +0100
commite9d84ef22cfea4e5ce72116f03d1b8d357582c58 (patch)
tree997f811c7f79def5fda152fd305fcaacc05ece36
parentrasterizer_cache_gl: Implement Texception Pass (diff)
downloadyuzu-e9d84ef22cfea4e5ce72116f03d1b8d357582c58.tar
yuzu-e9d84ef22cfea4e5ce72116f03d1b8d357582c58.tar.gz
yuzu-e9d84ef22cfea4e5ce72116f03d1b8d357582c58.tar.bz2
yuzu-e9d84ef22cfea4e5ce72116f03d1b8d357582c58.tar.lz
yuzu-e9d84ef22cfea4e5ce72116f03d1b8d357582c58.tar.xz
yuzu-e9d84ef22cfea4e5ce72116f03d1b8d357582c58.tar.zst
yuzu-e9d84ef22cfea4e5ce72116f03d1b8d357582c58.zip
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp4
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h3
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