File: spv.tensorARM.access_qualifiers.comp

package info (click to toggle)
glslang 16.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,084 kB
  • sloc: cpp: 90,714; yacc: 4,243; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (35 lines) | stat: -rw-r--r-- 1,088 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#version 460 core

#extension GL_ARM_tensors : enable

readonly layout(set=0, binding=1) uniform tensorARM<int, 2> roTens;
writeonly layout(set=0, binding=0) uniform tensorARM<int, 2> woTens;
readonly writeonly layout(set=0, binding=1) uniform tensorARM<int, 2> rowoTens;
layout(set=0, binding=2) uniform tensorARM<int, 2> rwTens;
shared uint x;

void main() {
  // tensorSizeARM should be callable with any tensor regardless of access qualifiers.
  x = 0;
  x += tensorSizeARM(roTens, 0);
  x += tensorSizeARM(woTens, 0);
  x += tensorSizeARM(rowoTens, 1);
  x += tensorSizeARM(rwTens, 1);

  int d = 4;
  // Valid tensorWriteARM calls.
  tensorWriteARM(woTens, uint[](0, 0), d);
  tensorWriteARM(rwTens, uint[](0, 0), d);

  // Invalid tensorWriteARM calls.
  tensorWriteARM(rowoTens, uint[](0, 0), d);
  tensorWriteARM(roTens, uint[](0, 0), d);

  // Valid tensorReadARM calls.
  tensorReadARM(roTens, uint[](0, 0), d);
  tensorReadARM(rwTens, uint[](0, 0), d);

  // Invalid tensorReadARM calls.
  tensorReadARM(rowoTens, uint[](0, 0), d);
  tensorReadARM(woTens, uint[](0, 0), d);
}