| ... | ... | @@ -308,6 +308,21 @@ pub fn generateNav(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) codegen.E |
| 308 | 308 | else => {}, |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | const image_ty = blk: { |
| 312 | if (ty.zigTypeTag(zcu) == .array or ty.isSpirvRuntimeArray(zcu)) { |
| 313 | break :blk ty.childType(zcu); |
| 314 | } |
| 315 | break :blk ty; |
| 316 | }; |
| 317 | if (image_ty.zigTypeTag(zcu) == .spirv) { |
| 318 | const spirv_type = ip.loadSpirvType(image_ty.toIntern()); |
| 319 | if (spirv_type.flags.tag == .image) switch (spirv_type.flags.access) { |
| 320 | .read_only => try cg.decorate(result_id, .non_writable), |
| 321 | .write_only => try cg.decorate(result_id, .non_readable), |
| 322 | .read_write, .unknown => {}, |
| 323 | }; |
| 324 | } |
| 325 | |
| 311 | 326 | if (ext.decoration) |decoration| switch (decoration) { |
| 312 | 327 | .location => |location| { |
| 313 | 328 | try cg.decorate(result_id, .{ |
| ... | ... | @@ -2237,11 +2252,16 @@ fn resolveType(cg: *CodeGen, ty: Type, repr: Repr) Error!Id { |
| 2237 | 2252 | .r32i => .r32i, |
| 2238 | 2253 | .r32u => .r32ui, |
| 2239 | 2254 | }, |
| 2240 | | .access_qualifier = switch (spirv_type.flags.access) { |
| 2241 | | .unknown => null, |
| 2242 | | .read_only => .read_only, |
| 2243 | | .write_only => .write_only, |
| 2244 | | .read_write => .read_write, |
| 2255 | .access_qualifier = blk: { |
| 2256 | if (target.os.tag == .opencl) { |
| 2257 | break :blk switch (spirv_type.flags.access) { |
| 2258 | .unknown => null, |
| 2259 | .read_only => .read_only, |
| 2260 | .write_only => .write_only, |
| 2261 | .read_write => .read_write, |
| 2262 | }; |
| 2263 | } |
| 2264 | break :blk null; |
| 2245 | 2265 | }, |
| 2246 | 2266 | }); |
| 2247 | 2267 | }, |