我面临的问题是我有一个基于 glx 的应用程序,它可以很好地在单个线程上呈现基本原语。我可以在两个屏幕之间移动 XWindow,并且我的渲染循环继续进行。但是,如果我的应用程序的任何部分都有线程,即使它没有进行任何 openGL 调用或触摸任何其他线程上的 XWindow,但当我将 XWindow 从一个屏幕移动到另一个屏幕时,我渲染的图形的主线程会丢失。
我做的第一个函数调用是 XInitThreads,所以我知道 X11 应该是线程安全的。正如我所说,这在一个线程上绘制基元时有效,但当我添加 1 个或多个线程时它不起作用。线程位于我无权访问源的库中。我只是被要求使用 X11 创建代码的窗口部分。
我应该寻找什么来解决这个问题?
另请注意,我已经保证所有 glcalls 都发生在我从库内部调用它们的线程上。
更新
[matt6809@hogganz400 SampleApp]$ cat /etc/X11/xorg.conf && echo "--------" && xrandr --verbose && echo "-------" && glxinfo && echo "-------" && xdpyinfo
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 295.20 (buildmeister@swio-display-x86-rhel47-05.nvidia.com) Mon Feb 6 22:13:16 PST 2012
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 295.20 (buildmeister@swio-display-x86-rhel47-05.nvidia.com) Mon Feb 6 22:13:40 PST 2012
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "1"
EndSection
Section "Files"
FontPath "/usr/share/fonts/default/Type1"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
# generated from data in "/etc/sysconfig/keyboard"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbLayout" "us"
Option "XkbModel" "pc105"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "DELL P190S"
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "Unknown"
ModelName "DELL P190S"
HorizSync 30.0 - 81.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "Unknown"
ModelName "DELL 1908FP"
HorizSync 31.0 - 83.0
VertRefresh 56.0 - 76.0
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro 4000"
BusID "PCI:15:0:0"
Screen 0
EndSection
Section "Device"
Identifier "Device1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro 4000"
BusID "PCI:15:0:0"
Screen 1
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "0"
Option "TwinViewXineramaInfoOrder" "DFP-0"
Option "metamodes" "DFP-0: nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
Section "Screen"
Identifier "Screen1"
Device "Device1"
Monitor "Monitor1"
DefaultDepth 24
Option "TwinView" "0"
Option "metamodes" "DFP-2: nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
--------
Xlib: extension "RANDR" missing on display ":0.0".
RandR extension missing
[matt6809@hogganz400 SampleApp]$