Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
bd9b4291
Commit
bd9b4291
authored
Sep 17, 2021
by
Severin von Wnuck
Browse files
Fix texture format handling for Nvidia driver
parent
b219b917
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/wayland/drmclientbuffer.cpp
View file @
bd9b4291
...
...
@@ -36,12 +36,16 @@ DrmClientBuffer::DrmClientBuffer(wl_resource *resource, DrmClientBufferIntegrati
Q_D
(
DrmClientBuffer
);
EGLDisplay
eglDisplay
=
integration
->
display
()
->
eglDisplay
();
eglQueryWaylandBufferWL
(
eglDisplay
,
resource
,
EGL_TEXTURE_FORMAT
,
&
d
->
textureFormat
);
if
(
!
eglQueryWaylandBufferWL
(
eglDisplay
,
resource
,
EGL_TEXTURE_FORMAT
,
&
d
->
textureFormat
))
{
// The proprietary Nvidia driver doesn't support querying the EGL_TEXTURE_FORMAT.
// We must assume that the buffer has an alpha channel for transparency to work.
d
->
textureFormat
=
EGL_TEXTURE_RGBA
;
}
eglQueryWaylandBufferWL
(
eglDisplay
,
resource
,
EGL_WIDTH
,
&
d
->
width
);
eglQueryWaylandBufferWL
(
eglDisplay
,
resource
,
EGL_HEIGHT
,
&
d
->
height
);
bool
ok
=
eglQueryWaylandBufferWL
(
eglDisplay
,
resource
,
EGL_WAYLAND_Y_INVERTED_WL
,
&
d
->
yInverted
);
if
(
!
ok
)
{
if
(
!
eglQueryWaylandBufferWL
(
eglDisplay
,
resource
,
EGL_WAYLAND_Y_INVERTED_WL
,
&
d
->
yInverted
))
{
// If EGL_WAYLAND_Y_INVERTED_WL is unsupported, we must assume that the buffer is inverted.
d
->
yInverted
=
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment