diff options
| author | 2018-07-15 00:02:05 -0400 | |
|---|---|---|
| committer | 2018-07-15 00:02:05 -0400 | |
| commit | 31451141901a659850e6fae448dfb71d38420c58 (patch) | |
| tree | 6836e5ec5e3825420795d87bc74ed95c5d6f75aa /src/video_core | |
| parent | Merge pull request #598 from bunnei/makedonecurrent (diff) | |
| download | yuzu-31451141901a659850e6fae448dfb71d38420c58.tar.gz yuzu-31451141901a659850e6fae448dfb71d38420c58.tar.xz yuzu-31451141901a659850e6fae448dfb71d38420c58.zip | |
gl_rasterizer_cache: Fix incorrect offset in ConvertS8Z24ToZ24S8.
Diffstat (limited to 'src/video_core')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 3 |
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) { | |||
| 271 | 271 | ||
| 272 | S8Z24 input_pixel{}; | 272 | S8Z24 input_pixel{}; |
| 273 | Z24S8 output_pixel{}; | 273 | Z24S8 output_pixel{}; |
| 274 | |||
| 274 | for (size_t y = 0; y < height; ++y) { | 275 | for (size_t y = 0; y < height; ++y) { |
| 275 | for (size_t x = 0; x < width; ++x) { | 276 | for (size_t x = 0; x < width; ++x) { |
| 276 | const size_t offset{y * width + x}; | 277 | const size_t offset{4 * (y * width + x)}; |
| 277 | std::memcpy(&input_pixel, &data[offset], sizeof(S8Z24)); | 278 | std::memcpy(&input_pixel, &data[offset], sizeof(S8Z24)); |
| 278 | output_pixel.s8.Assign(input_pixel.s8); | 279 | output_pixel.s8.Assign(input_pixel.s8); |
| 279 | output_pixel.z24.Assign(input_pixel.z24); | 280 | output_pixel.z24.Assign(input_pixel.z24); |