From 31451141901a659850e6fae448dfb71d38420c58 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 15 Jul 2018 00:02:05 -0400 Subject: gl_rasterizer_cache: Fix incorrect offset in ConvertS8Z24ToZ24S8. --- src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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& 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); -- cgit v1.2.3