blob: 8afaf877466171f2e9c9480eeccd8c6802f7ac90 [file] [log] [blame]
LoopDawge903ab52016-06-30 14:13:03 -06001float PixelShaderFunctionS(float inF0, float inF1, float inF2, int inI0)
LoopDawg643fcb52016-06-03 10:53:28 -06002{
3 // AllMemoryBarrier(); // TODO: expected error: invalid in fragment stage
4 // AllMemoryBarrierWithGroupSync(); // TODO: expected error: invalid in fragment stage
5 asdouble(inF0, inF1); // expected error: only integer inputs
6 CheckAccessFullyMapped(3.0); // expected error: only valid on integers
7 countbits(inF0); // expected error: only integer inputs
8 cross(inF0, inF1); // expected error: only on float3 inputs
9 D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs
10 determinant(inF0); // expected error: only valid on mats
11 // DeviceMemoryBarrierWithGroupSync(); // TODO: expected error: only valid in compute stage
12 f16tof32(inF0); // expected error: only integer inputs
13 firstbithigh(inF0); // expected error: only integer inputs
14 firstbitlow(inF0); // expected error: only integer inputs
LoopDawg1b7fd0f2016-06-22 15:20:14 -060015 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
LoopDawg643fcb52016-06-03 10:53:28 -060016 // InterlockedAdd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
17 // InterlockedAnd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out i // InterlockedMax(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
18 // InterlockedMin(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
19 // InterlockedOor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
20 // InterlockedXor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator
21 // GroupMemoryBarrier(); // TODO: expected error: invalid in fragment stage
22 // GroupMemoryBarrierWithGroupSync(); // TODO: expected error: invalid in fragment stage
23 length(inF0); // expected error: invalid on scalars
24 msad4(inF0, float2(0), float4(0)); // expected error: only integer inputs
25 normalize(inF0); // expected error: invalid on scalars
26 reflect(inF0, inF1); // expected error: invalid on scalars
27 refract(inF0, inF1, inF2); // expected error: invalid on scalars
28 refract(float2(0), float2(0), float2(0)); // expected error: last parameter only scalar
29 reversebits(inF0); // expected error: only integer inputs
30 transpose(inF0); // expected error: only valid on mats
31
32 return 0.0;
33}
34
LoopDawge903ab52016-06-30 14:13:03 -060035float1 PixelShaderFunction1(float1 inF0, float1 inF1, float1 inF2, int1 inI0)
LoopDawg643fcb52016-06-03 10:53:28 -060036{
37 // TODO: ... add when float1 prototypes are generated
38
39 GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs
40
41 return 0.0;
42}
43
LoopDawge903ab52016-06-30 14:13:03 -060044float2 PixelShaderFunction2(float2 inF0, float2 inF1, float2 inF2, int2 inI0)
LoopDawg643fcb52016-06-03 10:53:28 -060045{
46 asdouble(inF0, inF1); // expected error: only integer inputs
47 CheckAccessFullyMapped(inF0); // expected error: only valid on scalars
48 countbits(inF0); // expected error: only integer inputs
49 cross(inF0, inF1); // expected error: only on float3 inputs
50 D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs
51 determinant(inF0); // expected error: only valid on mats
52 f16tof32(inF0); // expected error: only integer inputs
53 firstbithigh(inF0); // expected error: only integer inputs
54 firstbitlow(inF0); // expected error: only integer inputs
LoopDawg1b7fd0f2016-06-22 15:20:14 -060055 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
LoopDawg643fcb52016-06-03 10:53:28 -060056 reversebits(inF0); // expected error: only integer inputs
57 transpose(inF0); // expected error: only valid on mats
58
59 return float2(1,2);
60}
61
LoopDawge903ab52016-06-30 14:13:03 -060062float3 PixelShaderFunction3(float3 inF0, float3 inF1, float3 inF2, int3 inI0)
LoopDawg643fcb52016-06-03 10:53:28 -060063{
64 CheckAccessFullyMapped(inF0); // expected error: only valid on scalars
65 countbits(inF0); // expected error: only integer inputs
66 D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs
67 determinant(inF0); // expected error: only valid on mats
68 f16tof32(inF0); // expected error: only integer inputs
69 firstbithigh(inF0); // expected error: only integer inputs
70 firstbitlow(inF0); // expected error: only integer inputs
LoopDawg1b7fd0f2016-06-22 15:20:14 -060071 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
LoopDawg643fcb52016-06-03 10:53:28 -060072 reversebits(inF0); // expected error: only integer inputs
73 transpose(inF0); // expected error: only valid on mats
74
75
76 return float3(1,2,3);
77}
78
79float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0)
80{
LoopDawg58910702016-06-13 09:22:28 -060081 CheckAccessFullyMapped(inF0); // expected error: only valid on scalars
82 countbits(inF0); // expected error: only integer inputs
83 cross(inF0, inF1); // expected error: only on float3 inputs
84 determinant(inF0); // expected error: only valid on mats
85 f16tof32(inF0); // expected error: only integer inputs
86 firstbithigh(inF0); // expected error: only integer inputs
87 firstbitlow(inF0); // expected error: only integer inputs
LoopDawg1b7fd0f2016-06-22 15:20:14 -060088 // fma(inF0, inF1, inF2); // TODO: this might auto-promote: need to check against FXC
LoopDawg58910702016-06-13 09:22:28 -060089 reversebits(inF0); // expected error: only integer inputs
90 transpose(inF0); // expected error: only valid on mats
LoopDawg643fcb52016-06-03 10:53:28 -060091
92 return float4(1,2,3,4);
93}
94
95// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
96#define MATFNS() \
97 countbits(inF0); \
98 D3DCOLORtoUBYTE4(inF0); \
99 cross(inF0, inF1); \
100 f16tof32(inF0); \
101 firstbithigh(inF0); \
102 firstbitlow(inF0); \
LoopDawg643fcb52016-06-03 10:53:28 -0600103 reversebits(inF0); \
104 length(inF0); \
105 noise(inF0); \
106 normalize(inF0); \
107 reflect(inF0, inF1); \
108 refract(inF0, inF1, 1.0); \
109 reversebits(inF0); \
110
111
112// TODO: turn on non-square matrix tests when protos are available.
113
LoopDawge903ab52016-06-30 14:13:03 -0600114float2x2 PixelShaderFunction2x2(float2x2 inF0, float2x2 inF1, float2x2 inF2)
LoopDawg643fcb52016-06-03 10:53:28 -0600115{
116 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
117 MATFNS()
118
119 return float2x2(2,2,2,2);
120}
121
LoopDawge903ab52016-06-30 14:13:03 -0600122float3x3 PixelShaderFunction3x3(float3x3 inF0, float3x3 inF1, float3x3 inF2)
LoopDawg643fcb52016-06-03 10:53:28 -0600123{
124 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
125 MATFNS()
126
127 return float3x3(3,3,3,3,3,3,3,3,3);
128}
129
LoopDawge903ab52016-06-30 14:13:03 -0600130float4x4 PixelShaderFunction4x4(float4x4 inF0, float4x4 inF1, float4x4 inF2)
LoopDawg643fcb52016-06-03 10:53:28 -0600131{
132 // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without.
133 MATFNS()
134
135 return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4);
136}