<div dir="ltr">Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 9, 2017 at 8:06 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">Allow that capability if the driver indicates that it is supported, and<br>
flag whether images are read-only/write-only in the nir_variable (based<br>
on the NonReadable and NonWritable decorations), which drivers may need<br>
to implement this.<br>
<br>
Signed-off-by: Alex Smith <<a href="mailto:asmith@feralinteractive.com">asmith@feralinteractive.com</a>><br>
---<br>
 src/compiler/spirv/nir_spirv.h     | 1 +<br>
 src/compiler/spirv/spirv_to_<wbr>nir.c  | 5 ++++-<br>
 src/compiler/spirv/vtn_<wbr>variables.c | 5 ++++-<br>
 3 files changed, 9 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/compiler/spirv/nir_<wbr>spirv.h b/src/compiler/spirv/nir_<wbr>spirv.h<br>
index e0ebc62..e43e9b5 100644<br>
--- a/src/compiler/spirv/nir_<wbr>spirv.h<br>
+++ b/src/compiler/spirv/nir_<wbr>spirv.h<br>
@@ -49,6 +49,7 @@ struct nir_spirv_supported_extensions {<br>
    bool image_ms_array;<br>
    bool tessellation;<br>
    bool draw_parameters;<br>
+   bool image_write_without_format;<br>
 };<br>
<br>
 nir_function *spirv_to_nir(const uint32_t *words, size_t word_count,<br>
diff --git a/src/compiler/spirv/spirv_to_<wbr>nir.c b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
index 416e12a..3f77ddf 100644<br>
--- a/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
+++ b/src/compiler/spirv/spirv_to_<wbr>nir.c<br>
@@ -2666,7 +2666,6 @@ vtn_handle_preamble_<wbr>instruction(struct vtn_builder *b, SpvOp opcode,<br>
       case SpvCapabilityMinLod:<br>
       case SpvCapabilityTransformFeedback<wbr>:<br>
       case SpvCapabilityStorageImageReadW<wbr>ithoutFormat:<br>
-      case SpvCapabilityStorageImageWrite<wbr>WithoutFormat:<br>
          vtn_warn("Unsupported SPIR-V capability: %s",<br>
                   spirv_capability_to_string(<wbr>cap));<br>
          break;<br>
@@ -2702,6 +2701,10 @@ vtn_handle_preamble_<wbr>instruction(struct vtn_builder *b, SpvOp opcode,<br>
          spv_check_supported(draw_<wbr>parameters, cap);<br>
          break;<br>
<br>
+      case SpvCapabilityStorageImageWrite<wbr>WithoutFormat:<br>
+         spv_check_supported(image_<wbr>write_without_format, cap);<br>
+         break;<br>
+<br>
       default:<br>
          unreachable("Unhandled capability");<br>
       }<br>
diff --git a/src/compiler/spirv/vtn_<wbr>variables.c b/src/compiler/spirv/vtn_<wbr>variables.c<br>
index 098cfb5..d7d882e 100644<br>
--- a/src/compiler/spirv/vtn_<wbr>variables.c<br>
+++ b/src/compiler/spirv/vtn_<wbr>variables.c<br>
@@ -1054,8 +1054,12 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,<br>
       assert(nir_var->constant_<wbr>initializer != NULL);<br>
       nir_var->data.read_only = true;<br>
       break;<br>
+   case SpvDecorationNonReadable:<br>
+      nir_var->data.image.write_only = true;<br>
+      break;<br>
    case SpvDecorationNonWritable:<br>
       nir_var->data.read_only = true;<br>
+      nir_var->data.image.read_only = true;<br>
       break;<br>
    case SpvDecorationComponent:<br>
       nir_var->data.location_frac = dec->literals[0];<br>
@@ -1107,7 +1111,6 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,<br>
    case SpvDecorationAliased:<br>
    case SpvDecorationVolatile:<br>
    case SpvDecorationCoherent:<br>
-   case SpvDecorationNonReadable:<br>
    case SpvDecorationUniform:<br>
    case SpvDecorationStream:<br>
    case SpvDecorationOffset:<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
______________________________<wbr>_________________<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/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>