From 2bcbf943f29721e6ae352fabab8b780efb6223bd Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 29 Mar 2019 15:15:27 +0100 Subject: [PATCH] vrend: add a cap for astc compressed 3d-textures This is useful for knowing if we can expose KHR_texture_compression_astc_sliced_3d in the guest. Signed-off-by: Erik Faye-Lund Reviewed-by: Gurchetan Singh --- src/virgl_hw.h | 1 + src/vrend_renderer.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/virgl_hw.h b/src/virgl_hw.h index d0a2ff8..ee0e0e5 100644 --- a/src/virgl_hw.h +++ b/src/virgl_hw.h @@ -245,6 +245,7 @@ enum virgl_formats { #define VIRGL_CAP_MULTI_DRAW_INDIRECT (1 << 21) #define VIRGL_CAP_INDIRECT_PARAMS (1 << 22) #define VIRGL_CAP_TRANSFORM_FEEDBACK3 (1 << 23) +#define VIRGL_CAP_3D_ASTC (1 << 24) /* 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 8a33a57..332e1ac 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -8791,6 +8791,9 @@ static void vrend_renderer_fill_caps_v2(int gl_ver, int gles_ver, union virgl_c set_format_bit(&caps->v2.supported_readback_formats, VIRGL_FORMAT_R32G32B32A32_FLOAT); } } + + if (epoxy_has_gl_extension("GL_KHR_texture_compression_astc_sliced_3d")) + caps->v2.capability_bits |= VIRGL_CAP_3D_ASTC; } void vrend_renderer_fill_caps(uint32_t set, UNUSED uint32_t version,