From 0364a2a3182c28d89bda62eb8b84ef4582e139aa Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Fri, 27 Jul 2018 09:51:56 +0200 Subject: [PATCH] expose FBFETCH-cap if supported [airlied: use a feat_framebuffer_fetch] Signed-off-by: Erik Faye-Lund Signed-off-by: Dave Airlie --- 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 6ab549a..70b0b24 100644 --- a/src/virgl_hw.h +++ b/src/virgl_hw.h @@ -227,6 +227,7 @@ enum virgl_formats { #define VIRGL_CAP_COMPUTE_SHADER (1 << 7) #define VIRGL_CAP_FB_NO_ATTACH (1 << 8) #define VIRGL_CAP_ROBUST_BUFFER_ACCESS (1 << 9) +#define VIRGL_CAP_TGSI_FBFETCH (1 << 10) /* 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 48fb241..3e9615b 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -102,6 +102,7 @@ enum features_id feat_draw_instance, feat_dual_src_blend, feat_fb_no_attach, + feat_framebuffer_fetch, feat_geometry_shader, feat_gl_conditional_render, feat_gl_prim_restart, @@ -161,6 +162,7 @@ static const struct { [feat_draw_instance] = { 31, 30, { "GL_ARB_draw_instanced" } }, [feat_dual_src_blend] = { 33, UNAVAIL, { "GL_ARB_blend_func_extended" } }, [feat_fb_no_attach] = { 43, 31, { "GL_ARB_framebuffer_no_attachments" } }, + [feat_framebuffer_fetch] = { UNAVAIL, UNAVAIL, { "GL_EXT_shader_framebuffer_fetch" } }, [feat_geometry_shader] = { 32, UNAVAIL, {} }, [feat_gl_conditional_render] = { 30, UNAVAIL, {} }, [feat_gl_prim_restart] = { 31, UNAVAIL, {} }, @@ -8226,6 +8228,9 @@ void vrend_renderer_fill_caps(uint32_t set, UNUSED uint32_t version, if (has_feature(feat_robust_buffer_access)) caps->v2.capability_bits |= VIRGL_CAP_ROBUST_BUFFER_ACCESS; + + if (has_feature(feat_framebuffer_fetch)) + caps->v2.capability_bits |= VIRGL_CAP_TGSI_FBFETCH; } GLint64 vrend_renderer_get_timestamp(void)