mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-01 07:13:36 +00:00
Merge pull request #1626 from vlj/vulkan
Vulkan: Fix some cleaning behavior.
This commit is contained in:
commit
35570a5ebf
@ -613,7 +613,6 @@ void VKGSRender::end()
|
|||||||
|
|
||||||
vkCmdEndRenderPass(m_command_buffer);
|
vkCmdEndRenderPass(m_command_buffer);
|
||||||
|
|
||||||
m_texture_cache.flush(m_command_buffer);
|
|
||||||
|
|
||||||
end_command_buffer_recording();
|
end_command_buffer_recording();
|
||||||
execute_command_buffer(false);
|
execute_command_buffer(false);
|
||||||
@ -1246,9 +1245,11 @@ void VKGSRender::flip(int buffer)
|
|||||||
//Feed back damaged resources to the main texture cache for management...
|
//Feed back damaged resources to the main texture cache for management...
|
||||||
// m_texture_cache.merge_dirty_textures(m_rtts.invalidated_resources);
|
// m_texture_cache.merge_dirty_textures(m_rtts.invalidated_resources);
|
||||||
m_rtts.invalidated_resources.clear();
|
m_rtts.invalidated_resources.clear();
|
||||||
|
m_texture_cache.flush();
|
||||||
|
|
||||||
m_buffer_view_to_clean.clear();
|
m_buffer_view_to_clean.clear();
|
||||||
m_sampler_to_clean.clear();
|
m_sampler_to_clean.clear();
|
||||||
|
m_framebuffer_to_clean.clear();
|
||||||
|
|
||||||
m_draw_calls = 0;
|
m_draw_calls = 0;
|
||||||
dirty_frame = true;
|
dirty_frame = true;
|
||||||
|
@ -30,7 +30,6 @@ namespace vk
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::vector<cached_texture_object> m_cache;
|
std::vector<cached_texture_object> m_cache;
|
||||||
u32 num_dirty_textures = 0;
|
|
||||||
|
|
||||||
std::vector<std::unique_ptr<vk::image_view> > m_temporary_image_view;
|
std::vector<std::unique_ptr<vk::image_view> > m_temporary_image_view;
|
||||||
|
|
||||||
@ -138,8 +137,6 @@ namespace vk
|
|||||||
tex.exists = false;
|
tex.exists = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
num_dirty_textures = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -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)
|
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 texaddr = rsx::get_address(tex.offset(), tex.location());
|
||||||
const u32 range = (u32)get_texture_size(tex);
|
const u32 range = (u32)get_texture_size(tex);
|
||||||
|
|
||||||
@ -237,7 +225,6 @@ namespace vk
|
|||||||
{
|
{
|
||||||
unlock_object(tex);
|
unlock_object(tex);
|
||||||
|
|
||||||
num_dirty_textures++;
|
|
||||||
tex.native_rsx_address = 0;
|
tex.native_rsx_address = 0;
|
||||||
tex.dirty = true;
|
tex.dirty = true;
|
||||||
|
|
||||||
@ -248,7 +235,7 @@ namespace vk
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void flush(vk::command_buffer &cmd)
|
void flush()
|
||||||
{
|
{
|
||||||
m_temporary_image_view.clear();
|
m_temporary_image_view.clear();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user