Przeglądaj źródła

Merge pull request #665 from bunnei/fix-z24-s8

gl_rasterizer_cache: Fix incorrect offset in ConvertS8Z24ToZ24S8.
bunnei 8 lat temu
rodzic
commit
aaec0b7e70

+ 2 - 1
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);