1
0
Fork 0

gl_rasterizer_cache: add missing watcher invalidation

This commit is contained in:
wwylele 2018-05-18 23:57:55 +03:00
parent e35c634fc6
commit 8b4e832c5f
1 changed files with 6 additions and 0 deletions

View File

@ -334,6 +334,8 @@ static bool FillSurface(const Surface& surface, const u8* fill_data,
state.draw.draw_framebuffer = draw_fb_handle;
state.Apply();
surface->InvalidateAllWatcher();
if (surface->type == SurfaceType::Color || surface->type == SurfaceType::Texture) {
glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
surface->texture.handle, 0);
@ -1029,6 +1031,8 @@ bool RasterizerCacheOpenGL::BlitSurfaces(const Surface& src_surface,
if (!SurfaceParams::CheckFormatsBlittable(src_surface->pixel_format, dst_surface->pixel_format))
return false;
dst_surface->InvalidateAllWatcher();
return BlitTextures(src_surface->texture.handle, src_rect, dst_surface->texture.handle,
dst_rect, src_surface->type, read_framebuffer.handle,
draw_framebuffer.handle);
@ -1427,10 +1431,12 @@ SurfaceSurfaceRect_Tuple RasterizerCacheOpenGL::GetFramebufferSurfaces(
if (color_surface != nullptr) {
ValidateSurface(color_surface, boost::icl::first(color_vp_interval),
boost::icl::length(color_vp_interval));
color_surface->InvalidateAllWatcher();
}
if (depth_surface != nullptr) {
ValidateSurface(depth_surface, boost::icl::first(depth_vp_interval),
boost::icl::length(depth_vp_interval));
depth_surface->InvalidateAllWatcher();
}
return std::make_tuple(color_surface, depth_surface, fb_rect);