File: spv.tensorARM.invalid_access.comp

package info (click to toggle)
glslang 16.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,720 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (33 lines) | stat: -rw-r--r-- 1,094 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
#version 460 core

#extension GL_ARM_tensors : enable

uniform tensorARM<int, 1> t;

void main() {
  // Type checking should render these accesses invalid
  int i = 33;
  float w = 1.5;
  tensorWriteARM(t, uint[](0,0), i);
  tensorWriteARM(t, uint[](0,0), w);
  float r;
  tensorReadARM(t, uint[](0,0), i);
  tensorReadARM(t, uint[](0,0), r);

  // Signed vs unsigned.
  uint u = 34;
  tensorReadARM(t, uint[](0), u);
  tensorWriteARM(t, uint[](0), u);

  // OutOfBounds value is only valid with tensorReadARM.
  tensorWriteARM(t, uint[](1), i, gl_TensorOperandsOutOfBoundsValueARM, 14);

  // OutOfBounds value must be provided.
  tensorReadARM(t, uint[](1), i, gl_TensorOperandsOutOfBoundsValueARM);
  // OutOfBounds value must be constant.
  tensorReadARM(t, uint[](2), i, gl_TensorOperandsOutOfBoundsValueARM, i);
  // OutOfBounds value type must match tensor element type.
  tensorReadARM(t, uint[](3), i, gl_TensorOperandsOutOfBoundsValueARM, 3.14);
  // OutOfBounds value type must match tensor element type.
  tensorReadARM(t, uint[](3), i, gl_TensorOperandsOutOfBoundsValueARM, 3u);
}