diff --git a/rpcs3/Emu/RSX/Common/TextureUtils.cpp b/rpcs3/Emu/RSX/Common/TextureUtils.cpp index 8064275d05..83d8fff1ce 100644 --- a/rpcs3/Emu/RSX/Common/TextureUtils.cpp +++ b/rpcs3/Emu/RSX/Common/TextureUtils.cpp @@ -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(height, 1); + size_t h = height; size_t d = std::max(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(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) diff --git a/rpcs3/Emu/RSX/Common/texture_cache.h b/rpcs3/Emu/RSX/Common/texture_cache.h index b4e08a0be2..3fff718291 100644 --- a/rpcs3/Emu/RSX/Common/texture_cache.h +++ b/rpcs3/Emu/RSX/Common/texture_cache.h @@ -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();