From c6230b93587c6a8874b138e8efb9066e32c17381 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alejandro=20Pi=C3=B1eiro?= Date: Sun, 5 Nov 2017 12:00:19 +0100 Subject: [PATCH] spirv/nir: add offset at vtn_variable Also initialize it on var_decoration_cb This is equivalent to nir_variable.offset, used to store the location an atomic counter is stored at. Reviewed-by: Timothy Arceri --- src/compiler/spirv/vtn_private.h | 1 + src/compiler/spirv/vtn_variables.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h index 21ddacd8d2e..b5199bda633 100644 --- a/src/compiler/spirv/vtn_private.h +++ b/src/compiler/spirv/vtn_private.h @@ -465,6 +465,7 @@ struct vtn_variable { unsigned descriptor_set; unsigned binding; bool explicit_binding; + unsigned offset; unsigned input_attachment_index; bool patch; diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 6a2144ceabb..c56d74d683b 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -1346,6 +1346,9 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member, case SpvDecorationPatch: vtn_var->patch = true; break; + case SpvDecorationOffset: + vtn_var->offset = dec->literals[0]; + break; default: break; } -- 2.30.2