Bug fixes and formatting

This commit is contained in:
Fernando Sahmkow 2019-02-08 20:33:11 -04:00 committed by FernandoS27
parent 5bc82d124c
commit e9d84ef22c
2 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -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