render: properly release rendered buffers (#9807)

* cleanup eglSync

* properly release buffers in renderer

* add renderingDoneCallback and use it in screencopy

* use static constructor for CEGLSync
This commit is contained in:
Ikalco
2025-04-30 11:35:25 -05:00
committed by GitHub
parent 5d005f11fa
commit 2ee5118d7a
14 changed files with 119 additions and 161 deletions

View File

@@ -150,17 +150,20 @@ struct SCurrentRenderData {
class CEGLSync {
public:
static UP<CEGLSync> create();
~CEGLSync();
EGLSyncKHR sync = nullptr;
Hyprutils::OS::CFileDescriptor&& takeFD();
Hyprutils::OS::CFileDescriptor& fd();
Hyprutils::OS::CFileDescriptor&& takeFd();
bool isValid();
private:
CEGLSync() = default;
Hyprutils::OS::CFileDescriptor m_iFd;
Hyprutils::OS::CFileDescriptor m_fd;
EGLSyncKHR m_sync = EGL_NO_SYNC_KHR;
bool m_valid = false;
friend class CHyprOpenGLImpl;
};
@@ -234,7 +237,6 @@ class CHyprOpenGLImpl {
uint32_t getPreferredReadFormat(PHLMONITOR pMonitor);
std::vector<SDRMFormat> getDRMFormats();
EGLImageKHR createEGLImage(const Aquamarine::SDMABUFAttrs& attrs);
SP<CEGLSync> createEGLSync(int fence = -1);
bool initShaders();
bool m_bShadersInitialized = false;