iris: Switch to the new PIPELINE_STATISTICS_QUERY_SINGLE capability
I had a hack in place earlier to pass the query type as q->index for the regular statistics query, but we ended up adjusting the interface and adding a new query type. Use that instead, fixing pipeline statistics queries since the rebase.
This commit is contained in:
parent
a23c06cabc
commit
1f91f688e8
|
@ -235,7 +235,7 @@ write_value(struct iris_context *ice, struct iris_query *q, unsigned offset)
|
||||||
SO_NUM_PRIMS_WRITTEN(q->index),
|
SO_NUM_PRIMS_WRITTEN(q->index),
|
||||||
q->bo, offset, false);
|
q->bo, offset, false);
|
||||||
break;
|
break;
|
||||||
case PIPE_QUERY_PIPELINE_STATISTICS: {
|
case PIPE_QUERY_PIPELINE_STATISTICS_SINGLE: {
|
||||||
static const uint32_t index_to_reg[] = {
|
static const uint32_t index_to_reg[] = {
|
||||||
IA_VERTICES_COUNT,
|
IA_VERTICES_COUNT,
|
||||||
IA_PRIMITIVES_COUNT,
|
IA_PRIMITIVES_COUNT,
|
||||||
|
@ -334,7 +334,7 @@ calculate_result_on_cpu(const struct gen_device_info *devinfo,
|
||||||
for (int i = 0; i < MAX_VERTEX_STREAMS; i++)
|
for (int i = 0; i < MAX_VERTEX_STREAMS; i++)
|
||||||
q->result |= stream_overflowed((void *) q->map, i);
|
q->result |= stream_overflowed((void *) q->map, i);
|
||||||
break;
|
break;
|
||||||
case PIPE_QUERY_PIPELINE_STATISTICS:
|
case PIPE_QUERY_PIPELINE_STATISTICS_SINGLE:
|
||||||
q->result = q->map->end - q->map->start;
|
q->result = q->map->end - q->map->start;
|
||||||
|
|
||||||
/* WaDividePSInvocationCountBy4:HSW,BDW */
|
/* WaDividePSInvocationCountBy4:HSW,BDW */
|
||||||
|
@ -702,7 +702,7 @@ calculate_result_on_gpu(struct iris_context *ice, struct iris_query *q)
|
||||||
|
|
||||||
/* WaDividePSInvocationCountBy4:HSW,BDW */
|
/* WaDividePSInvocationCountBy4:HSW,BDW */
|
||||||
if (devinfo->gen == 8 &&
|
if (devinfo->gen == 8 &&
|
||||||
q->type == PIPE_QUERY_PIPELINE_STATISTICS &&
|
q->type == PIPE_QUERY_PIPELINE_STATISTICS_SINGLE &&
|
||||||
q->index == PIPE_STAT_QUERY_PS_INVOCATIONS)
|
q->index == PIPE_STAT_QUERY_PS_INVOCATIONS)
|
||||||
shr_gpr0_by_2_bits(ice);
|
shr_gpr0_by_2_bits(ice);
|
||||||
|
|
||||||
|
@ -726,7 +726,7 @@ iris_create_query(struct pipe_context *ctx,
|
||||||
q->type = query_type;
|
q->type = query_type;
|
||||||
q->index = index;
|
q->index = index;
|
||||||
|
|
||||||
if (q->type == PIPE_QUERY_PIPELINE_STATISTICS &&
|
if (q->type == PIPE_QUERY_PIPELINE_STATISTICS_SINGLE &&
|
||||||
q->index == PIPE_STAT_QUERY_CS_INVOCATIONS)
|
q->index == PIPE_STAT_QUERY_CS_INVOCATIONS)
|
||||||
q->batch_idx = IRIS_BATCH_COMPUTE;
|
q->batch_idx = IRIS_BATCH_COMPUTE;
|
||||||
else
|
else
|
||||||
|
@ -848,45 +848,7 @@ iris_get_query_result(struct pipe_context *ctx,
|
||||||
|
|
||||||
assert(q->ready);
|
assert(q->ready);
|
||||||
|
|
||||||
if (q->type == PIPE_QUERY_PIPELINE_STATISTICS) {
|
|
||||||
switch (q->index) {
|
|
||||||
case 0:
|
|
||||||
result->pipeline_statistics.ia_vertices = q->result;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
result->pipeline_statistics.ia_primitives = q->result;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
result->pipeline_statistics.vs_invocations = q->result;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
result->pipeline_statistics.gs_invocations = q->result;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
result->pipeline_statistics.gs_primitives = q->result;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
result->pipeline_statistics.c_invocations = q->result;
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
result->pipeline_statistics.c_primitives = q->result;
|
|
||||||
break;
|
|
||||||
case 7:
|
|
||||||
result->pipeline_statistics.ps_invocations = q->result;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
result->pipeline_statistics.hs_invocations = q->result;
|
|
||||||
break;
|
|
||||||
case 9:
|
|
||||||
result->pipeline_statistics.ds_invocations = q->result;
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
result->pipeline_statistics.cs_invocations = q->result;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
result->u64 = q->result;
|
result->u64 = q->result;
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ iris_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||||
case PIPE_CAP_TEXTURE_MULTISAMPLE:
|
case PIPE_CAP_TEXTURE_MULTISAMPLE:
|
||||||
case PIPE_CAP_CUBE_MAP_ARRAY:
|
case PIPE_CAP_CUBE_MAP_ARRAY:
|
||||||
case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
|
case PIPE_CAP_TEXTURE_BUFFER_OBJECTS:
|
||||||
case PIPE_CAP_QUERY_PIPELINE_STATISTICS:
|
case PIPE_CAP_QUERY_PIPELINE_STATISTICS_SINGLE:
|
||||||
case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
|
case PIPE_CAP_BUFFER_MAP_PERSISTENT_COHERENT:
|
||||||
case PIPE_CAP_TEXTURE_QUERY_LOD:
|
case PIPE_CAP_TEXTURE_QUERY_LOD:
|
||||||
case PIPE_CAP_SAMPLE_SHADING:
|
case PIPE_CAP_SAMPLE_SHADING:
|
||||||
|
|
Loading…
Reference in New Issue