mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
x11display: fix crash with multithreading and NVIDIA driver
This commit is contained in:
parent
e32388c2f8
commit
544ef137ee
@ -218,6 +218,23 @@ move_pointer(int device, int x, int y) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears the entire framebuffer before rendering, according to the settings
|
||||
* of get_color_clear_active() and get_depth_clear_active() (inherited from
|
||||
* DrawableRegion).
|
||||
*
|
||||
* This function is called only within the draw thread.
|
||||
*/
|
||||
void x11GraphicsWindow::
|
||||
clear(Thread *current_thread) {
|
||||
if (is_any_clear_active()) {
|
||||
// Evidently the NVIDIA driver may call glXCreateNewContext inside
|
||||
// prepare_display_region, so we need to hold the X11 lock.
|
||||
LightReMutexHolder holder(x11GraphicsPipe::_x_mutex);
|
||||
GraphicsOutput::clear(current_thread);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function will be called within the draw thread before beginning
|
||||
* rendering for a given frame. It should do whatever setup is required, and
|
||||
|
@ -36,6 +36,8 @@ public:
|
||||
|
||||
virtual MouseData get_pointer(int device) const;
|
||||
virtual bool move_pointer(int device, int x, int y);
|
||||
|
||||
virtual void clear(Thread *current_thread);
|
||||
virtual bool begin_frame(FrameMode mode, Thread *current_thread);
|
||||
virtual void end_frame(FrameMode mode, Thread *current_thread);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user