mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-20 22:59:59 +01:00
BugFix snap X11??
This commit is contained in:
@@ -1,19 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# test if there is an nvidia GPU
|
||||||
# Test if running under wayland
|
gpu=$(lspci | grep -i '.* vga .* nvidia .*')
|
||||||
if [ -z "$WAYLAND_DISPLAY" ]; then
|
shopt -s nocasematch
|
||||||
# not Wayland, nothing special
|
if [[ $gpu == *' nvidia '* ]]; then
|
||||||
vimix "$@"
|
# with nvidia, request render offload
|
||||||
|
printf 'Nvidia GPU present: %s\n' "$gpu"
|
||||||
|
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia vimix "$@"
|
||||||
else
|
else
|
||||||
# Wayland: test if there is an nvidia GPU
|
# otherwise, nothing special
|
||||||
gpu=$(lspci | grep -i '.* vga .* nvidia .*')
|
printf 'GPU present: %s\n' "$gpu"
|
||||||
shopt -s nocasematch
|
vimix "$@"
|
||||||
if [[ $gpu == *' nvidia '* ]]; then
|
|
||||||
# with nvidia, request Wayland render offload
|
|
||||||
printf 'Nvidia GPU present: %s\n' "$gpu"
|
|
||||||
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia vimix "$@"
|
|
||||||
else
|
|
||||||
# otherwise, nothing special
|
|
||||||
vimix "$@"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -994,7 +994,8 @@ bool RenderingWindow::init(int index, GLFWwindow *share)
|
|||||||
// create the window
|
// create the window
|
||||||
window_ = glfwCreateWindow(winset.w, winset.h, winset.name.c_str(), NULL, master_);
|
window_ = glfwCreateWindow(winset.w, winset.h, winset.name.c_str(), NULL, master_);
|
||||||
if (window_ == NULL){
|
if (window_ == NULL){
|
||||||
g_printerr("Failed to create GLFW Window %d", index_);
|
g_printerr("Failed to create GLFW Window %d (%s, %d x %d)\n",
|
||||||
|
index_, winset.name.c_str(), winset.w, winset.h);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user