mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
Enable prime-run on wayland
This commit is contained in:
25
src/main.cpp
25
src/main.cpp
@@ -1757,6 +1757,16 @@ static void info_command() {
|
||||
if(!wayland)
|
||||
wayland = is_xwayland(dpy);
|
||||
|
||||
if(!wayland) {
|
||||
// Disable prime-run and similar options as it doesn't work, the monitor to capture has to be run on the same device.
|
||||
// This is fine on wayland since nvidia uses drm interface there and the monitor query checks the monitors connected
|
||||
// to the drm device.
|
||||
unsetenv("__NV_PRIME_RENDER_OFFLOAD");
|
||||
unsetenv("__NV_PRIME_RENDER_OFFLOAD_PROVIDER");
|
||||
unsetenv("__GLX_VENDOR_LIBRARY_NAME");
|
||||
unsetenv("__VK_LAYER_NV_optimus");
|
||||
}
|
||||
|
||||
gsr_egl egl;
|
||||
if(!gsr_egl_load(&egl, dpy, wayland, false)) {
|
||||
fprintf(stderr, "gsr error: failed to load opengl\n");
|
||||
@@ -2102,11 +2112,6 @@ int main(int argc, char **argv) {
|
||||
unsetenv("__GL_SYNC_TO_VBLANK");
|
||||
// Same as above, but for amd/intel
|
||||
unsetenv("vblank_mode");
|
||||
// Disable prime-run and similar options as it doesn't work, the monitor to capture has to be run on the same device
|
||||
unsetenv("__NV_PRIME_RENDER_OFFLOAD");
|
||||
unsetenv("__NV_PRIME_RENDER_OFFLOAD_PROVIDER");
|
||||
unsetenv("__GLX_VENDOR_LIBRARY_NAME");
|
||||
unsetenv("__VK_LAYER_NV_optimus");
|
||||
|
||||
if(argc <= 1)
|
||||
usage_full();
|
||||
@@ -2433,6 +2438,16 @@ int main(int argc, char **argv) {
|
||||
if(!wayland)
|
||||
wayland = is_xwayland(dpy);
|
||||
|
||||
if(!wayland) {
|
||||
// Disable prime-run and similar options as it doesn't work, the monitor to capture has to be run on the same device.
|
||||
// This is fine on wayland since nvidia uses drm interface there and the monitor query checks the monitors connected
|
||||
// to the drm device.
|
||||
unsetenv("__NV_PRIME_RENDER_OFFLOAD");
|
||||
unsetenv("__NV_PRIME_RENDER_OFFLOAD_PROVIDER");
|
||||
unsetenv("__GLX_VENDOR_LIBRARY_NAME");
|
||||
unsetenv("__VK_LAYER_NV_optimus");
|
||||
}
|
||||
|
||||
if(video_codec_is_hdr(video_codec) && !wayland) {
|
||||
fprintf(stderr, "Error: hdr video codec option %s is not available on X11\n", video_codec_to_use);
|
||||
_exit(1);
|
||||
|
||||
Reference in New Issue
Block a user