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 <tarceri@itsqueeze.com>
This commit is contained in:
Alejandro Piñeiro
2017-11-05 12:00:19 +01:00
parent 768c275deb
commit c6230b9358
2 changed files with 4 additions and 0 deletions

View File

@@ -465,6 +465,7 @@ struct vtn_variable {
unsigned descriptor_set; unsigned descriptor_set;
unsigned binding; unsigned binding;
bool explicit_binding; bool explicit_binding;
unsigned offset;
unsigned input_attachment_index; unsigned input_attachment_index;
bool patch; bool patch;

View File

@@ -1346,6 +1346,9 @@ var_decoration_cb(struct vtn_builder *b, struct vtn_value *val, int member,
case SpvDecorationPatch: case SpvDecorationPatch:
vtn_var->patch = true; vtn_var->patch = true;
break; break;
case SpvDecorationOffset:
vtn_var->offset = dec->literals[0];
break;
default: default:
break; break;
} }