Vulkan: Do near-exact lookups for the frontbuffer texture (may break everything).

This commit is contained in:
gibbed
2017-08-09 02:28:47 -05:00
parent ff1a3aaa67
commit f8edc761fc
3 changed files with 66 additions and 3 deletions

View File

@@ -395,10 +395,19 @@ void VulkanCommandProcessor::PerformSwap(uint32_t frontbuffer_ptr,
}
auto swap_fb = reinterpret_cast<VkImage>(swap_state_.front_buffer_texture);
auto& regs = *register_file_;
int r = XE_GPU_REG_SHADER_CONSTANT_FETCH_00_0;
auto group =
reinterpret_cast<const xenos::xe_gpu_fetch_group_t*>(&regs.values[r]);
auto& fetch = group->texture_fetch;
TextureInfo texture_info;
if (!TextureInfo::Prepare(group->texture_fetch, &texture_info)) {
assert_always();
}
// Issue the commands to copy the game's frontbuffer to our backbuffer.
auto texture = texture_cache_->LookupAddress(
frontbuffer_ptr, xe::round_up(frontbuffer_width, 32),
/*xe::round_up(*/ frontbuffer_height /*, 32)*/, TextureFormat::k_8_8_8_8);
auto texture = texture_cache_->Lookup(texture_info);
if (texture) {
texture->in_flight_fence = current_batch_fence_;