From efc093d0ec0b0b15e9bb18ed788ab0a623e59be2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 21 May 2018 15:54:00 +1000 Subject: [PATCH] add ARB_transform_feedback_overflow_query support handles the new query conversions Reviewed-by: Elie Tournier --- src/gallium/include/pipe/p_defines.h | 3 ++- src/virgl_hw.h | 1 + src/vrend_renderer.c | 10 ++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 71f6649..6bcb338 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -447,7 +447,8 @@ enum pipe_flush_flags { #define PIPE_QUERY_GPU_FINISHED 9 #define PIPE_QUERY_PIPELINE_STATISTICS 10 #define PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE 11 -#define PIPE_QUERY_TYPES 12 +#define PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE 12 +#define PIPE_QUERY_TYPES 13 /* start of driver queries, * see pipe_screen::get_driver_query_info */ diff --git a/src/virgl_hw.h b/src/virgl_hw.h index 102a43a..57cdd4c 100644 --- a/src/virgl_hw.h +++ b/src/virgl_hw.h @@ -241,6 +241,7 @@ struct virgl_caps_bool_set1 { unsigned conditional_render_inverted:1; unsigned derivative_control:1; unsigned polygon_offset_clamp:1; + unsigned transform_feedback_overflow_query:1; }; /* endless expansion capabilites - current gallium has 252 formats */ diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 438c39e..df575b1 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -6425,6 +6425,13 @@ int vrend_create_query(struct vrend_context *ctx, uint32_t handle, case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE: q->gltype = GL_ANY_SAMPLES_PASSED_CONSERVATIVE; break; + case PIPE_QUERY_SO_OVERFLOW_PREDICATE: + q->gltype = GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB; + break; + case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE: + q->gltype = GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB; + break; + break; default: fprintf(stderr,"unknown query object received %d\n", q->type); break; @@ -6975,9 +6982,12 @@ void vrend_renderer_fill_caps(uint32_t set, uint32_t version, if (gl_ver >= 46) { caps->v1.bset.polygon_offset_clamp = 1; + caps->v1.bset.transform_feedback_overflow_query = 1; } else { if (epoxy_has_gl_extension("GL_ARB_polygon_offset_clamp")) caps->v1.bset.polygon_offset_clamp = 1; + if (epoxy_has_gl_extension("GL_ARB_transform_feedback_overflow_query")) + caps->v1.bset.transform_feedback_overflow_query = 1; } if (epoxy_has_gl_extension("GL_EXT_texture_mirror_clamp") ||