|
|
|
@ -127,21 +127,21 @@ float4 test_scalar_indexing()
|
|
|
|
|
`-IntegerLiteral <col:14> 'literal int' 0
|
|
|
|
|
*/
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t1da[0]; // expected-error {{no viable overloaded operator[] for type 'Texture1DArray<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 2>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t1da[0]; // expected-error {{no viable overloaded operator[] for type 'Texture1DArray'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 2>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120 : invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t2d[0]; // expected-error {{no viable overloaded operator[] for type 'Texture2D<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 2>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t2d[0]; // expected-error {{no viable overloaded operator[] for type 'Texture2D'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 2>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120 : invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t2da[0]; // expected-error {{no viable overloaded operator[] for type 'Texture2DArray<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t2da[0]; // expected-error {{no viable overloaded operator[] for type 'Texture2DArray'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120 : invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t2dms[0]; // expected-error {{no viable overloaded operator[] for type 'Texture2DMS<float4, 8>'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 2>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120 : invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t2dmsa[0]; // expected-error {{no viable overloaded operator[] for type 'Texture2DMSArray<float4, 8>'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120 : invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t3d[0]; // expected-error {{no viable overloaded operator[] for type 'Texture3D<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t3d[0]; // expected-error {{no viable overloaded operator[] for type 'Texture3D'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'literal int' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3121: array, matrix, vector, or indexable object type expected in index expression
|
|
|
|
|
f4 += g_tc[0]; // expected-error {{type 'TextureCube<vector<float, 4> >' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
f4 += g_tc[0]; // expected-error {{type 'TextureCube' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
// fxc error X3121: array, matrix, vector, or indexable object type expected in index expression
|
|
|
|
|
f4 += g_tca[0]; // expected-error {{type 'TextureCubeArray<vector<float, 4> >' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
f4 += g_tca[0]; // expected-error {{type 'TextureCubeArray' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
|
|
|
|
|
g_b[0] = f4; /* expected-error {{cannot assign to return value because function 'operator[]<const vector<float, 4> &>' returns a const value}} fxc-error {{X3025: l-value specifies const object}} */
|
|
|
|
|
g_t1d[0] = f4; /* expected-error {{cannot assign to return value because function 'operator[]<const vector<float, 4> &>' returns a const value}} fxc-error {{X3025: l-value specifies const object}} */
|
|
|
|
@ -199,9 +199,9 @@ float4 test_vector2_indexing()
|
|
|
|
|
int2 offset = { 1, 2 };
|
|
|
|
|
float4 f4 = 0;
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_b[offset]; // expected-error {{no viable overloaded operator[] for type 'Buffer<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int2' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_b[offset]; // expected-error {{no viable overloaded operator[] for type 'Buffer'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int2' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t1d[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture1D<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int2' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t1d[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture1D'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int2' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_sb[offset]; // expected-error {{no viable overloaded operator[] for type 'StructuredBuffer<float4>'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int2' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t1da[offset];
|
|
|
|
@ -233,16 +233,16 @@ float4 test_vector2_indexing()
|
|
|
|
|
`-DeclRefExpr <col:15> 'int2':'vector<int, 2>' lvalue Var 'offset' 'int2':'vector<int, 2>'
|
|
|
|
|
*/
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t2da[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture2DArray<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'vector<int, 2>' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t2da[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture2DArray'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'vector<int, 2>' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t2dms[offset];
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t2dmsa[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture2DMSArray<float4, 8>'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'vector<int, 2>' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t3d[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture3D<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'vector<int, 2>' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t3d[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture3D'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'vector<int, 2>' to 'vector<uint, 3>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3121: array, matrix, vector, or indexable object type expected in index expression
|
|
|
|
|
f4 += g_tc[offset]; // expected-error {{type 'TextureCube<vector<float, 4> >' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
f4 += g_tc[offset]; // expected-error {{type 'TextureCube' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
// fxc error X3121: array, matrix, vector, or indexable object type expected in index expression
|
|
|
|
|
f4 += g_tca[offset]; // expected-error {{type 'TextureCubeArray<vector<float, 4> >' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
f4 += g_tca[offset]; // expected-error {{type 'TextureCubeArray' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
|
|
|
|
|
g_t1da[offset] = f4; /* expected-error {{cannot assign to return value because function 'operator[]<const vector<float, 4> &>' returns a const value}} fxc-error {{X3025: l-value specifies const object}} */
|
|
|
|
|
g_t2d[offset] = f4; /* expected-error {{cannot assign to return value because function 'operator[]<const vector<float, 4> &>' returns a const value}} fxc-error {{X3025: l-value specifies const object}} */
|
|
|
|
@ -290,15 +290,15 @@ float4 test_vector3_indexing()
|
|
|
|
|
int3 offset = { 1, 2, 3 };
|
|
|
|
|
float4 f4 = 0;
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_b[offset]; // expected-error {{no viable overloaded operator[] for type 'Buffer<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int3' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_b[offset]; // expected-error {{no viable overloaded operator[] for type 'Buffer'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int3' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t1d[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture1D<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int3' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t1d[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture1D'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int3' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_sb[offset]; // expected-error {{no viable overloaded operator[] for type 'StructuredBuffer<float4>'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'int3' to 'unsigned int' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t1da[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture1DArray<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'vector<int, 3>' to 'vector<uint, 2>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t1da[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture1DArray'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'vector<int, 3>' to 'vector<uint, 2>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
// fxc error X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions
|
|
|
|
|
f4 += g_t2d[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture2D<vector<float, 4> >'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'vector<int, 3>' to 'vector<uint, 2>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t2d[offset]; // expected-error {{no viable overloaded operator[] for type 'Texture2D'}} expected-note {{candidate function [with element = const vector<float, 4> &] not viable: no known conversion from 'vector<int, 3>' to 'vector<uint, 2>' for 1st argument}} fxc-error {{X3120: invalid type for index - index must be a scalar, or a vector with the correct number of dimensions}}
|
|
|
|
|
f4 += g_t2da[offset];
|
|
|
|
|
/*verify-ast
|
|
|
|
|
CompoundAssignOperator <col:3, col:22> 'float4':'vector<float, 4>' lvalue '+=' ComputeLHSTy='float4':'vector<float, 4>' ComputeResultTy='float4':'vector<float, 4>'
|
|
|
|
@ -344,9 +344,9 @@ float4 test_vector3_indexing()
|
|
|
|
|
`-DeclRefExpr <col:15> 'int3':'vector<int, 3>' lvalue Var 'offset' 'int3':'vector<int, 3>'
|
|
|
|
|
*/
|
|
|
|
|
// fxc error X3121: array, matrix, vector, or indexable object type expected in index expression
|
|
|
|
|
f4 += g_tc[offset]; // expected-error {{type 'TextureCube<vector<float, 4> >' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
f4 += g_tc[offset]; // expected-error {{type 'TextureCube' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
// fxc error X3121: array, matrix, vector, or indexable object type expected in index expression
|
|
|
|
|
f4 += g_tca[offset]; // expected-error {{type 'TextureCubeArray<vector<float, 4> >' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
f4 += g_tca[offset]; // expected-error {{type 'TextureCubeArray' does not provide a subscript operator}} fxc-error {{X3121: array, matrix, vector, or indexable object type expected in index expression}}
|
|
|
|
|
|
|
|
|
|
g_t2da[offset] = f4; /* expected-error {{cannot assign to return value because function 'operator[]<const vector<float, 4> &>' returns a const value}} fxc-error {{X3025: l-value specifies const object}} */
|
|
|
|
|
g_t2dmsa[offset] = f4; /* expected-error {{cannot assign to return value because function 'operator[]<const vector<float, 4> &>' returns a const value}} fxc-error {{X3025: l-value specifies const object}} */
|
|
|
|
|