radv: move compiler statistics to ACO

They are really specific to ACO.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7061>
This commit is contained in:
Samuel Pitoiset
2020-10-08 13:14:21 +02:00
committed by Marge Bot
parent 97afb2a0a9
commit e3e8d13ada
5 changed files with 18 additions and 18 deletions

View File

@@ -29,7 +29,7 @@
#include <iostream>
#include <sstream>
static radv_compiler_statistic_info statistic_infos[] = {
static aco_compiler_statistic_info statistic_infos[] = {
[aco::statistic_hash] = {"Hash", "CRC32 hash of code and constant data"},
[aco::statistic_instructions] = {"Instructions", "Instruction count"},
[aco::statistic_copies] = {"Copies", "Copy instructions created for pseudo-instructions"},
@@ -185,7 +185,7 @@ void aco_compile_shader(unsigned shader_count,
size_t stats_size = 0;
if (program->collect_statistics)
stats_size = sizeof(radv_compiler_statistics) + aco::num_statistics * sizeof(uint32_t);
stats_size = sizeof(aco_compiler_statistics) + aco::num_statistics * sizeof(uint32_t);
size += stats_size;
size += code.size() * sizeof(uint32_t) + sizeof(radv_shader_binary_legacy);
@@ -201,7 +201,7 @@ void aco_compile_shader(unsigned shader_count,
legacy_binary->base.total_size = size;
if (program->collect_statistics) {
radv_compiler_statistics *statistics = (radv_compiler_statistics *)legacy_binary->data;
aco_compiler_statistics *statistics = (aco_compiler_statistics *)legacy_binary->data;
statistics->count = aco::num_statistics;
statistics->infos = statistic_infos;
memcpy(statistics->values, program->statistics, aco::num_statistics * sizeof(uint32_t));

View File

@@ -32,6 +32,17 @@ extern "C" {
struct ac_shader_config;
struct aco_compiler_statistic_info {
char name[32];
char desc[64];
};
struct aco_compiler_statistics {
unsigned count;
struct aco_compiler_statistic_info *infos;
uint32_t values[];
};
void aco_compile_shader(unsigned shader_count,
struct nir_shader *const *shaders,
struct radv_shader_binary** binary,

View File

@@ -5527,7 +5527,7 @@ VkResult radv_GetPipelineExecutableStatisticsKHR(
if (shader->statistics) {
for (unsigned i = 0; i < shader->statistics->count; i++) {
struct radv_compiler_statistic_info *info = &shader->statistics->infos[i];
struct aco_compiler_statistic_info *info = &shader->statistics->infos[i];
uint32_t value = shader->statistics->values[i];
if (s < end) {
desc_copy(s->name, info->name);

View File

@@ -45,8 +45,6 @@
#include "util/debug.h"
#include "ac_exp_param.h"
#include "aco_interface.h"
static const struct nir_shader_compiler_options nir_options = {
.vertex_id_zero_based = true,
.lower_scmp = true,

View File

@@ -38,6 +38,8 @@
#include "vulkan/vulkan.h"
#include "vulkan/util/vk_object.h"
#include "aco_interface.h"
#define RADV_VERT_ATTRIB_MAX MAX2(VERT_ATTRIB_MAX, VERT_ATTRIB_GENERIC0 + MAX_VERTEX_ATTRIBS)
struct radv_device;
@@ -386,17 +388,6 @@ struct radv_shader_binary_rtld {
uint8_t data[0];
};
struct radv_compiler_statistic_info {
char name[32];
char desc[64];
};
struct radv_compiler_statistics {
unsigned count;
struct radv_compiler_statistic_info *infos;
uint32_t values[];
};
struct radv_shader_variant {
uint32_t ref_count;
@@ -413,7 +404,7 @@ struct radv_shader_variant {
char *nir_string;
char *disasm_string;
char *ir_string;
struct radv_compiler_statistics *statistics;
struct aco_compiler_statistics *statistics;
struct list_head slab_list;
};