blob: 2a023bca32c9572e7f942416653b9f89895a74b1 (
plain)
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
|
//TEST:SIMPLE(filecheck=CHECK):-target spirv
// This test verifies that a generic method defined in an extension can be found.
// CHECK: OpEntryPoint
struct Test {
void genericMethod<int u>(float2 x) {}
__subscript<T:__BuiltinIntegerType>(T idx1, T idx2) -> int
{
get { return 0; }
}
}
extension Test {
void genericMethod<int u>() {}
__subscript<T:__BuiltinIntegerType>(T idx1) -> int
{
get { return 1; }
}
}
[shader("compute")]
void main()
{
Test t;
t.genericMethod<3>(); // Should work - calls extension method
int a = t[0]; // Should work - calls extension method
}
|