summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-15 07:18:55 +0200
committerGitHub <noreply@github.com>2018-07-15 07:18:55 +0200
commitaaec0b7e706e6227fdb9833c84f8dbad73a8b623 (patch)
treecbd7cbf2c36d6fd5a3fd4a9a9665731abf1691b6
parentMerge pull request #659 from bunnei/depth16 (diff)
parentgl_rasterizer_cache: Fix incorrect offset in ConvertS8Z24ToZ24S8. (diff)
downloadyuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.tar
yuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.tar.gz
yuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.tar.bz2
yuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.tar.lz
yuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.tar.xz
yuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.tar.zst
yuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.zip
-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 361a09626..4efe20c70 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -274,9 +274,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);