spirv: apply memory qualifiers to images
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 22 Feb 2018 09:25:37 +0000 (10:25 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 22 Feb 2018 19:39:53 +0000 (20:39 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/compiler/spirv/vtn_variables.c

index ead68b4784860d748f909c5c98ad256767180111..9eb85c24e9571e928f4258a53b9f7e458645e2b5 100644 (file)
@@ -1332,6 +1332,15 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,
       nir_var->data.read_only = true;
       nir_var->data.image.read_only = true;
       break;
+   case SpvDecorationRestrict:
+      nir_var->data.image.restrict_flag = true;
+      break;
+   case SpvDecorationVolatile:
+      nir_var->data.image._volatile = true;
+      break;
+   case SpvDecorationCoherent:
+      nir_var->data.image.coherent = true;
+      break;
    case SpvDecorationComponent:
       nir_var->data.location_frac = dec->literals[0];
       break;
@@ -1378,10 +1387,7 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,
    case SpvDecorationRowMajor:
    case SpvDecorationColMajor:
    case SpvDecorationMatrixStride:
-   case SpvDecorationRestrict:
    case SpvDecorationAliased:
-   case SpvDecorationVolatile:
-   case SpvDecorationCoherent:
    case SpvDecorationUniform:
    case SpvDecorationStream:
    case SpvDecorationOffset: