% The texel offset argument to Load() must resolve to a constant integer;
% make sure that we can do so.

[require]
shader model >= 4.0


[srv 0]
size (2d, 4, 4)
 1.0  1.0  1.0  1.0    2.0  2.0  2.0  2.0    3.0  3.0  3.0  3.0    4.0  4.0  4.0  4.0
 5.0  5.0  5.0  5.0    6.0  6.0  6.0  6.0    7.0  7.0  7.0  7.0    8.0  8.0  8.0  8.0
 9.0  9.0  9.0  9.0   10.0 10.0 10.0 10.0   11.0 11.0 11.0 11.0   12.0 12.0 12.0 12.0
13.0 13.0 13.0 13.0   14.0 14.0 14.0 14.0   14.0 15.0 15.0 15.0   16.0 16.0 16.0 16.0


[pixel shader]
Texture2D tex;
uniform int i;

float4 main() : sv_target
{
    int4 a = {1, 2, i, i};
    return 100 * a + tex.Load(int3(0, 0, 0), a.xy);
}

[test]
uniform 0 int 4
todo(msl) draw quad
probe (0, 0) rgba (110, 210, 410, 410)


[pixel shader]
Texture2D tex;
uniform int i;

float4 main() : sv_target
{
    int4 a = {0, 1, 2, i};
    int4 b = a.yxww;
    int3 c = b.wyx;
    return 100 * b + tex.Load(int3(0, 0, 0), c.yz);
}

[test]
uniform 0 int 3
todo(msl) draw quad
probe (0, 0) rgba (105, 5, 305, 305)


[pixel shader]
Texture2D tex;
uniform int i;

float4 main() : sv_target
{
    int4 a = {1, 2, 3, i};
    return tex.Load(int3(0, 0, 0), a.wzxx.yxw.zx);
}

[test]
uniform 0 int 1
todo(msl) draw quad
probe (0, 0) rgba (14.0, 14.0, 14.0, 14.0)
