diff options
| author | 2019-02-02 22:41:39 -0500 | |
|---|---|---|
| committer | 2019-02-06 21:54:25 -0500 | |
| commit | 35e111876647afbe65a97509c2613da42477a81e (patch) | |
| tree | eddd390961e4c81857d49dc6b488bf2efec13ffc | |
| parent | gl_rasterizer: Implement a more accurate fermi 2D copy. (diff) | |
| download | yuzu-35e111876647afbe65a97509c2613da42477a81e.tar.gz yuzu-35e111876647afbe65a97509c2613da42477a81e.tar.xz yuzu-35e111876647afbe65a97509c2613da42477a81e.zip | |
gl_rasterizer_cache: Mark surface copy destinations as modified.
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 18 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.h | 4 |
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 | ||
| 431 | static void FastCopySurface(const Surface& src_surface, const Surface& dst_surface) { | 431 | void 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 | ||
| 443 | MICROPROFILE_DEFINE(OpenGL_CopySurface, "OpenGL", "CopySurface", MP_RGB(128, 192, 64)); | 446 | MICROPROFILE_DEFINE(OpenGL_CopySurface, "OpenGL", "CopySurface", MP_RGB(128, 192, 64)); |
| 444 | static void CopySurface(const Surface& src_surface, const Surface& dst_surface, | 447 | void 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 | ||
| 528 | CachedSurface::CachedSurface(const SurfaceParams& params) | 534 | CachedSurface::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 | ||
| 1024 | static bool BlitSurface(const Surface& src_surface, const Surface& dst_surface, | 1032 | static 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 | ||
| 1175 | void RasterizerCacheOpenGL::AccurateCopySurface(const Surface& src_surface, | 1185 | void 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 |