spirv: Assume input attachments are read-only
authorPedro J. Estébanez <pedrojrulez@gmail.com>
Tue, 4 Apr 2023 18:26:36 +0000 (20:26 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 4 Apr 2023 22:50:05 +0000 (22:50 +0000)
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22289>

src/compiler/spirv/vtn_variables.c

index 805831e..8db61c8 100644 (file)
@@ -1416,6 +1416,7 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member,
       return;
    case SpvDecorationInputAttachmentIndex:
       vtn_var->input_attachment_index = dec->operands[0];
+      vtn_var->access |= ACCESS_NON_WRITEABLE;
       return;
    case SpvDecorationPatch:
       vtn_var->var->data.patch = true;