<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 13, 2017 at 9:48 AM, Alex Smith <span dir="ltr"><<a href="mailto:asmith@feralinteractive.com" target="_blank">asmith@feralinteractive.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Jason,<div class="gmail_extra"><br><div class="gmail_quote"><span class="">On 13 February 2017 at 16:38, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This makes our driver robust to changes in spirv_to_nir which would set<br>
this flag on the variable.  Right now, our driver relies on spirv_to_nir<br>
*not* setting var->data.image.write_only for correctness.  Any patch<br>
which implements the shaderStorageImageWriteWithout<wbr>Format will need to<br>
effectively revert this commit.<br></blockquote><div><br></div></span><div>I guess this is to ensure there aren't any regressions with just the first of my patches?</div><div><br></div><div>I'll update my patch to revert this. Do you want me to include this one in the series when I send a new version of the other patches, or can you handle applying this one before mine?</div></div></div></div></blockquote><div><br></div><div>Either way works for me.  I think it's a tiny bit easier, if you include it in the re-send.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Thanks,</div><div>Alex</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cc: Alex Smith <<a href="mailto:asmith@feralinteractive.com" target="_blank">asmith@feralinteractive.com</a>><br>
---<br>
 src/intel/vulkan/anv_nir_appl<wbr>y_pipeline_layout.c | 12 ++++++++++++<br>
 1 file changed, 12 insertions(+)<br>
<br>
diff --git a/src/intel/vulkan/anv_nir_app<wbr>ly_pipeline_layout.c b/src/intel/vulkan/anv_nir_app<wbr>ly_pipeline_layout.c<br>
index 8846c2e..d6b8561 100644<br>
--- a/src/intel/vulkan/anv_nir_app<wbr>ly_pipeline_layout.c<br>
+++ b/src/intel/vulkan/anv_nir_app<wbr>ly_pipeline_layout.c<br>
@@ -398,6 +398,18 @@ anv_nir_apply_pipeline_layout(<wbr>struct anv_pipeline *pipeline,<br>
             unsigned binding = var->data.binding;<br>
             unsigned image_index = state.set[set].image_offsets[b<wbr>inding];<br>
<br>
+            /* We have a very tight coupling between back-end compiler and<br>
+             * state setup which requires us to fill the image surface state<br>
+             * out differently if and only if the image is declared write-only.<br>
+             * Right now, our state setup code sets up all images as if they<br>
+             * are read-write.  This means that the compiler needs to see<br>
+             * read-only as well.<br>
+             *<br>
+             * Whenever we implement shaderStorageImageWriteWithout<wbr>Format, we<br>
+             * need to delete this.<br>
+             */<br>
+            var->data.image.write_only = false;<br>
+<br>
             var->data.driver_location = shader->num_uniforms +<br>
                                         image_index * BRW_IMAGE_PARAM_SIZE * 4;<br>
          }<br>
<span class="m_-2738103073972003424HOEnZb"><font color="#888888">--<br>
2.5.0.400.gff86faf<br>
<br>
</font></span></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>