Mesa (staging/20.0): anv: Always enable the data cache

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 28 22:44:47 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: 47bfaa8795f521b2aea970d1ba6dba776aef1ea8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=47bfaa8795f521b2aea970d1ba6dba776aef1ea8

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Fri Feb 21 13:39:16 2020 -0600

anv: Always enable the data cache

Because we set the needs_data_cache bit from the NIR during compilation,
any time a shader was pulled out of the pipeline cache, we wouldn't set
the bit and the data cache was disabled.  Fortunately, on Gen8+, this
bit is ignored because we always use the ALL section in the L3$ config
instead of separate DC and RO sections.  On Gen7, however, this meant
that we were basically never running with the data cache enabled and our
compute performance was suffering massively because of it.  This commit
improves Geekbench 5 scores on my Haswell GT3 by roughly 330% (no,
that's not a typo).

Cc: mesa-stable at lists.freedesktop.org
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3912>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3912>
(cherry picked from commit 5dfd83d7a1ce52a42485c54ca170311449379eb9)

---

 .pick_status.json                | 2 +-
 src/intel/vulkan/anv_pipeline.c  | 7 +------
 src/intel/vulkan/anv_private.h   | 2 --
 src/intel/vulkan/genX_pipeline.c | 2 --
 4 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 230ee0b5f1c..10665ba49c6 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1525,7 +1525,7 @@
         "description": "anv: Always enable the data cache",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 2e822a6aba6..cfcbcc131ef 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -678,9 +678,6 @@ anv_pipeline_lower_nir(struct anv_pipeline *pipeline,
 
    nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
 
-   if (nir->info.num_ssbos > 0 || nir->info.num_images > 0)
-      pipeline->needs_data_cache = true;
-
    NIR_PASS_V(nir, brw_nir_lower_image_load_store, compiler->devinfo);
 
    NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_global,
@@ -1823,7 +1820,7 @@ anv_pipeline_setup_l3_config(struct anv_pipeline *pipeline, bool needs_slm)
    const struct gen_device_info *devinfo = &pipeline->device->info;
 
    const struct gen_l3_weights w =
-      gen_get_default_l3_weights(devinfo, pipeline->needs_data_cache, needs_slm);
+      gen_get_default_l3_weights(devinfo, true, needs_slm);
 
    pipeline->urb.l3_config = gen_get_l3_config(devinfo, w);
    pipeline->urb.total_size =
@@ -1883,8 +1880,6 @@ anv_pipeline_init(struct anv_pipeline *pipeline,
       pCreateInfo->pMultisampleState &&
       pCreateInfo->pMultisampleState->sampleShadingEnable;
 
-   pipeline->needs_data_cache = false;
-
    /* When we free the pipeline, we detect stages based on the NULL status
     * of various prog_data pointers.  Make them NULL by default.
     */
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index d794a9db5dd..6680bcd86d2 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -3160,8 +3160,6 @@ struct anv_pipeline {
    VkPipelineCreateFlags                        flags;
    struct anv_subpass *                         subpass;
 
-   bool                                         needs_data_cache;
-
    struct anv_shader_bin *                      shaders[MESA_SHADER_STAGES];
 
    uint32_t                                     num_executables;
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index 82c053d91a5..6e01377c6f4 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -2259,8 +2259,6 @@ compute_pipeline_create(
    memset(pipeline->shaders, 0, sizeof(pipeline->shaders));
    pipeline->num_executables = 0;
 
-   pipeline->needs_data_cache = false;
-
    assert(pCreateInfo->stage.stage == VK_SHADER_STAGE_COMPUTE_BIT);
    pipeline->active_stages |= VK_SHADER_STAGE_COMPUTE_BIT;
    ANV_FROM_HANDLE(anv_shader_module, module,  pCreateInfo->stage.module);



More information about the mesa-commit mailing list