mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Renderer: Handle resize events on-demand instead of polling
We now differentiate between a resize event and surface change/destroyed event, reducing the overhead for resizes in the Vulkan backend. It is also now now safe to change the surface multiple times if the video thread is lagging behind.
This commit is contained in:
@ -154,7 +154,8 @@ public:
|
||||
PostProcessingShaderImplementation* GetPostProcessor() const { return m_post_processor.get(); }
|
||||
// Final surface changing
|
||||
// This is called when the surface is resized (WX) or the window changes (Android).
|
||||
virtual void ChangeSurface(void* new_surface_handle) {}
|
||||
void ChangeSurface(void* new_surface_handle);
|
||||
void ResizeSurface(int new_width, int new_height);
|
||||
bool UseVertexDepthRange() const;
|
||||
|
||||
virtual void Shutdown();
|
||||
@ -178,9 +179,11 @@ protected:
|
||||
int m_target_width = 0;
|
||||
int m_target_height = 0;
|
||||
|
||||
// TODO: Add functionality to reinit all the render targets when the window is resized.
|
||||
// Backbuffer (window) size and render area
|
||||
int m_backbuffer_width = 0;
|
||||
int m_backbuffer_height = 0;
|
||||
int m_new_backbuffer_width = 0;
|
||||
int m_new_backbuffer_height = 0;
|
||||
TargetRectangle m_target_rectangle = {};
|
||||
|
||||
FPSCounter m_fps_counter;
|
||||
@ -189,8 +192,9 @@ protected:
|
||||
|
||||
void* m_surface_handle = nullptr;
|
||||
void* m_new_surface_handle = nullptr;
|
||||
Common::Flag m_surface_needs_change;
|
||||
Common::Event m_surface_changed;
|
||||
Common::Flag m_surface_changed;
|
||||
Common::Flag m_surface_resized;
|
||||
std::mutex m_swap_mutex;
|
||||
|
||||
u32 m_last_host_config_bits = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user