summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2018-10-02 15:41:41 +0100
committerLionel Landwerlin <[email protected]>2019-04-17 14:10:42 +0100
commit93dbe52ab04a0061f893aaa4e9fdbb385b8b2fb0 (patch)
treed29167d6de7d952e6ca3dfa7f7839cba4773db87 /src/mesa
parenta646485c28b95ce8a6a61d61c2afaeefcdf439a4 (diff)
intel/perf: drop counter size field
We can deduct the size from another field, let's just save some space. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Mark Janes <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_performance_query.c7
-rw-r--r--src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c4
2 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c
index 831ad97a675..cd7961905bd 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_query.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_query.c
@@ -447,7 +447,7 @@ brw_get_perf_counter_info(struct gl_context *ctx,
*name = counter->name;
*desc = counter->desc;
*offset = counter->offset;
- *data_size = counter->size;
+ *data_size = gen_perf_query_counter_get_size(counter);
*type_enum = gen_counter_type_enum_to_gl_type(counter->type);
*data_type_enum = gen_counter_data_type_to_gl_type(counter->data_type);
*raw_max = counter->raw_max;
@@ -1392,8 +1392,9 @@ get_oa_counter_data(struct brw_context *brw,
const struct gen_perf_query_counter *counter = &query->counters[i];
uint64_t *out_uint64;
float *out_float;
+ size_t counter_size = gen_perf_query_counter_get_size(counter);
- if (counter->size) {
+ if (counter_size) {
switch (counter->data_type) {
case GEN_PERF_COUNTER_DATA_TYPE_UINT64:
out_uint64 = (uint64_t *)(data + counter->offset);
@@ -1411,7 +1412,7 @@ get_oa_counter_data(struct brw_context *brw,
/* So far we aren't using uint32, double or bool32... */
unreachable("unexpected counter data type");
}
- written = counter->offset + counter->size;
+ written = counter->offset + counter_size;
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c b/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c
index f77560390d7..379515d328f 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c
@@ -43,10 +43,10 @@ fill_mdapi_perf_query_counter(struct gen_perf_query_info *query,
counter->type = GEN_PERF_COUNTER_TYPE_RAW;
counter->data_type = data_type;
counter->offset = data_offset;
- counter->size = data_size;
- assert(counter->offset + counter->size <= query->data_size);
query->n_counters++;
+
+ assert(counter->offset + gen_perf_query_counter_get_size(counter) <= query->data_size);
}
#define MDAPI_QUERY_ADD_COUNTER(query, struct_name, field_name, type_name) \