summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorTom Englund <tomenglund26@gmail.com>2025-10-25 21:36:02 +0200
committerGitHub <noreply@github.com>2025-10-25 20:36:02 +0100
commit6ea4769b39fccec22ae2acd015511a745d378840 (patch)
treea98f8f2052599d60bbe5e7e89a6698c84ad497ab /src/render/OpenGL.cpp
parent72cbb7906a0c65eb62b1d5ddb0769dc0391f37e6 (diff)
EGL: minor egl changes (#12132)
* opengl: use EGLint and we dont have to cast data use EGLint in the attrib array and we dont have to cast the resulting data. * opengl: add linear to correct vector drop empty check, what if we get mods that isnt linear. then it wont be added, also add it to the result vector that we actually return.
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 90a8e679..c16cbf15 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -483,8 +483,8 @@ std::optional<std::vector<uint64_t>> CHyprOpenGLImpl::getModsForFormat(EGLint fo
}
// if the driver doesn't mark linear as external, add it. It's allowed unless the driver says otherwise. (e.g. nvidia)
- if (!linearIsExternal && std::ranges::find(mods, DRM_FORMAT_MOD_LINEAR) == mods.end() && mods.empty())
- mods.push_back(DRM_FORMAT_MOD_LINEAR);
+ if (!linearIsExternal && std::ranges::find(mods, DRM_FORMAT_MOD_LINEAR) == mods.end())
+ result.push_back(DRM_FORMAT_MOD_LINEAR);
return result;
}
@@ -582,8 +582,8 @@ void CHyprOpenGLImpl::initDRMFormats() {
}
EGLImageKHR CHyprOpenGLImpl::createEGLImage(const Aquamarine::SDMABUFAttrs& attrs) {
- std::array<uint32_t, 50> attribs;
- size_t idx = 0;
+ std::array<EGLint, 50> attribs;
+ size_t idx = 0;
attribs[idx++] = EGL_WIDTH;
attribs[idx++] = attrs.size.x;
@@ -626,7 +626,7 @@ EGLImageKHR CHyprOpenGLImpl::createEGLImage(const Aquamarine::SDMABUFAttrs& attr
RASSERT(idx <= attribs.size(), "createEglImage: attribs array out of bounds.");
- EGLImageKHR image = m_proc.eglCreateImageKHR(m_eglDisplay, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, nullptr, rc<int*>(attribs.data()));
+ EGLImageKHR image = m_proc.eglCreateImageKHR(m_eglDisplay, EGL_NO_CONTEXT, EGL_LINUX_DMA_BUF_EXT, nullptr, attribs.data());
if (image == EGL_NO_IMAGE_KHR) {
Debug::log(ERR, "EGL: EGLCreateImageKHR failed: {}", eglGetError());
return EGL_NO_IMAGE_KHR;