anv: Advertise SEND count through VK_EXT_pipeline_executable_properties
authorJason Ekstrand <jason@jlekstrand.net>
Fri, 3 Apr 2020 18:09:41 +0000 (13:09 -0500)
committerMarge Bot <eric+marge@anholt.net>
Wed, 15 Apr 2020 21:51:55 +0000 (21:51 +0000)
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4578>

src/intel/compiler/brw_compiler.h
src/intel/compiler/brw_fs_generator.cpp
src/intel/compiler/brw_vec4_generator.cpp
src/intel/vulkan/anv_pipeline.c

index 03512471d80c79b5e6faec859ceb069615559b12..25fc3eaa91564c713cd249c2bc9e76c3adb5e4b2 100644 (file)
@@ -1275,6 +1275,7 @@ DEFINE_PROG_DATA_DOWNCAST(sf)
 struct brw_compile_stats {
    uint32_t dispatch_width; /**< 0 for vec4 */
    uint32_t instructions;
+   uint32_t sends;
    uint32_t loops;
    uint32_t cycles;
    uint32_t spills;
index 3a2f2a9b7ce324f66681b0a5472558fa013492ac..8afc075f187245d77ad427f7e057b5f49cfa0045 100644 (file)
@@ -2492,6 +2492,7 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width,
    if (stats) {
       stats->dispatch_width = dispatch_width;
       stats->instructions = before_size / 16 - nop_count;
+      stats->sends = send_count;
       stats->loops = loop_count;
       stats->cycles = cfg->cycle_count;
       stats->spills = spill_count;
index 5176ba990349ad1814efe2f811d49addd995bd46..c247c988181fa17d140a05d21a9b110804f2c35d 100644 (file)
@@ -2242,6 +2242,7 @@ generate_code(struct brw_codegen *p,
    if (stats) {
       stats->dispatch_width = 0;
       stats->instructions = before_size / 16;
+      stats->sends = send_count;
       stats->loops = loop_count;
       stats->cycles = cfg->cycle_count;
       stats->spills = spill_count;
index b4f6077f0b9c711eba8060a6b1884a8adc382d5a..b85a37e78730ee494c3e9aba9fba9a234eff32f3 100644 (file)
@@ -2188,6 +2188,16 @@ VkResult anv_GetPipelineExecutableStatisticsKHR(
       stat->value.u64 = exe->stats.instructions;
    }
 
+   vk_outarray_append(&out, stat) {
+      WRITE_STR(stat->name, "SEND Count");
+      WRITE_STR(stat->description,
+                "Number of instructions in the final generated shader "
+                "executable which access external units such as the "
+                "constant cache or the sampler.");
+      stat->format = VK_PIPELINE_EXECUTABLE_STATISTIC_FORMAT_UINT64_KHR;
+      stat->value.u64 = exe->stats.sends;
+   }
+
    vk_outarray_append(&out, stat) {
       WRITE_STR(stat->name, "Loop Count");
       WRITE_STR(stat->description,