summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp18
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.h4
2 files changed, 18 insertions, 4 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index f585c8884..33bd9f7c1 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -428,7 +428,8 @@ void SwizzleFunc(const MortonSwizzleMode& mode, const SurfaceParams& params,
428 } 428 }
429} 429}
430 430
431static void FastCopySurface(const Surface& src_surface, const Surface& dst_surface) { 431void RasterizerCacheOpenGL::FastCopySurface(const Surface& src_surface,
432 const Surface& dst_surface) {
432 const auto& src_params{src_surface->GetSurfaceParams()}; 433 const auto& src_params{src_surface->GetSurfaceParams()};
433 const auto& dst_params{dst_surface->GetSurfaceParams()}; 434 const auto& dst_params{dst_surface->GetSurfaceParams()};
434 435
@@ -438,12 +439,15 @@ static void FastCopySurface(const Surface& src_surface, const Surface& dst_surfa
438 glCopyImageSubData(src_surface->Texture().handle, SurfaceTargetToGL(src_params.target), 0, 0, 0, 439 glCopyImageSubData(src_surface->Texture().handle, SurfaceTargetToGL(src_params.target), 0, 0, 0,
439 0, dst_surface->Texture().handle, SurfaceTargetToGL(dst_params.target), 0, 0, 440 0, dst_surface->Texture().handle, SurfaceTargetToGL(dst_params.target), 0, 0,
440 0, 0, width, height, 1); 441 0, 0, width, height, 1);
442
443 dst_surface->MarkAsModified(true, *this);
441} 444}
442 445
443MICROPROFILE_DEFINE(OpenGL_CopySurface, "OpenGL", "CopySurface", MP_RGB(128, 192, 64)); 446MICROPROFILE_DEFINE(OpenGL_CopySurface, "OpenGL", "CopySurface", MP_RGB(128, 192, 64));
444static void CopySurface(const Surface& src_surface, const Surface& dst_surface, 447void RasterizerCacheOpenGL::CopySurface(const Surface& src_surface, const Surface& dst_surface,
445 const GLuint copy_pbo_handle, const GLenum src_attachment = 0, 448 const GLuint copy_pbo_handle, const GLenum src_attachment,
446 const GLenum dst_attachment = 0, const std::size_t cubemap_face = 0) { 449 const GLenum dst_attachment,
450 const std::size_t cubemap_face) {
447 MICROPROFILE_SCOPE(OpenGL_CopySurface); 451 MICROPROFILE_SCOPE(OpenGL_CopySurface);
448 ASSERT_MSG(dst_attachment == 0, "Unimplemented"); 452 ASSERT_MSG(dst_attachment == 0, "Unimplemented");
449 453
@@ -523,6 +527,8 @@ static void CopySurface(const Surface& src_surface, const Surface& dst_surface,
523 } 527 }
524 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0); 528 glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
525 } 529 }
530
531 dst_surface->MarkAsModified(true, *this);
526} 532}
527 533
528CachedSurface::CachedSurface(const SurfaceParams& params) 534CachedSurface::CachedSurface(const SurfaceParams& params)
@@ -1019,6 +1025,8 @@ void RasterizerCacheOpenGL::FastLayeredCopySurface(const Surface& src_surface,
1019 } 1025 }
1020 address += layer_size; 1026 address += layer_size;
1021 } 1027 }
1028
1029 dst_surface->MarkAsModified(true, *this);
1022} 1030}
1023 1031
1024static bool BlitSurface(const Surface& src_surface, const Surface& dst_surface, 1032static bool BlitSurface(const Surface& src_surface, const Surface& dst_surface,
@@ -1170,6 +1178,8 @@ void RasterizerCacheOpenGL::FermiCopySurface(
1170 1178
1171 BlitSurface(src_surface, dst_surface, src_rect, dst_rect, read_framebuffer.handle, 1179 BlitSurface(src_surface, dst_surface, src_rect, dst_rect, read_framebuffer.handle,
1172 draw_framebuffer.handle); 1180 draw_framebuffer.handle);
1181
1182 dst_surface->MarkAsModified(true, *this);
1173} 1183}
1174 1184
1175void RasterizerCacheOpenGL::AccurateCopySurface(const Surface& src_surface, 1185void RasterizerCacheOpenGL::AccurateCopySurface(const Surface& src_surface,
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
index c742f4a93..2235df9c7 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h
@@ -444,6 +444,10 @@ private:
444 /// Performs a slow but accurate surface copy, flushing to RAM and reinterpreting the data 444 /// Performs a slow but accurate surface copy, flushing to RAM and reinterpreting the data
445 void AccurateCopySurface(const Surface& src_surface, const Surface& dst_surface); 445 void AccurateCopySurface(const Surface& src_surface, const Surface& dst_surface);
446 void FastLayeredCopySurface(const Surface& src_surface, const Surface& dst_surface); 446 void FastLayeredCopySurface(const Surface& src_surface, const Surface& dst_surface);
447 void FastCopySurface(const Surface& src_surface, const Surface& dst_surface);
448 void CopySurface(const Surface& src_surface, const Surface& dst_surface,
449 const GLuint copy_pbo_handle, const GLenum src_attachment = 0,
450 const GLenum dst_attachment = 0, const std::size_t cubemap_face = 0);
447 451
448 /// The surface reserve is a "backup" cache, this is where we put unique surfaces that have 452 /// The surface reserve is a "backup" cache, this is where we put unique surfaces that have
449 /// previously been used. This is to prevent surfaces from being constantly created and 453 /// previously been used. This is to prevent surfaces from being constantly created and