You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I would like to ask about the possibility of multi-threading in the render processing of flycast.
We found that many games couldn't reach 60fps.
We used the perf tool to analyze and found that the processing bottleneck lies in the rendering CPU thread.
Flycast uses a thread for emulatoin of each CPU, and uses another independent CPU thread for rendering processing.
According to my understanding, in the rendering CPU thread, the approximate processing flow is as follows: (We use vulkan)
In the main_loop function, mainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render
In VulkanRenderer::Render, it is determined whether to use textureDrawer or screenDrawer for rendering according to the state of pvrrc.isRTT.
According to my understanding, textureDrawer is to render a part of the screen.
Generally, after many times of processing of mainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render => textureDrawer=>Draw , after the rendering of the entire screen is completed, it will call mainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render => textureDrawer=>Draw
Finally, call ScreenDrawer::PresentFrame to display the screen.
The problem we are currently encountering is that in some more complex game scenes, when calling mainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render => textureDrawer=>Draw multiple times, the processing time will exceed 16ms , that is, the picture fps drops.
Using the perf tool, we can see that during the above processing process, the CPU has been processing, indicating that the processing bottleneck lies in the processing power of the CPU core.
(At this point, two CPU cores are idle.)
So in order to solve the problem of FPS drop, we want to implement multi-thread of related processing.
What I want to ask is, can this processing process mainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render => textureDrawer=>Draw be executed in multiple threads to shorten the rendering time of one screen?
We are not particularly familiar with the code details of flycast, and hope to provide some ideas.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I would like to ask about the possibility of multi-threading in the render processing of flycast.
We found that many games couldn't reach 60fps.
We used the perf tool to analyze and found that the processing bottleneck lies in the rendering CPU thread.
Flycast uses a thread for emulatoin of each CPU, and uses another independent CPU thread for rendering processing.
According to my understanding, in the rendering CPU thread, the approximate processing flow is as follows: (We use vulkan)
In the main_loop function,
mainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render
In VulkanRenderer::Render, it is determined whether to use textureDrawer or screenDrawer for rendering according to the state of pvrrc.isRTT.
According to my understanding, textureDrawer is to render a part of the screen.
Generally, after many times of processing of
mainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render => textureDrawer=>Draw
, after the rendering of the entire screen is completed, it will callmainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render => textureDrawer=>Draw
Finally, call ScreenDrawer::PresentFrame to display the screen.
The problem we are currently encountering is that in some more complex game scenes, when calling
mainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render => textureDrawer=>Draw
multiple times, the processing time will exceed 16ms , that is, the picture fps drops.Using the perf tool, we can see that during the above processing process, the CPU has been processing, indicating that the processing bottleneck lies in the processing power of the CPU core.
(At this point, two CPU cores are idle.)
So in order to solve the problem of FPS drop, we want to implement multi-thread of related processing.
What I want to ask is, can this processing process
mainui_rend_frame => Emulator::render => rend_single_frame => VulkanRenderer::Render => textureDrawer=>Draw
be executed in multiple threads to shorten the rendering time of one screen?We are not particularly familiar with the code details of flycast, and hope to provide some ideas.
Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions