diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index a8ca57c8c..f0819aa3e 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -852,18 +852,18 @@ void RasterizerOpenGL::ReloadColorBuffer() { using VideoCore::CopyTextureAndUntile; switch (bytes_per_pixel) { case 4: - CopyTextureAndUntile(reinterpret_cast(temp_fb_color_buffer.get()), - reinterpret_cast(color_buffer), + CopyTextureAndUntile(reinterpret_cast(color_buffer), + reinterpret_cast(temp_fb_color_buffer.get()), fb_color_texture.width, fb_color_texture.height); break; case 3: - CopyTextureAndUntile(reinterpret_cast(temp_fb_color_buffer.get()), - reinterpret_cast(color_buffer), + CopyTextureAndUntile(reinterpret_cast(color_buffer), + reinterpret_cast(temp_fb_color_buffer.get()), fb_color_texture.width, fb_color_texture.height); break; case 2: - CopyTextureAndUntile(reinterpret_cast(temp_fb_color_buffer.get()), - reinterpret_cast(color_buffer), + CopyTextureAndUntile(reinterpret_cast(color_buffer), + reinterpret_cast(temp_fb_color_buffer.get()), fb_color_texture.width, fb_color_texture.height); break; default: @@ -975,18 +975,18 @@ void RasterizerOpenGL::CommitColorBuffer() { using VideoCore::CopyTextureAndTile; switch (bytes_per_pixel) { case 4: - CopyTextureAndTile(reinterpret_cast(color_buffer), - reinterpret_cast(temp_gl_color_buffer.get()), + CopyTextureAndTile(reinterpret_cast(temp_gl_color_buffer.get()), + reinterpret_cast(color_buffer), fb_color_texture.width, fb_color_texture.height); break; case 3: - CopyTextureAndTile(reinterpret_cast(color_buffer), - reinterpret_cast(temp_gl_color_buffer.get()), + CopyTextureAndTile(reinterpret_cast(temp_gl_color_buffer.get()), + reinterpret_cast(color_buffer), fb_color_texture.width, fb_color_texture.height); break; case 2: - CopyTextureAndTile(reinterpret_cast(color_buffer), - reinterpret_cast(temp_gl_color_buffer.get()), + CopyTextureAndTile(reinterpret_cast(temp_gl_color_buffer.get()), + reinterpret_cast(color_buffer), fb_color_texture.width, fb_color_texture.height); break; default: diff --git a/src/video_core/utils.h b/src/video_core/utils.h index 887601d2a..faa4087a4 100644 --- a/src/video_core/utils.h +++ b/src/video_core/utils.h @@ -62,13 +62,13 @@ static inline u32 MortonInterleave(u32 x, u32 y) { * * @param T Type of the source and destination pointers, the swizzling process depends on the size * of this parameter. - * @param dst Pointer to which the texture will be copied. * @param src Pointer to the source texture data. + * @param dst Pointer to which the texture will be copied. * @param width Width of the texture, should be a multiple of 8. * @param height Height of the texture, should be a multiple of 8. */ template -static inline void CopyTextureAndTile(T* dst, const T* src, unsigned int width, unsigned int height) { +static inline void CopyTextureAndTile(const T* src, T* dst, unsigned int width, unsigned int height) { for (unsigned int y = 0; y + 8 <= height; y += 8) { for (unsigned int x = 0; x + 8 <= width; x += 8) { const T* line = &src[y * width + x]; @@ -90,13 +90,13 @@ static inline void CopyTextureAndTile(T* dst, const T* src, unsigned int width, * * @param T Type of the source and destination pointers, the swizzling process depends on the size * of this parameter. - * @param dst Pointer to which the texture will be copied. * @param src Pointer to the source texture data. + * @param dst Pointer to which the texture will be copied. * @param width Width of the texture, should be a multiple of 8. * @param height Height of the texture, should be a multiple of 8. */ template -static inline void CopyTextureAndUntile(T* dst, const T* src, unsigned int width, unsigned int height) { +static inline void CopyTextureAndUntile(const T* src, T* dst, unsigned int width, unsigned int height) { for (unsigned int y = 0; y + 8 <= height; y += 8) { for (unsigned int x = 0; x + 8 <= width; x += 8) { T* line = &dst[y * width + x];