Skip to content

Commit

Permalink
rsx: Fix sampling in X when 0 pitch is given
Browse files Browse the repository at this point in the history
- A pitch of 0 still allows 1-dimensional addressing.
  • Loading branch information
kd-11 committed Oct 31, 2021
1 parent 1650dd1 commit 5b0ef40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rpcs3/Emu/RSX/Common/TextureUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ std::vector<rsx::subresource_layout> get_subresources_layout_impl(const RsxTextu
}
else
{
w = h = depth = 1;
h = depth = 1;
}
}

Expand Down Expand Up @@ -1161,7 +1161,7 @@ namespace rsx
if (width > 1 || height > 1)
{
// If width == 1, the scanning just returns texel 0, so it is a valid setup
rsx_log.error("Invalid texture pitch setup, width=%d, height=%d, format=0x%x(0x%x)",
rsx_log.warning("Invalid texture pitch setup, width=%d, height=%d, format=0x%x(0x%x)",
width, height, format, gcm_format);
}

Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/Common/texture_cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,7 @@ namespace rsx
if (attributes.pitch = tex.pitch(); !attributes.pitch)
{
attributes.pitch = packed_pitch;
scale = { 0.f, 0.f, 0.f };
scale = { 1.f, 0.f, 0.f };
}
else if (packed_pitch > attributes.pitch && !options.is_compressed_format)
{
Expand Down

0 comments on commit 5b0ef40

Please sign in to comment.