vrend: send list of readback-formats to guest

This is useful to avoid unsupported format-conversions on GLES.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent af92fd1e5e
commit 6a3cd2bde6
  1. 1
      src/virgl_hw.h
  2. 21
      src/vrend_renderer.c

@ -372,6 +372,7 @@ struct virgl_caps_v2 {
uint32_t max_combined_atomic_counters;
uint32_t max_combined_atomic_counter_buffers;
uint32_t host_feature_check_version;
struct virgl_supported_format_mask supported_readback_formats;
};
union virgl_caps {

@ -8768,6 +8768,27 @@ static void vrend_renderer_fill_caps_v2(int gl_ver, int gles_ver, union virgl_c
if (has_feature(feat_indirect_params))
caps->v2.capability_bits |= VIRGL_CAP_INDIRECT_PARAMS;
if (gl_ver > 0) {
for (int i = 0; i < VIRGL_FORMAT_MAX; i++) {
if (tex_conv_table[i].internalformat != 0) {
enum virgl_formats fmt = (enum virgl_formats)i;
if (vrend_format_can_sample(fmt))
set_format_bit(&caps->v2.supported_readback_formats, fmt);
}
}
} else {
assert(gles_ver > 0);
set_format_bit(&caps->v2.supported_readback_formats, VIRGL_FORMAT_R8G8B8A8_UNORM);
if (gles_ver >= 30) {
set_format_bit(&caps->v2.supported_readback_formats, VIRGL_FORMAT_R32G32B32A32_SINT);
set_format_bit(&caps->v2.supported_readback_formats, VIRGL_FORMAT_R32G32B32A32_UINT);
if (gles_ver >= 32)
set_format_bit(&caps->v2.supported_readback_formats, VIRGL_FORMAT_R32G32B32A32_FLOAT);
}
}
}
void vrend_renderer_fill_caps(uint32_t set, UNUSED uint32_t version,

Loading…
Cancel
Save