Nix: fix nvidia patch for dual gpu system

* this fix it most important for laptops with dgpu
 * remove post patch line wlroots.nix

Signed-off-by: Gonçalo Duarte <gonegrier.duarte@gmail.com>
This commit is contained in:
Gonçalo Duarte 2023-08-02 14:47:19 +01:00 committed by Mihai Fufezan
parent 8e04a80e60
commit 12cb109137
2 changed files with 13 additions and 9 deletions

View File

@ -1,3 +1,16 @@
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 9fe934f7..9662d4ee 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -176,7 +176,7 @@ static bool gles2_bind_buffer(struct wlr_renderer *wlr_renderer,
assert(wlr_egl_is_current(renderer->egl));
push_gles2_debug(renderer);
- glFlush();
+ glFinish();
glBindFramebuffer(GL_FRAMEBUFFER, 0);
pop_gles2_debug(renderer);
diff --git a/types/output/render.c b/types/output/render.c
index 2e38919a..97f78608 100644
--- a/types/output/render.c

View File

@ -46,15 +46,6 @@ assert (lib.assertMsg (hidpiXWayland -> enableXWayland) ''
++ (lib.optionals nvidiaPatches [
./patches/wlroots-nvidia.patch
]);
postPatch =
(old.postPatch or "")
+ (
if nvidiaPatches
then ''
substituteInPlace render/gles2/renderer.c --replace "glFlush();" "glFinish();"
''
else ""
);
buildInputs = old.buildInputs ++ [hwdata libliftoff libdisplay-info];
NIX_CFLAGS_COMPILE = toString [