mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-06 07:01:57 -07:00
@@ -2067,14 +2067,6 @@ void CHyprOpenGLImpl::setMonitorTransformEnabled(bool enabled) {
|
||||
m_bEndFrame = !enabled;
|
||||
}
|
||||
|
||||
struct SGLPixelFormat {
|
||||
uint32_t drmFormat = DRM_FORMAT_INVALID;
|
||||
GLint glInternalFormat = 0;
|
||||
GLint glFormat = 0;
|
||||
GLint glType = 0;
|
||||
bool withAlpha = false;
|
||||
};
|
||||
|
||||
inline const SGLPixelFormat GLES2_FORMATS[] = {
|
||||
{
|
||||
.drmFormat = DRM_FORMAT_ARGB8888,
|
||||
@@ -2179,9 +2171,6 @@ inline const SGLPixelFormat GLES2_FORMATS[] = {
|
||||
};
|
||||
|
||||
uint32_t CHyprOpenGLImpl::getPreferredReadFormat(CMonitor* pMonitor) {
|
||||
if (g_pHyprRenderer->isNvidia())
|
||||
return DRM_FORMAT_XBGR8888;
|
||||
|
||||
GLint glf = -1, glt = -1, as = -1;
|
||||
glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &glf);
|
||||
glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &glt);
|
||||
@@ -2202,3 +2191,12 @@ uint32_t CHyprOpenGLImpl::getPreferredReadFormat(CMonitor* pMonitor) {
|
||||
|
||||
return DRM_FORMAT_XBGR8888;
|
||||
}
|
||||
|
||||
const SGLPixelFormat* CHyprOpenGLImpl::getPixelFormatFromDRM(uint32_t drmFormat) {
|
||||
for (auto& fmt : GLES2_FORMATS) {
|
||||
if (fmt.drmFormat == drmFormat)
|
||||
return &fmt;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
Reference in New Issue
Block a user