From 201ed4b4e7e02b32f511b52ae94019792284f0a1 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Dec 2019 15:01:06 +1000 Subject: [PATCH] llvmpipe: enable support for primitives generated outside streamout This enables the draw support when the queries are enabled. Reviewed-by: Roland Scheidegger --- .gitlab-ci/piglit/quick_gl.txt | 19 ++----------------- src/gallium/drivers/llvmpipe/lp_context.h | 2 ++ src/gallium/drivers/llvmpipe/lp_draw_arrays.c | 4 ++++ src/gallium/drivers/llvmpipe/lp_query.c | 3 +++ 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci/piglit/quick_gl.txt b/.gitlab-ci/piglit/quick_gl.txt index 95e3cb4366f..e62c7c6f5e0 100644 --- a/.gitlab-ci/piglit/quick_gl.txt +++ b/.gitlab-ci/piglit/quick_gl.txt @@ -631,18 +631,6 @@ spec/arb_query_buffer_object/qbo/query-gl_compute_shader_invocations-sync-gl_uns spec/arb_query_buffer_object/qbo/query-gl_compute_shader_invocations-sync_cpu_read_after_cache_test-gl_int: skip spec/arb_query_buffer_object/qbo/query-gl_compute_shader_invocations-sync_cpu_read_after_cache_test-gl_unsigned_int: skip spec/arb_query_buffer_object/qbo/query-gl_compute_shader_invocations-sync_cpu_read_after_cache_test-gl_unsigned_int64_arb: skip -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-async_cpu_read_after-gl_int: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-async_cpu_read_after-gl_unsigned_int: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-async_cpu_read_after-gl_unsigned_int64_arb: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-async_cpu_read_before-gl_int: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-async_cpu_read_before-gl_unsigned_int: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-async_cpu_read_before-gl_unsigned_int64_arb: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-sync-gl_int: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-sync-gl_unsigned_int: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-sync-gl_unsigned_int64_arb: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-sync_cpu_read_after_cache_test-gl_int: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-sync_cpu_read_after_cache_test-gl_unsigned_int: fail -spec/arb_query_buffer_object/qbo/query-gl_primitives_generated-sync_cpu_read_after_cache_test-gl_unsigned_int64_arb: fail spec/arb_query_buffer_object/qbo/query-gl_tess_control_shader_patches-async-gl_int: skip spec/arb_query_buffer_object/qbo/query-gl_tess_control_shader_patches-async-gl_unsigned_int: skip spec/arb_query_buffer_object/qbo/query-gl_tess_control_shader_patches-async-gl_unsigned_int64_arb: skip @@ -2121,9 +2109,6 @@ spec/ext_texture_srgb/multisample-formats 4 gl_ext_texture_srgb: skip spec/ext_texture_srgb/multisample-formats 6 gl_ext_texture_srgb: skip spec/ext_texture_srgb/multisample-formats 8 gl_ext_texture_srgb: skip spec/ext_timer_query/time-elapsed: fail -spec/ext_transform_feedback2/counting with pause: fail -spec/ext_transform_feedback/pipeline-basic-primgen: fail -spec/ext_transform_feedback/primgen-query transform-feedback-disabled: fail spec/ext_transform_feedback/tessellation quad_strip flat_first: warn spec/ext_transform_feedback/tessellation quads flat_first: warn spec/ext_window_rectangles/dlist/call: skip @@ -2283,8 +2268,8 @@ wgl/wgl-sanity: skip summary: name: results ---- -------- - pass: 17784 - fail: 233 + pass: 17799 + fail: 218 crash: 2 skip: 2027 timeout: 0 diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index 6ce0454538f..1d36f4968cc 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -103,6 +103,8 @@ struct llvmpipe_context { unsigned active_occlusion_queries; + unsigned active_primgen_queries; + bool queries_disabled; unsigned dirty; /**< Mask of LP_NEW_x flags */ diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c index 01f3cf3cdfc..cf81111b407 100644 --- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c +++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c @@ -122,6 +122,10 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) draw_collect_pipeline_statistics(draw, lp->active_statistics_queries > 0); + draw_collect_primitives_generated(draw, + lp->active_primgen_queries && + !lp->queries_disabled); + /* draw! */ draw_vbo(draw, info); diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index a4217368fce..276fd3bab78 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -361,6 +361,7 @@ llvmpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q) break; case PIPE_QUERY_PRIMITIVES_GENERATED: pq->num_primitives_generated = llvmpipe->so_stats.primitives_storage_needed; + llvmpipe->active_primgen_queries++; break; case PIPE_QUERY_SO_STATISTICS: pq->num_primitives_written = llvmpipe->so_stats.num_primitives_written; @@ -408,6 +409,8 @@ llvmpipe_end_query(struct pipe_context *pipe, struct pipe_query *q) llvmpipe->so_stats.num_primitives_written - pq->num_primitives_written; break; case PIPE_QUERY_PRIMITIVES_GENERATED: + assert(llvmpipe->active_primgen_queries); + llvmpipe->active_primgen_queries--; pq->num_primitives_generated = llvmpipe->so_stats.primitives_storage_needed - pq->num_primitives_generated; break; -- 2.30.2