Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulkan: Fix some cleaning behavior. #1626

Merged
merged 2 commits into from Mar 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion rpcs3/Emu/RSX/VK/VKGSRender.cpp
Expand Up @@ -613,7 +613,6 @@ void VKGSRender::end()

vkCmdEndRenderPass(m_command_buffer);

m_texture_cache.flush(m_command_buffer);

end_command_buffer_recording();
execute_command_buffer(false);
Expand Down Expand Up @@ -1246,9 +1245,11 @@ void VKGSRender::flip(int buffer)
//Feed back damaged resources to the main texture cache for management...
// m_texture_cache.merge_dirty_textures(m_rtts.invalidated_resources);
m_rtts.invalidated_resources.clear();
m_texture_cache.flush();

m_buffer_view_to_clean.clear();
m_sampler_to_clean.clear();
m_framebuffer_to_clean.clear();

m_draw_calls = 0;
dirty_frame = true;
Expand Down
15 changes: 1 addition & 14 deletions rpcs3/Emu/RSX/VK/VKTextureCache.h
Expand Up @@ -30,7 +30,6 @@ namespace vk
{
private:
std::vector<cached_texture_object> m_cache;
u32 num_dirty_textures = 0;

std::vector<std::unique_ptr<vk::image_view> > m_temporary_image_view;

Expand Down Expand Up @@ -138,8 +137,6 @@ namespace vk
tex.exists = false;
}
}

num_dirty_textures = 0;
}

public:
Expand All @@ -154,15 +151,6 @@ namespace vk

vk::image_view* upload_texture(command_buffer cmd, rsx::texture &tex, rsx::vk_render_targets &m_rtts, const vk::memory_type_mapping &memory_type_mapping, data_heap& upload_heap, vk::buffer* upload_buffer)
{
if (num_dirty_textures > 32)
{
/**
* Should actually reuse available dirty textures whenever possible.
* For now, just remove them, from vram
*/
purge_dirty_textures();
}

const u32 texaddr = rsx::get_address(tex.offset(), tex.location());
const u32 range = (u32)get_texture_size(tex);

Expand Down Expand Up @@ -237,7 +225,6 @@ namespace vk
{
unlock_object(tex);

num_dirty_textures++;
tex.native_rsx_address = 0;
tex.dirty = true;

Expand All @@ -248,7 +235,7 @@ namespace vk
return false;
}

void flush(vk::command_buffer &cmd)
void flush()
{
m_temporary_image_view.clear();
}
Expand Down