vrend: fix internal format mismatch for BGRX EGL-backed resources

BGRX resources backed by EGL images are given GL_RGB8 internal format
on creation outside of virglrenderer, so we must accomodate when
creating a texture view.

Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
macos/master
Ryan Neph 3 years ago
parent 695e7d411a
commit d989e5bbbe
  1. 5
      src/vrend_renderer.c

@ -1893,6 +1893,11 @@ int vrend_create_surface(struct vrend_context *ctx,
GLenum target = res->target; GLenum target = res->target;
GLenum internalformat = tex_conv_table[format].internalformat; GLenum internalformat = tex_conv_table[format].internalformat;
if (res->base.format == VIRGL_FORMAT_B8G8R8X8_UNORM &&
has_bit(res->storage_bits, VREND_STORAGE_EGL_IMAGE)) {
internalformat = GL_RGB8;
}
VREND_DEBUG(dbg_tex, ctx, "Create texture view from %s for %s\n", VREND_DEBUG(dbg_tex, ctx, "Create texture view from %s for %s\n",
util_format_name(res->base.format), util_format_name(res->base.format),
util_format_name(surf->format)); util_format_name(surf->format));

Loading…
Cancel
Save