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);
}
|