<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 11, 2016 at 4:22 PM, Jordan Justen <span dir="ltr"><<a href="mailto:jordan.l.justen@intel.com" target="_blank">jordan.l.justen@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If images or shader buffers are used, we will enable the data cache in<br>
the the L3 config.<br>
<br>
Signed-off-by: Jordan Justen <<a href="mailto:jordan.l.justen@intel.com">jordan.l.justen@intel.com</a>><br>
---<br>
 src/intel/vulkan/anv_pipeline.c  | 8 +++++++-<br>
 src/intel/vulkan/anv_private.h   | 1 +<br>
 src/intel/vulkan/genX_pipeline.c | 2 ++<br>
 3 files changed, 10 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c<br>
index 5800e68..fcaa450 100644<br>
--- a/src/intel/vulkan/anv_pipeline.c<br>
+++ b/src/intel/vulkan/anv_pipeline.c<br>
@@ -331,8 +331,12 @@ anv_pipeline_compile(struct anv_pipeline *pipeline,<br>
    if (pipeline->layout && pipeline->layout->stage[stage].has_dynamic_offsets)<br>
       prog_data->nr_params += MAX_DYNAMIC_BUFFERS * 2;<br>
<br>
-   if (nir->info.num_images > 0)<br>
+   if (nir->info.num_images > 0) {<br>
       prog_data->nr_params += nir->info.num_images * BRW_IMAGE_PARAM_SIZE;<br>
+      pipeline->needs_data_cache |= true;<br></blockquote><div><br></div><div>This can just be "= true"<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+   }<br>
+<br>
+   pipeline->needs_data_cache |= nir->info.num_ssbos > 0;<br></blockquote><div><br>Maybe use "if (nir->info.num_ssbos >= 0)" to make it look more like the one above?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
    if (prog_data->nr_params > 0) {<br>
       /* XXX: I think we're leaking this */<br>
@@ -1138,6 +1142,8 @@ anv_pipeline_init(struct anv_pipeline *pipeline,<br>
<br>
    pipeline->use_repclear = extra && extra->use_repclear;<br>
<br>
+   pipeline->needs_data_cache = false;<br>
+<br>
    /* When we free the pipeline, we detect stages based on the NULL status<br>
     * of various prog_data pointers.  Make them NULL by default.<br>
     */<br>
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h<br>
index d8a2194..fb308eb 100644<br>
--- a/src/intel/vulkan/anv_private.h<br>
+++ b/src/intel/vulkan/anv_private.h<br>
@@ -1403,6 +1403,7 @@ struct anv_pipeline {<br>
    struct anv_pipeline_bind_map                 bindings[MESA_SHADER_STAGES];<br>
<br>
    bool                                         use_repclear;<br>
+   bool                                         needs_data_cache;<br>
<br>
    const struct brw_stage_prog_data *           prog_data[MESA_SHADER_STAGES];<br>
    uint32_t                                     scratch_start[MESA_SHADER_STAGES];<br>
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c<br>
index 2328920..2a41b2d 100644<br>
--- a/src/intel/vulkan/genX_pipeline.c<br>
+++ b/src/intel/vulkan/genX_pipeline.c<br>
@@ -74,6 +74,8 @@ genX(compute_pipeline_create)(<br>
    pipeline->active_stages = 0;<br>
    pipeline->total_scratch = 0;<br>
<br>
+   pipeline->needs_data_cache = false;<br>
+<br>
    assert(pCreateInfo->stage.stage == VK_SHADER_STAGE_COMPUTE_BIT);<br>
    ANV_FROM_HANDLE(anv_shader_module, module,  pCreateInfo->stage.module);<br>
    anv_pipeline_compile_cs(pipeline, cache, pCreateInfo, module,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.8.1<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>