Minor fixes

- vulkan: Do not assume an aux frame context must exist in a well defined state as set in init_buffers() since the request might be external (via overlays path)
- gl: Do not bother waiting for idle before servicing external flip requests
- gl: Queue overlay cleanup requests to ensure only glthread attempts touching the context
- overlays: Do not compute size metrics for invalid/unsupported glyphs
This commit is contained in:
kd-11 2018-01-21 23:55:01 +03:00
parent 3d9e3a16f1
commit 4f01794713
4 changed files with 28 additions and 12 deletions

View File

@ -1237,7 +1237,7 @@ void GLGSRender::flip(int buffer)
u32 buffer_height = display_buffers[buffer].height; u32 buffer_height = display_buffers[buffer].height;
u32 buffer_pitch = display_buffers[buffer].pitch; u32 buffer_pitch = display_buffers[buffer].pitch;
if (buffer < display_buffers_count && buffer_width && buffer_height && buffer_pitch) if ((u32)buffer < display_buffers_count && buffer_width && buffer_height && buffer_pitch)
{ {
// Calculate blit coordinates // Calculate blit coordinates
coordi aspect_ratio; coordi aspect_ratio;
@ -1423,7 +1423,7 @@ void GLGSRender::on_notify_memory_unmapped(u32 address_base, u32 size)
} }
} }
void GLGSRender::do_local_task(bool idle) void GLGSRender::do_local_task(bool /*idle*/)
{ {
m_frame->clear_wm_events(); m_frame->clear_wm_events();
@ -1444,9 +1444,14 @@ void GLGSRender::do_local_task(bool idle)
q.cv.notify_one(); q.cv.notify_one();
} }
if (m_custom_ui) if (m_overlay_cleanup_requests.size())
{ {
if (!in_begin_end && idle && native_ui_flip_request.load()) m_ui_renderer.remove_temp_resources();
m_overlay_cleanup_requests.clear();
}
else if (m_custom_ui)
{
if (!in_begin_end && native_ui_flip_request.load())
{ {
native_ui_flip_request.store(false); native_ui_flip_request.store(false);
flip((s32)current_display_buffer); flip((s32)current_display_buffer);
@ -1517,5 +1522,6 @@ void GLGSRender::get_occlusion_query_result(rsx::occlusion_query_info* query)
void GLGSRender::shell_do_cleanup() void GLGSRender::shell_do_cleanup()
{ {
m_ui_renderer.remove_temp_resources(); //TODO: Key cleanup requests with UID to identify resources to remove
} m_overlay_cleanup_requests.push_back(0);
}

View File

@ -307,6 +307,8 @@ private:
gl::depth_convert_pass m_depth_converter; gl::depth_convert_pass m_depth_converter;
gl::ui_overlay_renderer m_ui_renderer; gl::ui_overlay_renderer m_ui_renderer;
std::vector<u64> m_overlay_cleanup_requests;
std::mutex queue_guard; std::mutex queue_guard;
std::list<work_item> work_queue; std::list<work_item> work_queue;

View File

@ -2010,7 +2010,7 @@ void VKGSRender::process_swap_request(frame_context_t *ctx, bool free_resources)
ctx->swap_command_buffer = nullptr; ctx->swap_command_buffer = nullptr;
} }
void VKGSRender::do_local_task(bool idle) void VKGSRender::do_local_task(bool /*idle*/)
{ {
if (m_flush_requests.pending()) if (m_flush_requests.pending())
{ {
@ -2857,10 +2857,10 @@ void VKGSRender::flip(int buffer)
if (m_current_frame == &m_aux_frame_context) if (m_current_frame == &m_aux_frame_context)
{ {
m_current_frame = &frame_context_storage[m_current_queue_index]; m_current_frame = &frame_context_storage[m_current_queue_index];
if (m_current_frame->swap_command_buffer && m_current_frame->swap_command_buffer->pending) if (m_current_frame->swap_command_buffer)
{ {
//No choice but to wait for the last frame on the dst swapchain image to complete //Always present if pending swap is present.
m_current_frame->swap_command_buffer->wait(); //Its possible this flip request is triggered by overlays and the flip queue is in undefined state
process_swap_request(m_current_frame, true); process_swap_request(m_current_frame, true);
} }
@ -2967,7 +2967,7 @@ void VKGSRender::flip(int buffer)
//Blit contents to screen.. //Blit contents to screen..
vk::image* image_to_flip = nullptr; vk::image* image_to_flip = nullptr;
if (buffer < display_buffers_count && buffer_width && buffer_height && buffer_pitch) if ((u32)buffer < display_buffers_count && buffer_width && buffer_height && buffer_pitch)
{ {
rsx::tiled_region buffer_region = get_tiled_address(display_buffers[buffer].offset, CELL_GCM_LOCATION_LOCAL); rsx::tiled_region buffer_region = get_tiled_address(display_buffers[buffer].offset, CELL_GCM_LOCATION_LOCAL);
u32 absolute_address = buffer_region.address + buffer_region.base; u32 absolute_address = buffer_region.address + buffer_region.base;

View File

@ -854,7 +854,15 @@ namespace rsx
last_word = text_width; last_word = text_width;
} }
renderer->get_char(c, text_width, unused); if ((u32)c > renderer->char_count)
{
//Non-existent glyph
text_width += renderer->em_size;
}
else
{
renderer->get_char(c, text_width, unused);
}
if (!ignore_word_wrap && wrap_text && text_width >= w) if (!ignore_word_wrap && wrap_text && text_width >= w)
{ {