HLSL: Fix #1912: add attribute syntax for nonreadable/nonwritable
diff --git a/Test/baseResults/hlsl.format.rwtexture.frag.out b/Test/baseResults/hlsl.format.rwtexture.frag.out
old mode 100755
new mode 100644
index 2ecd514..7ab5329
--- a/Test/baseResults/hlsl.format.rwtexture.frag.out
+++ b/Test/baseResults/hlsl.format.rwtexture.frag.out
@@ -3,47 +3,47 @@
gl_FragCoord origin is upper left
using depth_any
0:? Sequence
-0:30 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Function Parameters:
+0:56 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Function Parameters:
0:? Sequence
-0:33 move second child to first child ( temp 4-component vector of float)
-0:33 Color: direct index for structure ( temp 4-component vector of float)
-0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:33 Constant:
-0:33 0 (const int)
-0:33 Constant:
-0:33 1.000000
-0:33 1.000000
-0:33 1.000000
-0:33 1.000000
-0:34 move second child to first child ( temp float)
-0:34 Depth: direct index for structure ( temp float)
-0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:34 Constant:
-0:34 1 (const int)
-0:34 Constant:
-0:34 1.000000
-0:36 Branch: Return with expression
-0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Function Definition: main( ( temp void)
-0:30 Function Parameters:
+0:59 move second child to first child ( temp 4-component vector of float)
+0:59 Color: direct index for structure ( temp 4-component vector of float)
+0:59 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:59 Constant:
+0:59 0 (const int)
+0:59 Constant:
+0:59 1.000000
+0:59 1.000000
+0:59 1.000000
+0:59 1.000000
+0:60 move second child to first child ( temp float)
+0:60 Depth: direct index for structure ( temp float)
+0:60 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:60 Constant:
+0:60 1 (const int)
+0:60 Constant:
+0:60 1.000000
+0:62 Branch: Return with expression
+0:62 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Function Definition: main( ( temp void)
+0:56 Function Parameters:
0:? Sequence
-0:30 Sequence
-0:30 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 move second child to first child ( temp 4-component vector of float)
+0:56 Sequence
+0:56 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
-0:30 Color: direct index for structure ( temp 4-component vector of float)
-0:30 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Constant:
-0:30 0 (const int)
-0:30 move second child to first child ( temp float)
+0:56 Color: direct index for structure ( temp 4-component vector of float)
+0:56 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Constant:
+0:56 0 (const int)
+0:56 move second child to first child ( temp float)
0:? '@entryPointOutput.Depth' ( out float FragDepth)
-0:30 Depth: direct index for structure ( temp float)
-0:30 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Constant:
-0:30 1 (const int)
+0:56 Depth: direct index for structure ( temp float)
+0:56 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Constant:
+0:56 1 (const int)
0:? Linker Objects
0:? 'g_sSamp' (layout( binding=0) uniform sampler)
0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D)
@@ -52,15 +52,40 @@
0:? 'g_tTex2df4' (layout( rgba8i) uniform image2D)
0:? 'g_tTex2di4' (layout( r11f_g11f_b10f) uniform iimage2D)
0:? 'g_tTex2du4' (layout( r8_snorm) uniform uimage2D)
-0:? 'g_tTex3df4' (layout( rg8) uniform image3D)
-0:? 'g_tTex3di4' (layout( rgba16i) uniform iimage3D)
-0:? 'g_tTex3du4' (layout( r8i) uniform uimage3D)
+0:? 'g_tTex3df4' (layout( rg8) readonly uniform image3D)
+0:? 'g_tTex3di4' (layout( rgba16i) writeonly uniform iimage3D)
+0:? 'g_tTex3du4' (layout( r8i) readonly writeonly uniform uimage3D)
0:? 'g_tTex1df4a' (layout( rgba8ui) uniform image1DArray)
0:? 'g_tTex1di4a' (layout( rg32ui) uniform iimage1DArray)
0:? 'g_tTex1du4a' (layout( r16ui) uniform uimage1DArray)
0:? 'g_tTex2df4a' (layout( rgb10_a2ui) uniform image2DArray)
0:? 'g_tTex2di4a' (layout( r8ui) uniform iimage2DArray)
0:? 'g_tTex2du4a' (layout( rgba16f) uniform uimage2DArray)
+0:? 'g_tTex01' (layout( rgba8) uniform iimage2DArray)
+0:? 'g_tTex02' (layout( rg16f) uniform iimage2DArray)
+0:? 'g_tTex03' (layout( r16f) uniform iimage2DArray)
+0:? 'g_tTex04' (layout( rgb10_a2) uniform iimage2DArray)
+0:? 'g_tTex05' (layout( rg16) uniform iimage2DArray)
+0:? 'g_tTex06' (layout( r32f) uniform iimage2DArray)
+0:? 'g_tTex07' (layout( rgba16) uniform iimage2DArray)
+0:? 'g_tTex08' (layout( r16) uniform iimage2DArray)
+0:? 'g_tTex09' (layout( r8) uniform iimage2DArray)
+0:? 'g_tTex10' (layout( rgba16_snorm) uniform iimage2DArray)
+0:? 'g_tTex11' (layout( rg16_snorm) uniform iimage2DArray)
+0:? 'g_tTex12' (layout( r16_snorm) uniform iimage2DArray)
+0:? 'g_tTex13' (layout( r8_snorm) uniform iimage2DArray)
+0:? 'g_tTex14' (layout( rgba32i) uniform iimage2DArray)
+0:? 'g_tTex15' (layout( r32i) uniform iimage2DArray)
+0:? 'g_tTex16' (layout( r32ui) uniform iimage2DArray)
+0:? 'g_tTex17' (layout( rg16i) uniform iimage2DArray)
+0:? 'g_tTex18' (layout( r16i) uniform iimage2DArray)
+0:? 'g_tTex19' (layout( rg32i) uniform iimage2DArray)
+0:? 'g_tTex20' (layout( rg8i) uniform iimage2DArray)
+0:? 'g_tTex21' (layout( rg8ui) uniform iimage2DArray)
+0:? 'g_tTex22' (layout( rgba32ui) uniform iimage2DArray)
+0:? 'g_tTex23' (layout( rgba16ui) uniform iimage2DArray)
+0:? 'g_tTex24' (layout( rg32ui) uniform iimage2DArray)
+0:? 'g_tTex25' (layout( rg16ui) uniform iimage2DArray)
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
@@ -72,47 +97,47 @@
gl_FragCoord origin is upper left
using depth_any
0:? Sequence
-0:30 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Function Parameters:
+0:56 Function Definition: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Function Parameters:
0:? Sequence
-0:33 move second child to first child ( temp 4-component vector of float)
-0:33 Color: direct index for structure ( temp 4-component vector of float)
-0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:33 Constant:
-0:33 0 (const int)
-0:33 Constant:
-0:33 1.000000
-0:33 1.000000
-0:33 1.000000
-0:33 1.000000
-0:34 move second child to first child ( temp float)
-0:34 Depth: direct index for structure ( temp float)
-0:34 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:34 Constant:
-0:34 1 (const int)
-0:34 Constant:
-0:34 1.000000
-0:36 Branch: Return with expression
-0:36 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Function Definition: main( ( temp void)
-0:30 Function Parameters:
+0:59 move second child to first child ( temp 4-component vector of float)
+0:59 Color: direct index for structure ( temp 4-component vector of float)
+0:59 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:59 Constant:
+0:59 0 (const int)
+0:59 Constant:
+0:59 1.000000
+0:59 1.000000
+0:59 1.000000
+0:59 1.000000
+0:60 move second child to first child ( temp float)
+0:60 Depth: direct index for structure ( temp float)
+0:60 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:60 Constant:
+0:60 1 (const int)
+0:60 Constant:
+0:60 1.000000
+0:62 Branch: Return with expression
+0:62 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Function Definition: main( ( temp void)
+0:56 Function Parameters:
0:? Sequence
-0:30 Sequence
-0:30 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 move second child to first child ( temp 4-component vector of float)
+0:56 Sequence
+0:56 move second child to first child ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Function Call: @main( ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 move second child to first child ( temp 4-component vector of float)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
-0:30 Color: direct index for structure ( temp 4-component vector of float)
-0:30 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Constant:
-0:30 0 (const int)
-0:30 move second child to first child ( temp float)
+0:56 Color: direct index for structure ( temp 4-component vector of float)
+0:56 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Constant:
+0:56 0 (const int)
+0:56 move second child to first child ( temp float)
0:? '@entryPointOutput.Depth' ( out float FragDepth)
-0:30 Depth: direct index for structure ( temp float)
-0:30 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
-0:30 Constant:
-0:30 1 (const int)
+0:56 Depth: direct index for structure ( temp float)
+0:56 'flattenTemp' ( temp structure{ temp 4-component vector of float Color, temp float Depth})
+0:56 Constant:
+0:56 1 (const int)
0:? Linker Objects
0:? 'g_sSamp' (layout( binding=0) uniform sampler)
0:? 'g_tTex1df4' (layout( binding=0 rgba32f) uniform image1D)
@@ -121,21 +146,46 @@
0:? 'g_tTex2df4' (layout( rgba8i) uniform image2D)
0:? 'g_tTex2di4' (layout( r11f_g11f_b10f) uniform iimage2D)
0:? 'g_tTex2du4' (layout( r8_snorm) uniform uimage2D)
-0:? 'g_tTex3df4' (layout( rg8) uniform image3D)
-0:? 'g_tTex3di4' (layout( rgba16i) uniform iimage3D)
-0:? 'g_tTex3du4' (layout( r8i) uniform uimage3D)
+0:? 'g_tTex3df4' (layout( rg8) readonly uniform image3D)
+0:? 'g_tTex3di4' (layout( rgba16i) writeonly uniform iimage3D)
+0:? 'g_tTex3du4' (layout( r8i) readonly writeonly uniform uimage3D)
0:? 'g_tTex1df4a' (layout( rgba8ui) uniform image1DArray)
0:? 'g_tTex1di4a' (layout( rg32ui) uniform iimage1DArray)
0:? 'g_tTex1du4a' (layout( r16ui) uniform uimage1DArray)
0:? 'g_tTex2df4a' (layout( rgb10_a2ui) uniform image2DArray)
0:? 'g_tTex2di4a' (layout( r8ui) uniform iimage2DArray)
0:? 'g_tTex2du4a' (layout( rgba16f) uniform uimage2DArray)
+0:? 'g_tTex01' (layout( rgba8) uniform iimage2DArray)
+0:? 'g_tTex02' (layout( rg16f) uniform iimage2DArray)
+0:? 'g_tTex03' (layout( r16f) uniform iimage2DArray)
+0:? 'g_tTex04' (layout( rgb10_a2) uniform iimage2DArray)
+0:? 'g_tTex05' (layout( rg16) uniform iimage2DArray)
+0:? 'g_tTex06' (layout( r32f) uniform iimage2DArray)
+0:? 'g_tTex07' (layout( rgba16) uniform iimage2DArray)
+0:? 'g_tTex08' (layout( r16) uniform iimage2DArray)
+0:? 'g_tTex09' (layout( r8) uniform iimage2DArray)
+0:? 'g_tTex10' (layout( rgba16_snorm) uniform iimage2DArray)
+0:? 'g_tTex11' (layout( rg16_snorm) uniform iimage2DArray)
+0:? 'g_tTex12' (layout( r16_snorm) uniform iimage2DArray)
+0:? 'g_tTex13' (layout( r8_snorm) uniform iimage2DArray)
+0:? 'g_tTex14' (layout( rgba32i) uniform iimage2DArray)
+0:? 'g_tTex15' (layout( r32i) uniform iimage2DArray)
+0:? 'g_tTex16' (layout( r32ui) uniform iimage2DArray)
+0:? 'g_tTex17' (layout( rg16i) uniform iimage2DArray)
+0:? 'g_tTex18' (layout( r16i) uniform iimage2DArray)
+0:? 'g_tTex19' (layout( rg32i) uniform iimage2DArray)
+0:? 'g_tTex20' (layout( rg8i) uniform iimage2DArray)
+0:? 'g_tTex21' (layout( rg8ui) uniform iimage2DArray)
+0:? 'g_tTex22' (layout( rgba32ui) uniform iimage2DArray)
+0:? 'g_tTex23' (layout( rgba16ui) uniform iimage2DArray)
+0:? 'g_tTex24' (layout( rg32ui) uniform iimage2DArray)
+0:? 'g_tTex25' (layout( rg16ui) uniform iimage2DArray)
0:? '@entryPointOutput.Depth' ( out float FragDepth)
0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float)
// Module Version 10000
// Generated by (magic number): 80007
-// Id's are bound by 85
+// Id's are bound by 160
Capability Shader
Capability Image1D
@@ -171,6 +221,31 @@
Name 78 "g_tTex2df4a"
Name 81 "g_tTex2di4a"
Name 84 "g_tTex2du4a"
+ Name 87 "g_tTex01"
+ Name 90 "g_tTex02"
+ Name 93 "g_tTex03"
+ Name 96 "g_tTex04"
+ Name 99 "g_tTex05"
+ Name 102 "g_tTex06"
+ Name 105 "g_tTex07"
+ Name 108 "g_tTex08"
+ Name 111 "g_tTex09"
+ Name 114 "g_tTex10"
+ Name 117 "g_tTex11"
+ Name 120 "g_tTex12"
+ Name 123 "g_tTex13"
+ Name 126 "g_tTex14"
+ Name 129 "g_tTex15"
+ Name 132 "g_tTex16"
+ Name 135 "g_tTex17"
+ Name 138 "g_tTex18"
+ Name 141 "g_tTex19"
+ Name 144 "g_tTex20"
+ Name 147 "g_tTex21"
+ Name 150 "g_tTex22"
+ Name 153 "g_tTex23"
+ Name 156 "g_tTex24"
+ Name 159 "g_tTex25"
Decorate 29(@entryPointOutput.Color) Location 0
Decorate 33(@entryPointOutput.Depth) BuiltIn FragDepth
Decorate 38(g_sSamp) DescriptorSet 0
@@ -189,10 +264,14 @@
Decorate 57(g_tTex2du4) Binding 0
Decorate 60(g_tTex3df4) DescriptorSet 0
Decorate 60(g_tTex3df4) Binding 0
+ Decorate 60(g_tTex3df4) NonWritable
Decorate 63(g_tTex3di4) DescriptorSet 0
Decorate 63(g_tTex3di4) Binding 0
+ Decorate 63(g_tTex3di4) NonReadable
Decorate 66(g_tTex3du4) DescriptorSet 0
Decorate 66(g_tTex3du4) Binding 0
+ Decorate 66(g_tTex3du4) NonWritable
+ Decorate 66(g_tTex3du4) NonReadable
Decorate 69(g_tTex1df4a) DescriptorSet 0
Decorate 69(g_tTex1df4a) Binding 0
Decorate 72(g_tTex1di4a) DescriptorSet 0
@@ -205,6 +284,56 @@
Decorate 81(g_tTex2di4a) Binding 0
Decorate 84(g_tTex2du4a) DescriptorSet 0
Decorate 84(g_tTex2du4a) Binding 0
+ Decorate 87(g_tTex01) DescriptorSet 0
+ Decorate 87(g_tTex01) Binding 0
+ Decorate 90(g_tTex02) DescriptorSet 0
+ Decorate 90(g_tTex02) Binding 0
+ Decorate 93(g_tTex03) DescriptorSet 0
+ Decorate 93(g_tTex03) Binding 0
+ Decorate 96(g_tTex04) DescriptorSet 0
+ Decorate 96(g_tTex04) Binding 0
+ Decorate 99(g_tTex05) DescriptorSet 0
+ Decorate 99(g_tTex05) Binding 0
+ Decorate 102(g_tTex06) DescriptorSet 0
+ Decorate 102(g_tTex06) Binding 0
+ Decorate 105(g_tTex07) DescriptorSet 0
+ Decorate 105(g_tTex07) Binding 0
+ Decorate 108(g_tTex08) DescriptorSet 0
+ Decorate 108(g_tTex08) Binding 0
+ Decorate 111(g_tTex09) DescriptorSet 0
+ Decorate 111(g_tTex09) Binding 0
+ Decorate 114(g_tTex10) DescriptorSet 0
+ Decorate 114(g_tTex10) Binding 0
+ Decorate 117(g_tTex11) DescriptorSet 0
+ Decorate 117(g_tTex11) Binding 0
+ Decorate 120(g_tTex12) DescriptorSet 0
+ Decorate 120(g_tTex12) Binding 0
+ Decorate 123(g_tTex13) DescriptorSet 0
+ Decorate 123(g_tTex13) Binding 0
+ Decorate 126(g_tTex14) DescriptorSet 0
+ Decorate 126(g_tTex14) Binding 0
+ Decorate 129(g_tTex15) DescriptorSet 0
+ Decorate 129(g_tTex15) Binding 0
+ Decorate 132(g_tTex16) DescriptorSet 0
+ Decorate 132(g_tTex16) Binding 0
+ Decorate 135(g_tTex17) DescriptorSet 0
+ Decorate 135(g_tTex17) Binding 0
+ Decorate 138(g_tTex18) DescriptorSet 0
+ Decorate 138(g_tTex18) Binding 0
+ Decorate 141(g_tTex19) DescriptorSet 0
+ Decorate 141(g_tTex19) Binding 0
+ Decorate 144(g_tTex20) DescriptorSet 0
+ Decorate 144(g_tTex20) Binding 0
+ Decorate 147(g_tTex21) DescriptorSet 0
+ Decorate 147(g_tTex21) Binding 0
+ Decorate 150(g_tTex22) DescriptorSet 0
+ Decorate 150(g_tTex22) Binding 0
+ Decorate 153(g_tTex23) DescriptorSet 0
+ Decorate 153(g_tTex23) Binding 0
+ Decorate 156(g_tTex24) DescriptorSet 0
+ Decorate 156(g_tTex24) Binding 0
+ Decorate 159(g_tTex25) DescriptorSet 0
+ Decorate 159(g_tTex25) Binding 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@@ -272,6 +401,81 @@
82: TypeImage 45(int) 2D array nonsampled format:Rgba16f
83: TypePointer UniformConstant 82
84(g_tTex2du4a): 83(ptr) Variable UniformConstant
+ 85: TypeImage 14(int) 2D array nonsampled format:Rgba8
+ 86: TypePointer UniformConstant 85
+ 87(g_tTex01): 86(ptr) Variable UniformConstant
+ 88: TypeImage 14(int) 2D array nonsampled format:Rg16f
+ 89: TypePointer UniformConstant 88
+ 90(g_tTex02): 89(ptr) Variable UniformConstant
+ 91: TypeImage 14(int) 2D array nonsampled format:R16f
+ 92: TypePointer UniformConstant 91
+ 93(g_tTex03): 92(ptr) Variable UniformConstant
+ 94: TypeImage 14(int) 2D array nonsampled format:Rgb10A2
+ 95: TypePointer UniformConstant 94
+ 96(g_tTex04): 95(ptr) Variable UniformConstant
+ 97: TypeImage 14(int) 2D array nonsampled format:Rg16
+ 98: TypePointer UniformConstant 97
+ 99(g_tTex05): 98(ptr) Variable UniformConstant
+ 100: TypeImage 14(int) 2D array nonsampled format:R32f
+ 101: TypePointer UniformConstant 100
+ 102(g_tTex06): 101(ptr) Variable UniformConstant
+ 103: TypeImage 14(int) 2D array nonsampled format:Rgba16
+ 104: TypePointer UniformConstant 103
+ 105(g_tTex07): 104(ptr) Variable UniformConstant
+ 106: TypeImage 14(int) 2D array nonsampled format:R16
+ 107: TypePointer UniformConstant 106
+ 108(g_tTex08): 107(ptr) Variable UniformConstant
+ 109: TypeImage 14(int) 2D array nonsampled format:R8
+ 110: TypePointer UniformConstant 109
+ 111(g_tTex09): 110(ptr) Variable UniformConstant
+ 112: TypeImage 14(int) 2D array nonsampled format:Rgba16Snorm
+ 113: TypePointer UniformConstant 112
+ 114(g_tTex10): 113(ptr) Variable UniformConstant
+ 115: TypeImage 14(int) 2D array nonsampled format:Rg16Snorm
+ 116: TypePointer UniformConstant 115
+ 117(g_tTex11): 116(ptr) Variable UniformConstant
+ 118: TypeImage 14(int) 2D array nonsampled format:R16Snorm
+ 119: TypePointer UniformConstant 118
+ 120(g_tTex12): 119(ptr) Variable UniformConstant
+ 121: TypeImage 14(int) 2D array nonsampled format:R8Snorm
+ 122: TypePointer UniformConstant 121
+ 123(g_tTex13): 122(ptr) Variable UniformConstant
+ 124: TypeImage 14(int) 2D array nonsampled format:Rgba32i
+ 125: TypePointer UniformConstant 124
+ 126(g_tTex14): 125(ptr) Variable UniformConstant
+ 127: TypeImage 14(int) 2D array nonsampled format:R32i
+ 128: TypePointer UniformConstant 127
+ 129(g_tTex15): 128(ptr) Variable UniformConstant
+ 130: TypeImage 14(int) 2D array nonsampled format:R32ui
+ 131: TypePointer UniformConstant 130
+ 132(g_tTex16): 131(ptr) Variable UniformConstant
+ 133: TypeImage 14(int) 2D array nonsampled format:Rg16i
+ 134: TypePointer UniformConstant 133
+ 135(g_tTex17): 134(ptr) Variable UniformConstant
+ 136: TypeImage 14(int) 2D array nonsampled format:R16i
+ 137: TypePointer UniformConstant 136
+ 138(g_tTex18): 137(ptr) Variable UniformConstant
+ 139: TypeImage 14(int) 2D array nonsampled format:Rg32i
+ 140: TypePointer UniformConstant 139
+ 141(g_tTex19): 140(ptr) Variable UniformConstant
+ 142: TypeImage 14(int) 2D array nonsampled format:Rg8i
+ 143: TypePointer UniformConstant 142
+ 144(g_tTex20): 143(ptr) Variable UniformConstant
+ 145: TypeImage 14(int) 2D array nonsampled format:Rg8ui
+ 146: TypePointer UniformConstant 145
+ 147(g_tTex21): 146(ptr) Variable UniformConstant
+ 148: TypeImage 14(int) 2D array nonsampled format:Rgba32ui
+ 149: TypePointer UniformConstant 148
+ 150(g_tTex22): 149(ptr) Variable UniformConstant
+ 151: TypeImage 14(int) 2D array nonsampled format:Rgba16ui
+ 152: TypePointer UniformConstant 151
+ 153(g_tTex23): 152(ptr) Variable UniformConstant
+ 154: TypeImage 14(int) 2D array nonsampled format:Rg32ui
+ 155: TypePointer UniformConstant 154
+ 156(g_tTex24): 155(ptr) Variable UniformConstant
+ 157: TypeImage 14(int) 2D array nonsampled format:Rg16ui
+ 158: TypePointer UniformConstant 157
+ 159(g_tTex25): 158(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
26(flattenTemp): 12(ptr) Variable Function
diff --git a/Test/hlsl.format.rwtexture.frag b/Test/hlsl.format.rwtexture.frag
old mode 100755
new mode 100644
index d92f590..87ee7de
--- a/Test/hlsl.format.rwtexture.frag
+++ b/Test/hlsl.format.rwtexture.frag
@@ -8,9 +8,9 @@
[[spv::format_r11fg11fb10f]] RWTexture2D <int4> g_tTex2di4;
[[spv::format_r8snorm]] RWTexture2D <uint4> g_tTex2du4;
-[[spv::format_rg8]] RWTexture3D <float4> g_tTex3df4;
-[[spv::format_rgba16i]] RWTexture3D <int4> g_tTex3di4;
-[[spv::format_r8i]] RWTexture3D <uint4> g_tTex3du4;
+[[spv::format_rg8]] [[spv::nonwritable]] RWTexture3D <float4> g_tTex3df4;
+[[spv::format_rgba16i]] [[spv::nonreadable]] RWTexture3D <int4> g_tTex3di4;
+[[spv::format_r8i]] [[spv::nonwritable]] [[spv::nonreadable]] RWTexture3D <uint4> g_tTex3du4;
[[spv::format_rgba8ui]] RWTexture1DArray <float4> g_tTex1df4a;
[[spv::format_rg32ui]] RWTexture1DArray <int4> g_tTex1di4a;
@@ -20,6 +20,32 @@
[[spv::format_r8ui]] RWTexture2DArray <int4> g_tTex2di4a;
[[spv::format_rgba16f]] RWTexture2DArray <uint4> g_tTex2du4a;
+[[spv::format_rgba8 ]] RWTexture2DArray<int4> g_tTex01;
+[[spv::format_rg16f ]] RWTexture2DArray<int4> g_tTex02;
+[[spv::format_r16f ]] RWTexture2DArray<int4> g_tTex03;
+[[spv::format_rgb10a2 ]] RWTexture2DArray<int4> g_tTex04;
+[[spv::format_rg16 ]] RWTexture2DArray<int4> g_tTex05;
+[[spv::format_r32f ]] RWTexture2DArray<int4> g_tTex06;
+[[spv::format_rgba16 ]] RWTexture2DArray<int4> g_tTex07;
+[[spv::format_r16 ]] RWTexture2DArray<int4> g_tTex08;
+[[spv::format_r8 ]] RWTexture2DArray<int4> g_tTex09;
+[[spv::format_rgba16snorm ]] RWTexture2DArray<int4> g_tTex10;
+[[spv::format_rg16snorm ]] RWTexture2DArray<int4> g_tTex11;
+[[spv::format_r16snorm ]] RWTexture2DArray<int4> g_tTex12;
+[[spv::format_r8snorm ]] RWTexture2DArray<int4> g_tTex13;
+[[spv::format_rgba32i ]] RWTexture2DArray<int4> g_tTex14;
+[[spv::format_r32i ]] RWTexture2DArray<int4> g_tTex15;
+[[spv::format_r32ui ]] RWTexture2DArray<int4> g_tTex16;
+[[spv::format_rg16i ]] RWTexture2DArray<int4> g_tTex17;
+[[spv::format_r16i ]] RWTexture2DArray<int4> g_tTex18;
+[[spv::format_rg32i ]] RWTexture2DArray<int4> g_tTex19;
+[[spv::format_rg8i ]] RWTexture2DArray<int4> g_tTex20;
+[[spv::format_rg8ui ]] RWTexture2DArray<int4> g_tTex21;
+[[spv::format_rgba32ui ]] RWTexture2DArray<int4> g_tTex22;
+[[spv::format_rgba16ui ]] RWTexture2DArray<int4> g_tTex23;
+[[spv::format_rg32ui ]] RWTexture2DArray<int4> g_tTex24;
+[[spv::format_rg16ui ]] RWTexture2DArray<int4> g_tTex25;
+
struct PS_OUTPUT
{
float4 Color : SV_Target0;
diff --git a/glslang/MachineIndependent/attribute.h b/glslang/MachineIndependent/attribute.h
index 92f3d63..38a943d 100644
--- a/glslang/MachineIndependent/attribute.h
+++ b/glslang/MachineIndependent/attribute.h
@@ -116,7 +116,9 @@
EatFormatRg8ui,
EatFormatR16ui,
EatFormatR8ui,
- EatFormatUnknown
+ EatFormatUnknown,
+ EatNonWritable,
+ EatNonReadable
};
class TIntermAggregate;
diff --git a/hlsl/hlslAttributes.cpp b/hlsl/hlslAttributes.cpp
index 05d4ae3..0cc0d3f 100644
--- a/hlsl/hlslAttributes.cpp
+++ b/hlsl/hlslAttributes.cpp
@@ -98,7 +98,9 @@
if (name == "format_rg8ui") return EatFormatRg8ui;
if (name == "format_r16ui") return EatFormatR16ui;
if (name == "format_r8ui") return EatFormatR8ui;
- return EatFormatUnknown;
+
+ if (name == "nonwritable") return EatNonWritable;
+ if (name == "nonreadable") return EatNonReadable;
} else if (nameSpace.size() > 0)
return EatNone;
diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp
index 8d389f5..be665ac 100755
--- a/hlsl/hlslParseHelper.cpp
+++ b/hlsl/hlslParseHelper.cpp
@@ -1993,6 +1993,9 @@
case EatFormatR8ui: type.getQualifier().layoutFormat = ElfR8ui; break;
case EatFormatUnknown: type.getQualifier().layoutFormat = ElfNone; break;
+ case EatNonWritable: type.getQualifier().readonly = true; break;
+ case EatNonReadable: type.getQualifier().writeonly = true; break;
+
default:
if (! allowEntry)
warn(loc, "attribute does not apply to a type", "", "");