summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-15 06:02:05 +0200
committerbunnei <bunneidev@gmail.com>2018-07-15 06:02:05 +0200
commit31451141901a659850e6fae448dfb71d38420c58 (patch)
tree6836e5ec5e3825420795d87bc74ed95c5d6f75aa /src/video_core
parentMerge pull request #598 from bunnei/makedonecurrent (diff)
downloadyuzu-31451141901a659850e6fae448dfb71d38420c58.tar
yuzu-31451141901a659850e6fae448dfb71d38420c58.tar.gz
yuzu-31451141901a659850e6fae448dfb71d38420c58.tar.bz2
yuzu-31451141901a659850e6fae448dfb71d38420c58.tar.lz
yuzu-31451141901a659850e6fae448dfb71d38420c58.tar.xz
yuzu-31451141901a659850e6fae448dfb71d38420c58.tar.zst
yuzu-31451141901a659850e6fae448dfb71d38420c58.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
index 323ff7408..84143e513 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -271,9 +271,10 @@ static void ConvertS8Z24ToZ24S8(std::vector<u8>& data, u32 width, u32 height) {
S8Z24 input_pixel{};
Z24S8 output_pixel{};
+
for (size_t y = 0; y < height; ++y) {
for (size_t x = 0; x < width; ++x) {
- const size_t offset{y * width + x};
+ const size_t offset{4 * (y * width + x)};
std::memcpy(&input_pixel, &data[offset], sizeof(S8Z24));
output_pixel.s8.Assign(input_pixel.s8);
output_pixel.z24.Assign(input_pixel.z24);