summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2017-08-15 17:52:41 +0200
committerRoland Scheidegger <[email protected]>2017-08-17 18:46:44 +0200
commit26d46b94b4f03a8a5203539949e19124e3cdefad (patch)
tree0f7c32e287e5fe9189595e1050d6723a61f25027 /src/gallium
parentc87594575ba4c584ec600cc35931b132c0d05dc9 (diff)
softpipe: enable PIPE_CAP_QUERY_SO_OVERFLOW
The driver was supposed to support this since way before the GL spec for it existed, albeit it was apparently broken, so fix and enable it. Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/softpipe/sp_query.c7
-rw-r--r--src/gallium/drivers/softpipe/sp_screen.c3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c
index bec0116a56e..63f6c4be042 100644
--- a/src/gallium/drivers/softpipe/sp_query.c
+++ b/src/gallium/drivers/softpipe/sp_query.c
@@ -63,6 +63,7 @@ softpipe_create_query(struct pipe_context *pipe,
type == PIPE_QUERY_TIME_ELAPSED ||
type == PIPE_QUERY_SO_STATISTICS ||
type == PIPE_QUERY_SO_OVERFLOW_PREDICATE ||
+ type == PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE ||
type == PIPE_QUERY_PRIMITIVES_EMITTED ||
type == PIPE_QUERY_PRIMITIVES_GENERATED ||
type == PIPE_QUERY_PIPELINE_STATISTICS ||
@@ -102,7 +103,9 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
- sq->end = FALSE;
+ case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
+ sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written;
+ sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed;
break;
case PIPE_QUERY_PRIMITIVES_EMITTED:
sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written;
@@ -153,6 +156,7 @@ softpipe_end_query(struct pipe_context *pipe, struct pipe_query *q)
sq->end = os_time_get_nano();
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+ case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
sq->so.num_primitives_written =
softpipe->so_stats.num_primitives_written - sq->so.num_primitives_written;
sq->so.primitives_storage_needed =
@@ -230,6 +234,7 @@ softpipe_get_query_result(struct pipe_context *pipe,
vresult->b = TRUE;
break;
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+ case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
vresult->b = sq->end != 0;
break;
case PIPE_QUERY_TIMESTAMP_DISJOINT: {
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index 0feef2189a7..2988095eec2 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -220,6 +220,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
return 31;
case PIPE_CAP_DRAW_INDIRECT:
return 1;
+ case PIPE_CAP_QUERY_SO_OVERFLOW:
+ return 1;
case PIPE_CAP_VENDOR_ID:
return 0xFFFFFFFF;
@@ -307,7 +309,6 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_POST_DEPTH_COVERAGE:
case PIPE_CAP_BINDLESS_TEXTURE:
case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
- case PIPE_CAP_QUERY_SO_OVERFLOW:
case PIPE_CAP_MEMOBJ:
return 0;
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT: