screencopy: fix shm exports with 10-bit

fixes #4019
This commit is contained in:
Vaxry
2023-12-01 17:20:56 +00:00
parent 8440a30231
commit 9c09f2a847
7 changed files with 37 additions and 30 deletions

View File

@@ -2064,3 +2064,16 @@ void CHyprOpenGLImpl::bindBackOnMain() {
void CHyprOpenGLImpl::setMonitorTransformEnabled(bool enabled) {
m_bEndFrame = !enabled;
}
uint32_t CHyprOpenGLImpl::getPreferredReadFormat(CMonitor* pMonitor) {
if (g_pHyprRenderer->isNvidia())
return DRM_FORMAT_XRGB8888;
if (pMonitor->drmFormat == DRM_FORMAT_XRGB8888)
return DRM_FORMAT_XRGB8888;
if (pMonitor->drmFormat == DRM_FORMAT_XBGR8888)
return DRM_FORMAT_XBGR8888;
if (pMonitor->drmFormat == DRM_FORMAT_XRGB2101010 || pMonitor->drmFormat == DRM_FORMAT_XBGR2101010)
return DRM_FORMAT_XBGR2101010;
return DRM_FORMAT_INVALID;
}