Skip to content

Instantly share code, notes, and snippets.

View gulafaran's full-sized avatar

Tom Englund gulafaran

View GitHub Profile
#include <iostream>
// GLEW
#define GLEW_STATIC
#include <GL/glew.h>
// GLFW
#include <GLFW/glfw3.h>
// Window dimensions
total 0
drwxr-xr-x 2 root root 0 11 aug 12.59 .
drwxr-xr-x 80 root root 0 11 aug 12.59 ..
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-DP-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DP-1
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-DP-2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DP-2
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-DP-3 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DP-3
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-eDP-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-eDP-1
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-HDMI-A-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-HDMI-A-1
lrwxrwxrwx 1 root root 0 11 aug 12.59 card2 -> ../../devices/pci0000:00/0000:00:02.0/drm/card2
total 0
drwxr-xr-x 2 root root 0 11 aug 12.59 .
drwxr-xr-x 80 root root 0 11 aug 12.59 ..
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-DP-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DP-1
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-DP-2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DP-2
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-DP-3 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DP-3
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-eDP-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-eDP-1
lrwxrwxrwx 1 root root 0 11 aug 12.59 card1-HDMI-A-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/car
/sys/class/drm/
├── card1 -> ../../devices/platform/soc/206400000.gpu/drm/card1
├── card2 -> ../../devices/platform/soc/228200000.display-pipe/drm/card2
├── card2-DSI-1 -> ../../devices/platform/soc/228200000.display-pipe/drm/card2/card2-DSI-1
├── card3 -> ../../devices/platform/soc/soc:display-subsystem/drm/card3
├── card3-eDP-1 -> ../../devices/platform/soc/soc:display-subsystem/drm/card3/card3-eDP-1
├── renderD128 -> ../../devices/platform/soc/206400000.gpu/drm/renderD128
└── version
diff --git a/src/protocols/types/Buffer.hpp b/src/protocols/types/Buffer.hpp
index f5c1d848..207cad16 100644
--- a/src/protocols/types/Buffer.hpp
+++ b/src/protocols/types/Buffer.hpp
@@ -9,6 +9,7 @@
class CSyncReleaser;
class CHLBufferReference;
+class CEGLSync;
diff --git a/src/render/pass/BorderPassElement.hpp b/src/render/pass/BorderPassElement.hpp
index 238b9ed5..5929c3e6 100644
--- a/src/render/pass/BorderPassElement.hpp
+++ b/src/render/pass/BorderPassElement.hpp
@@ -18,7 +18,10 @@ class CBorderPassElement : public IPassElement {
CBorderPassElement(const SBorderData& data_);
virtual ~CBorderPassElement() = default;
- virtual void draw(const CRegion& damage);
+ virtual void draw(const CRegion& damage);
#include <wayland-client.h>
#include <wayland-egl.h>
#include <EGL/egl.h>
#include <EGL/eglplatform.h>
#include <GLES2/gl2.h>
#include "xdg-shell-client-protocol.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <vulkan/vulkan.h>
#include <unistd.h> // For close(fd)
#include <iostream>
// Function to create exportable Vulkan memory
VkDeviceMemory allocateExportableMemory(VkDevice device, VkDeviceSize size, uint32_t memoryTypeIndex, int* outFd) {
VkExportMemoryAllocateInfo exportAllocInfo{};
exportAllocInfo.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO;
exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
diff --git a/src/protocols/Screencopy.cpp b/src/protocols/Screencopy.cpp
index aae5caf1..701987ca 100644
--- a/src/protocols/Screencopy.cpp
+++ b/src/protocols/Screencopy.cpp
@@ -221,6 +221,9 @@ bool CScreencopyFrame::copyDmabuf() {
g_pHyprOpenGL->m_RenderData.blockScreenShader = true;
g_pHyprRenderer->endRender();
+ auto sync = g_pHyprOpenGL->createEGLSync();
+ sync->wait();
This file has been truncated, but you can view the full file.
[1688110.631] {Default Queue} -> wl_display#1.get_registry(new id wl_registry#2)
[1688110.645] {Default Queue} -> wl_display#1.sync(new id wl_callback#3)
[1688110.676] {Display Queue} wl_display#1.delete_id(3)
[1688110.679] {Default Queue} wl_registry#2.global(1, "wl_seat", 9)
[1688110.681] {Default Queue} -> wl_registry#2.bind(1, "wl_seat", 1, new id [unknown]#4)
[1688110.683] {Default Queue} wl_registry#2.global(2, "wl_data_device_manager", 3)
[1688110.684] {Default Queue} wl_registry#2.global(3, "wl_compositor", 6)
[1688110.686] {Default Queue} -> wl_registry#2.bind(3, "wl_compositor", 4, new id [unknown]#5)
[1688110.687] {Default Queue} wl_registry#2.global(4, "wl_subcompositor", 1)