From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: libvir-list@redhat.com, Peter Maydell <peter.maydell@linaro.org>,
Gerd Hoffmann <kraxel@redhat.com>,
Akihiko Odaki <akihiko.odaki@gmail.com>
Subject: [PULL 04/11] opengl: Do not convert format with glTexImage2D on OpenGL ES
Date: Tue, 16 Mar 2021 06:38:06 +0100 [thread overview]
Message-ID: <20210316053813.1719442-5-kraxel@redhat.com> (raw)
In-Reply-To: <20210316053813.1719442-1-kraxel@redhat.com>
From: Akihiko Odaki <akihiko.odaki@gmail.com>
OpenGL ES does not support conversion from the given data format
to the internal format with glTexImage2D.
Use the given data format as the internal format, and ignore
the given alpha channels with GL_TEXTURE_SWIZZLE_A in case the
format contains alpha channels.
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-Id: <20210219094803.90860-1-akihiko.odaki@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/console-gl.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/ui/console-gl.c b/ui/console-gl.c
index 0a6478161fed..7c9894a51d99 100644
--- a/ui/console-gl.c
+++ b/ui/console-gl.c
@@ -73,11 +73,20 @@ void surface_gl_create_texture(QemuGLShader *gls,
glBindTexture(GL_TEXTURE_2D, surface->texture);
glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT,
surface_stride(surface) / surface_bytes_per_pixel(surface));
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
- surface_width(surface),
- surface_height(surface),
- 0, surface->glformat, surface->gltype,
- surface_data(surface));
+ if (epoxy_is_desktop_gl()) {
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB,
+ surface_width(surface),
+ surface_height(surface),
+ 0, surface->glformat, surface->gltype,
+ surface_data(surface));
+ } else {
+ glTexImage2D(GL_TEXTURE_2D, 0, surface->glformat,
+ surface_width(surface),
+ surface_height(surface),
+ 0, surface->glformat, surface->gltype,
+ surface_data(surface));
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ONE);
+ }
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
--
2.29.2
next prev parent reply other threads:[~2021-03-16 5:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-16 5:38 [PULL 00/11] Ui 20210316 patches Gerd Hoffmann
2021-03-16 5:38 ` [PULL 01/11] ui: introduce "password-secret" option for VNC servers Gerd Hoffmann
2021-03-16 5:38 ` [PULL 02/11] ui: introduce "password-secret" option for SPICE server Gerd Hoffmann
2021-03-16 5:38 ` [PULL 03/11] ui: deprecate "password" " Gerd Hoffmann
2021-03-16 5:38 ` Gerd Hoffmann [this message]
2021-03-16 5:38 ` [PULL 05/11] ui/cocoa: Do not exit immediately after shutdown Gerd Hoffmann
2021-03-16 5:38 ` [PULL 06/11] ui: add more trace points for VNC client/server messages Gerd Hoffmann
2021-03-16 5:38 ` [PULL 07/11] ui: avoid sending framebuffer updates outside client desktop bounds Gerd Hoffmann
2021-03-16 5:38 ` [PULL 08/11] ui: use client width/height in WMVi message Gerd Hoffmann
2021-03-16 5:38 ` [PULL 09/11] ui: honour the actual guest display dimensions without rounding Gerd Hoffmann
2021-03-16 5:38 ` [PULL 10/11] ui: fold qemu_alloc_display in only caller Gerd Hoffmann
2021-03-16 5:38 ` [PULL 11/11] ui/cocoa: Comment about modifier key input quirks Gerd Hoffmann
2021-03-17 14:59 ` [PULL 00/11] Ui 20210316 patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210316053813.1719442-5-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=akihiko.odaki@gmail.com \
--cc=libvir-list@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).