mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-15 22:54:00 +00:00
gl_rasterizer_cache: Fix incorrect offset in ConvertS8Z24ToZ24S8.
This commit is contained in:
parent
2cb3fdca86
commit
3145114190
1 changed files with 2 additions and 1 deletions
|
@ -271,9 +271,10 @@ static void ConvertS8Z24ToZ24S8(std::vector<u8>& data, u32 width, u32 height) {
|
||||||
|
|
||||||
S8Z24 input_pixel{};
|
S8Z24 input_pixel{};
|
||||||
Z24S8 output_pixel{};
|
Z24S8 output_pixel{};
|
||||||
|
|
||||||
for (size_t y = 0; y < height; ++y) {
|
for (size_t y = 0; y < height; ++y) {
|
||||||
for (size_t x = 0; x < width; ++x) {
|
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));
|
std::memcpy(&input_pixel, &data[offset], sizeof(S8Z24));
|
||||||
output_pixel.s8.Assign(input_pixel.s8);
|
output_pixel.s8.Assign(input_pixel.s8);
|
||||||
output_pixel.z24.Assign(input_pixel.z24);
|
output_pixel.z24.Assign(input_pixel.z24);
|
||||||
|
|
Loading…
Reference in a new issue