vrend,blit: Don't use GL blit when src and dest swizzles are the same

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Gert Wollny 6 years ago committed by Dave Airlie
parent 92fe2c2821
commit 3a55d4ba91
  1. 12
      src/vrend_renderer.c

@ -644,9 +644,14 @@ bool vrend_format_is_emulated_alpha(enum virgl_formats format)
format == VIRGL_FORMAT_A16_UNORM); format == VIRGL_FORMAT_A16_UNORM);
} }
static bool vrend_format_needs_swizzle(enum virgl_formats format) static bool vrend_blit_needs_swizzle(enum virgl_formats src,
enum virgl_formats dst)
{ {
return tex_conv_table[format].flags & VIRGL_BIND_NEED_SWIZZLE; for (int i = 0; i < 4; ++i) {
if (tex_conv_table[src].swizzle[i] != tex_conv_table[dst].swizzle[i])
return true;
}
return false;
} }
static inline const char *pipe_shader_to_prefix(int shader_type) static inline const char *pipe_shader_to_prefix(int shader_type)
@ -7334,8 +7339,7 @@ static void vrend_renderer_blit_int(struct vrend_context *ctx,
if (info->src.box.depth != info->dst.box.depth) if (info->src.box.depth != info->dst.box.depth)
use_gl = true; use_gl = true;
if (vrend_format_needs_swizzle(info->dst.format) || if (vrend_blit_needs_swizzle(info->dst.format, info->src.format))
vrend_format_needs_swizzle(info->src.format))
use_gl = true; use_gl = true;
if (use_gl) { if (use_gl) {

Loading…
Cancel
Save