From e8d6f6a96a4c963a9a1bae8cd634101ffc71b9e2 Mon Sep 17 00:00:00 2001 From: Elie Tournier Date: Fri, 13 Mar 2020 10:11:59 +0000 Subject: [PATCH] vrend: Add host check for clear_texture Signed-off-by: Elie Tournier Reviewed-by: Gert Wollny --- src/virgl_hw.h | 1 + src/vrend_renderer.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/virgl_hw.h b/src/virgl_hw.h index 235ba2c..6d3325c 100644 --- a/src/virgl_hw.h +++ b/src/virgl_hw.h @@ -402,6 +402,7 @@ enum virgl_formats { #define VIRGL_CAP_CLIP_HALFZ (1 << 27) #define VIRGL_CAP_APP_TWEAK_SUPPORT (1 << 28) #define VIRGL_CAP_BGRA_SRGB_IS_EMULATED (1 << 29) +#define VIRGL_CAP_CLEAR_TEXTURE (1 << 30) /* virgl bind flags - these are compatible with mesa 10.5 gallium. * but are fixed, no other should be passed to virgl either. diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 77c66bf..c6f272a 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -108,6 +108,7 @@ enum features_id feat_barrier, feat_bind_vertex_buffers, feat_bit_encoding, + feat_clear_texture, feat_clip_control, feat_compute_shader, feat_copy_image, @@ -198,6 +199,7 @@ static const struct { FEAT(barrier, 42, 31, NULL), FEAT(bind_vertex_buffers, 44, UNAVAIL, NULL), FEAT(bit_encoding, 33, UNAVAIL, "GL_ARB_shader_bit_encoding" ), + FEAT(clear_texture, 44, UNAVAIL, "GL_ARB_clear_texture", "GL_EXT_clear_texture"), FEAT(clip_control, 45, UNAVAIL, "GL_ARB_clip_control", "GL_EXT_clip_control"), FEAT(compute_shader, 43, 31, "GL_ARB_compute_shader" ), FEAT(copy_image, 43, 32, "GL_ARB_copy_image", "GL_EXT_copy_image", "GL_OES_copy_image" ), @@ -9907,6 +9909,9 @@ static void vrend_renderer_fill_caps_v2(int gl_ver, int gles_ver, union virgl_c set_format_bit(&caps->v2.scanout, fmt); } + if (has_feature(feat_clear_texture)) + caps->v2.capability_bits |= VIRGL_CAP_CLEAR_TEXTURE; + if (has_feature(feat_clip_control)) caps->v2.capability_bits |= VIRGL_CAP_CLIP_HALFZ;