[virglrenderer-devel] [PATCH 2/6] add ARB_conditional_render_inverted support
Dave Airlie
airlied at gmail.com
Mon May 21 06:09:33 UTC 2018
From: Dave Airlie <airlied at redhat.com>
Adds the inverted queries to the conversion function.
---
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 6781ac3..4ba9fed 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -6540,16 +6540,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);
@@ -6957,9 +6957,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") ||
--
2.14.3
More information about the virglrenderer-devel
mailing list