rsx: Remove texture size hack

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

View file

@ -528,7 +528,7 @@ u8 get_format_block_size_in_bytes(rsx::surface_color_format format)
size_t get_placed_texture_storage_size(u16 width, u16 height, u32 depth, u8 format, u16 mipmap, bool cubemap, size_t row_pitch_alignment, size_t mipmap_alignment)
{
size_t w = width;
size_t h = std::max<u16>(height, 1);
size_t h = height;
size_t d = std::max<u16>(depth, 1);
format &= ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN);
@ -547,7 +547,8 @@ size_t get_placed_texture_storage_size(u16 width, u16 height, u32 depth, u8 form
width_in_blocks = std::max<size_t>(width_in_blocks / 2, 1);
}
return result * (cubemap ? 6 : 1);
// Mipmap, height and width aren't allowed to be zero
return verify("Texture params" HERE, result) * (cubemap ? 6 : 1);
}
size_t get_placed_texture_storage_size(const rsx::fragment_texture &texture, size_t row_pitch_alignment, size_t mipmap_alignment)

View file

@ -1761,12 +1761,6 @@ namespace rsx
const u32 format = tex.format() & ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN);
const bool is_compressed_format = (format == CELL_GCM_TEXTURE_COMPRESSED_DXT1 || format == CELL_GCM_TEXTURE_COMPRESSED_DXT23 || format == CELL_GCM_TEXTURE_COMPRESSED_DXT45);
if (!tex_size || !tex_range.valid())
{
LOG_ERROR(RSX, "Texture upload requested but texture not found, (address=0x%X, size=0x%X, w=%d, h=%d, p=%d, format=0x%X)", texaddr, tex_size, tex.width(), tex.height(), tex.pitch(), tex.format());
return {};
}
const auto extended_dimension = tex.get_extended_texture_dimension();
u16 depth = 0;
u16 tex_height = (u16)tex.height();