rsx: Remove texture mipmap hack

This commit is contained in:
eladash 2018-10-01 07:57:12 +03:00 committed by kd-11
parent 6586090307
commit a92ae827c1
3 changed files with 12 additions and 10 deletions

View file

@ -65,18 +65,17 @@ namespace rsx
u16 fragment_texture::get_exact_mipmap_count() const
{
u16 max_mipmap_count = 1;
u16 max_mipmap_count;
if (is_compressed_format())
{
// OpenGL considers that highest mipmap level for DXTC format is when either width or height is 1
// not both. Assume it's the same for others backend.
max_mipmap_count = static_cast<u16>(floor(log2(std::min(width() / 4, height() / 4))) + 1);
max_mipmap_count = floor_log2(static_cast<u32>(std::min(width() / 4, height() / 4))) + 1;
}
else
max_mipmap_count = static_cast<u16>(floor(log2(std::max(width(), height()))) + 1);
max_mipmap_count = floor_log2(static_cast<u32>(std::max(width(), height()))) + 1;
max_mipmap_count = std::min(mipmap(), max_mipmap_count);
return (max_mipmap_count > 0) ? max_mipmap_count : 1;
return std::min(verify(HERE, mipmap()), max_mipmap_count);
}
rsx::texture_wrap_mode fragment_texture::wrap_s() const
@ -326,10 +325,8 @@ namespace rsx
u16 vertex_texture::get_exact_mipmap_count() const
{
u16 max_mipmap_count = static_cast<u16>(floor(log2(std::max(width(), height()))) + 1);
max_mipmap_count = std::min(mipmap(), max_mipmap_count);
return (max_mipmap_count > 0) ? max_mipmap_count : 1;
const u16 max_mipmap_count = floor_log2(static_cast<u32>(std::max(width(), height()))) + 1;
return std::min(verify(HERE, mipmap()), max_mipmap_count);
}
std::pair<std::array<u8, 4>, std::array<u8, 4>> vertex_texture::decoded_remap() const