TextureInfo: PrepareResolve, Reorganize source, add better documentation

This commit is contained in:
Dr. Chat
2017-03-14 22:46:47 -05:00
parent 581875b339
commit 4a815e62cb
3 changed files with 119 additions and 85 deletions

View File

@@ -945,23 +945,11 @@ bool VulkanCommandProcessor::IssueCopy() {
}
// Demand a resolve texture from the texture cache.
TextureInfo tex_info = {};
tex_info.guest_address = copy_dest_base;
tex_info.width = dest_logical_width - 1;
tex_info.height = dest_logical_height - 1;
tex_info.dimension = gpu::Dimension::k2D;
tex_info.input_length =
dest_block_width * dest_block_height * dest_texel_size;
tex_info.format_info = FormatInfo::Get(uint32_t(copy_dest_format));
tex_info.endianness = Endian::k8in32;
tex_info.is_tiled = true;
tex_info.size_2d.logical_width = dest_logical_width;
tex_info.size_2d.logical_height = dest_logical_height;
tex_info.size_2d.block_width = dest_block_width;
tex_info.size_2d.block_height = dest_block_height;
tex_info.size_2d.input_width = dest_block_width;
tex_info.size_2d.input_height = dest_block_height;
tex_info.size_2d.input_pitch = copy_dest_pitch * dest_texel_size;
TextureInfo tex_info;
TextureInfo::PrepareResolve(copy_dest_base, copy_dest_format, Endian::k8in32,
dest_logical_width, dest_logical_height,
&tex_info);
auto texture =
texture_cache_->DemandResolveTexture(tex_info, copy_dest_format, nullptr);
assert_not_null(texture);