Explorar o código

Zero out memory region of recreated surface before flushing

FernandoS27 %!s(int64=7) %!d(string=hai) anos
pai
achega
dc85e3bff1
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/video_core/renderer_opengl/gl_rasterizer_cache.cpp

+ 2 - 0
src/video_core/renderer_opengl/gl_rasterizer_cache.cpp

@@ -1325,6 +1325,8 @@ void RasterizerCacheOpenGL::AccurateCopySurface(const Surface& src_surface,
                                                 const Surface& dst_surface) {
     const auto& src_params{src_surface->GetSurfaceParams()};
     const auto& dst_params{dst_surface->GetSurfaceParams()};
+    auto* start = Memory::GetPointer(src_params.addr);
+    std::fill(start, start + dst_params.MemorySize(), 0);
     FlushRegion(src_params.addr, dst_params.MemorySize());
     LoadSurface(dst_surface);
 }