diff options
author | Kenneth Graunke <[email protected]> | 2019-01-11 00:28:07 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-02-21 10:26:11 -0800 |
commit | 5aef30b886460d50b0ffec4f6d210e04c9ecf421 (patch) | |
tree | 669f9e4346990dcafa96af51c0e4baba8e47fe28 /src/gallium/drivers | |
parent | 7f318bf2ac08e26b5c6f3eb00135048527149e73 (diff) |
iris: Fix Broadwell WaDividePSInvocationCountBy4
We were dividing by 4 in calculate_result_on_gpu(), and also in
iris_get_query_result(). We should stop doing the latter, and instead
divide by 4 in calculate_result_on_cpu() as well.
Otherwise, if snapshots were available, and you hit the
calculate_result_on_cpu() path, but requested it be written to a QBO,
you'd fail to get a divide.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/iris/iris_query.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index de579f25584..0318b76a0f2 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -334,10 +334,16 @@ calculate_result_on_cpu(const struct gen_device_info *devinfo, for (int i = 0; i < MAX_VERTEX_STREAMS; i++) q->result |= stream_overflowed((void *) q->map, i); break; + case PIPE_QUERY_PIPELINE_STATISTICS: + q->result = q->map->end - q->map->start; + + /* WaDividePSInvocationCountBy4:HSW,BDW */ + if (devinfo->gen == 8 && q->index == PIPE_STAT_QUERY_PS_INVOCATIONS) + q->result /= 4; + break; case PIPE_QUERY_OCCLUSION_COUNTER: case PIPE_QUERY_PRIMITIVES_GENERATED: case PIPE_QUERY_PRIMITIVES_EMITTED: - case PIPE_QUERY_PIPELINE_STATISTICS: default: q->result = q->map->end - q->map->start; break; @@ -864,12 +870,6 @@ iris_get_query_result(struct pipe_context *ctx, break; case 7: result->pipeline_statistics.ps_invocations = q->result; - /* Implement the "WaDividePSInvocationCountBy4:HSW,BDW" workaround: - * "Invocation counter is 4 times actual. WA: SW to divide HW reported - * PS Invocations value by 4." - */ - if (screen->devinfo.gen == 8) - result->pipeline_statistics.ps_invocations /= 4; break; case 8: result->pipeline_statistics.hs_invocations = q->result; |