diff options
| author | 2018-07-14 22:18:55 -0700 | |
|---|---|---|
| committer | 2018-07-14 22:18:55 -0700 | |
| commit | aaec0b7e706e6227fdb9833c84f8dbad73a8b623 (patch) | |
| tree | cbd7cbf2c36d6fd5a3fd4a9a9665731abf1691b6 /src | |
| parent | Merge pull request #659 from bunnei/depth16 (diff) | |
| parent | gl_rasterizer_cache: Fix incorrect offset in ConvertS8Z24ToZ24S8. (diff) | |
| download | yuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.tar.gz yuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.tar.xz yuzu-aaec0b7e706e6227fdb9833c84f8dbad73a8b623.zip | |
Merge pull request #665 from bunnei/fix-z24-s8
gl_rasterizer_cache: Fix incorrect offset in ConvertS8Z24ToZ24S8.
Diffstat (limited to '')
| -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 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) { | |||
| 274 | 274 | ||
| 275 | S8Z24 input_pixel{}; | 275 | S8Z24 input_pixel{}; |
| 276 | Z24S8 output_pixel{}; | 276 | Z24S8 output_pixel{}; |
| 277 | |||
| 277 | for (size_t y = 0; y < height; ++y) { | 278 | for (size_t y = 0; y < height; ++y) { |
| 278 | for (size_t x = 0; x < width; ++x) { | 279 | for (size_t x = 0; x < width; ++x) { |
| 279 | const size_t offset{y * width + x}; | 280 | const size_t offset{4 * (y * width + x)}; |
| 280 | std::memcpy(&input_pixel, &data[offset], sizeof(S8Z24)); | 281 | std::memcpy(&input_pixel, &data[offset], sizeof(S8Z24)); |
| 281 | output_pixel.s8.Assign(input_pixel.s8); | 282 | output_pixel.s8.Assign(input_pixel.s8); |
| 282 | output_pixel.z24.Assign(input_pixel.z24); | 283 | output_pixel.z24.Assign(input_pixel.z24); |