From 6b5d7919c58e30ff03868dcbd6851d98a317d48a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 21 May 2018 14:59:39 +1000 Subject: [PATCH] add ARB_conditional_render_inverted support Adds the inverted queries to the conversion function. Reviewed-by: Elie Tournier --- src/virgl_hw.h | 1 + src/vrend_renderer.c | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/virgl_hw.h b/src/virgl_hw.h index 1701bc9..6dc5791 100644 --- a/src/virgl_hw.h +++ b/src/virgl_hw.h @@ -238,6 +238,7 @@ struct virgl_caps_bool_set1 { unsigned has_indirect_draw:1; unsigned has_sample_shading:1; unsigned has_cull:1; + unsigned conditional_render_inverted:1; }; /* endless expansion capabilites - current gallium has 252 formats */ diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 52c8b10..3884435 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -6537,16 +6537,16 @@ void vrend_render_condition(struct vrend_context *ctx, switch (mode) { case PIPE_RENDER_COND_WAIT: - glmode = GL_QUERY_WAIT; + glmode = condition ? GL_QUERY_WAIT_INVERTED : GL_QUERY_WAIT; break; case PIPE_RENDER_COND_NO_WAIT: - glmode = GL_QUERY_NO_WAIT; + glmode = condition ? GL_QUERY_NO_WAIT_INVERTED : GL_QUERY_NO_WAIT; break; case PIPE_RENDER_COND_BY_REGION_WAIT: - glmode = GL_QUERY_BY_REGION_WAIT; + glmode = condition ? GL_QUERY_BY_REGION_WAIT_INVERTED : GL_QUERY_BY_REGION_WAIT; break; case PIPE_RENDER_COND_BY_REGION_NO_WAIT: - glmode = GL_QUERY_BY_REGION_NO_WAIT; + glmode = condition ? GL_QUERY_BY_REGION_NO_WAIT_INVERTED : GL_QUERY_BY_REGION_NO_WAIT; break; default: fprintf(stderr, "unhandled condition %x\n", mode); @@ -6954,9 +6954,12 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version, if (gl_ver >= 45) { caps->v1.bset.has_cull = 1; + caps->v1.bset.conditional_render_inverted = 1; } else { if (epoxy_has_gl_extension("GL_ARB_cull_distance")) caps->v1.bset.has_cull = 1; + if (epoxy_has_gl_extension("GL_ARB_conditional_render_inverted")) + caps->v1.bset.conditional_render_inverted = 1; } if (epoxy_has_gl_extension("GL_EXT_texture_mirror_clamp") ||