summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-11-14 14:22:56 -0800
committerJason Ekstrand <[email protected]>2016-11-22 13:02:35 -0800
commitc54097cc484f1c40e5af478f3757aa09e0eeeb4a (patch)
tree9f375f3e3987ffdb28a7bff1f2989bf7a672c4d1 /src/compiler
parent111d57e7d297a0736f83b3f710f9294981c48b2e (diff)
spirv: Handle the InputAttachmentIndex decoration
Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/spirv/vtn_private.h1
-rw-r--r--src/compiler/spirv/vtn_variables.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index 6f34f09ebd2..47579fe0fb9 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 c064de8d683..14366dc321d 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;