aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-08-16 15:11:12 -0500
committerJason Ekstrand <[email protected]>2018-08-29 14:04:02 -0500
commit3942943819a87ad423df56e3138223fc37f5db21 (patch)
treeb99ea979073e479a25136d32d96846ee646ac24c /src/compiler/spirv
parent48e4fa7dd8c4b777989c4a731d6ac54cfe6c24eb (diff)
nir: Use a bitfield for image access qualifiers
This commit expands the current memory access enum to contain the extra two bits provided for images. We choose to follow the SPIR-V convention of NonReadable and NonWriteable because readonly implies that you *can* read so readonly + writeonly doesn't make as much sense as NonReadable + NonWriteable. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r--src/compiler/spirv/vtn_variables.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
index 571a14cf4cf..358ff4bef7a 100644
--- a/src/compiler/spirv/vtn_variables.c
+++ b/src/compiler/spirv/vtn_variables.c
@@ -1248,20 +1248,20 @@ apply_var_decoration(struct vtn_builder *b,
var_data->read_only = true;
break;
case SpvDecorationNonReadable:
- var_data->image.write_only = true;
+ var_data->image.access |= ACCESS_NON_READABLE;
break;
case SpvDecorationNonWritable:
var_data->read_only = true;
- var_data->image.read_only = true;
+ var_data->image.access |= ACCESS_NON_WRITEABLE;
break;
case SpvDecorationRestrict:
- var_data->image.restrict_flag = true;
+ var_data->image.access |= ACCESS_RESTRICT;
break;
case SpvDecorationVolatile:
- var_data->image._volatile = true;
+ var_data->image.access |= ACCESS_VOLATILE;
break;
case SpvDecorationCoherent:
- var_data->image.coherent = true;
+ var_data->image.access |= ACCESS_COHERENT;
break;
case SpvDecorationComponent:
var_data->location_frac = dec->literals[0];