<div dir="ltr">Hi Jason,<div class="gmail_extra"><br><div class="gmail_quote">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><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><br></div><div>Thanks,</div><div>Alex</div><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">asmith@feralinteractive.com</a>><br>
---<br>
src/intel/vulkan/anv_nir_<wbr>apply_pipeline_layout.c | 12 ++++++++++++<br>
1 file changed, 12 insertions(+)<br>
<br>
diff --git a/src/intel/vulkan/anv_nir_<wbr>apply_pipeline_layout.c b/src/intel/vulkan/anv_nir_<wbr>apply_pipeline_layout.c<br>
index 8846c2e..d6b8561 100644<br>
--- a/src/intel/vulkan/anv_nir_<wbr>apply_pipeline_layout.c<br>
+++ b/src/intel/vulkan/anv_nir_<wbr>apply_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[<wbr>binding];<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="HOEnZb"><font color="#888888">--<br>
2.5.0.400.gff86faf<br>
<br>
</font></span></blockquote></div><br></div></div>