Mesa (master): spirv: Handle the InputAttachmentIndex decoration

Jason Ekstrand jekstrand at kemper.freedesktop.org
Tue Nov 22 22:08:50 UTC 2016


Module: Mesa
Branch: master
Commit: c54097cc484f1c40e5af478f3757aa09e0eeeb4a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c54097cc484f1c40e5af478f3757aa09e0eeeb4a

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Mon Nov 14 14:22:56 2016 -0800

spirv: Handle the InputAttachmentIndex decoration

Reviewed-by: Dave Airlie <airlied at redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

---

 src/compiler/spirv/vtn_private.h   | 1 +
 src/compiler/spirv/vtn_variables.c | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index 6f34f09..47579fe 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -279,6 +279,7 @@ struct vtn_variable {
 
    unsigned descriptor_set;
    unsigned binding;
+   unsigned input_attachment_index;
 
    nir_variable *var;
    nir_variable **members;
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index c064de8..14366dc 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1027,6 +1027,9 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member,
    case SpvDecorationDescriptorSet:
       vtn_var->descriptor_set = dec->literals[0];
       return;
+   case SpvDecorationInputAttachmentIndex:
+      vtn_var->input_attachment_index = dec->literals[0];
+      return;
    default:
       break;
    }
@@ -1335,6 +1338,7 @@ vtn_handle_variables(struct vtn_builder *b, SpvOp opcode,
           */
          var->var->data.binding = var->binding;
          var->var->data.descriptor_set = var->descriptor_set;
+         var->var->data.index = var->input_attachment_index;
 
          if (var->mode == vtn_variable_mode_image)
             var->var->data.image.format = without_array->image_format;




More information about the mesa-commit mailing list