• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1SamplerState       g_sSamp : register(s0);
2
3uniform Texture1D <float4> g_tTex1df4 : register(t0);
4Texture1D <int4>   g_tTex1di4;
5Texture1D <uint4>  g_tTex1du4;
6
7Texture2D <float4> g_tTex2df4;
8Texture2D <int4>   g_tTex2di4;
9Texture2D <uint4>  g_tTex2du4;
10
11Texture3D <float4> g_tTex3df4;
12Texture3D <int4>   g_tTex3di4;
13Texture3D <uint4>  g_tTex3du4;
14
15TextureCube <float4> g_tTexcdf4;
16TextureCube <int4>   g_tTexcdi4;
17TextureCube <uint4>  g_tTexcdu4;
18
19Texture1DArray <float4> g_tTex1df4a;
20Texture1DArray <int4>   g_tTex1di4a;
21Texture1DArray <uint4>  g_tTex1du4a;
22
23Texture2DArray <float4> g_tTex2df4a;
24Texture2DArray <int4>   g_tTex2di4a;
25Texture2DArray <uint4>  g_tTex2du4a;
26
27TextureCubeArray <float4> g_tTexcdf4a;
28TextureCubeArray <int4>   g_tTexcdi4a;
29TextureCubeArray <uint4>  g_tTexcdu4a;
30
31Texture2DMS <float4> g_tTex2dmsf4;
32Texture2DMS <int4>   g_tTex2dmsi4;
33Texture2DMS <uint4>  g_tTex2dmsu4;
34
35Texture2DMSArray <float4> g_tTex2dmsf4a;
36Texture2DMSArray <int4>   g_tTex2dmsi4a;
37Texture2DMSArray <uint4>  g_tTex2dmsu4a;
38
39struct PS_OUTPUT
40{
41    float4 Color : SV_Target0;
42    float  Depth : SV_Depth;
43};
44
45PS_OUTPUT main()
46{
47   PS_OUTPUT psout;
48
49   uint MipLevel;
50   uint WidthU;
51   uint HeightU;
52   uint ElementsU;
53   uint DepthU;
54   uint NumberOfLevelsU;
55   uint NumberOfSamplesU;
56
57   float WidthF;
58   float HeightF;
59   float ElementsF;
60   float DepthF;
61   float NumberOfLevelsF;
62   float NumberOfSamplesF;
63
64   // 1D, float tx, uint params
65   g_tTex1df4 . GetDimensions(WidthU);
66   g_tTex1df4 . GetDimensions(6, WidthU, NumberOfLevelsU);
67
68   // 1D, int, uint params
69   g_tTex1di4 . GetDimensions(WidthU);
70   g_tTex1di4 . GetDimensions(6, WidthU, NumberOfLevelsU);
71
72   // 1D, uint, uint params
73   g_tTex1du4 . GetDimensions(WidthU);
74   g_tTex1du4 . GetDimensions(6, WidthU, NumberOfLevelsU);
75
76   // 1DArray, float tx, uint params
77   g_tTex1df4a . GetDimensions(WidthU, ElementsU);
78   g_tTex1df4a . GetDimensions(6, WidthU, ElementsU, NumberOfLevelsU);
79
80   // 1DArray, int, uint params
81   g_tTex1di4a . GetDimensions(WidthU, ElementsU);
82   g_tTex1di4a . GetDimensions(6, WidthU, ElementsU, NumberOfLevelsU);
83
84   // 1DArray, uint, uint params
85   g_tTex1du4a . GetDimensions(WidthU, ElementsU);
86   g_tTex1du4a . GetDimensions(6, WidthU, ElementsU, NumberOfLevelsU);
87
88   // 2D, float tx, uint params
89   g_tTex2df4 . GetDimensions(WidthU, HeightU);
90   g_tTex2df4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU);
91
92   // 2D, int, uint params
93   g_tTex2di4 . GetDimensions(WidthU, HeightU);
94   g_tTex2di4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU);
95
96   // 2D, uint, uint params
97   g_tTex2du4 . GetDimensions(WidthU, HeightU);
98   g_tTex2du4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU);
99
100   // 2Darray, float tx, uint params
101   g_tTex2df4a . GetDimensions(WidthU, HeightU, ElementsU);
102   g_tTex2df4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU);
103
104   // 2Darray, int, uint params
105   g_tTex2di4a . GetDimensions(WidthU, HeightU, ElementsU);
106   g_tTex2di4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU);
107
108   // 2Darray, uint, uint params
109   g_tTex2du4a . GetDimensions(WidthU, HeightU, ElementsU);
110   g_tTex2du4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU);
111
112   // 3D, float tx, uint params
113   g_tTex3df4 . GetDimensions(WidthU, HeightU, DepthU);
114   g_tTex3df4 . GetDimensions(6, WidthU, HeightU, DepthU, NumberOfLevelsU);
115
116   // 3D, int, uint params
117   g_tTex3di4 . GetDimensions(WidthU, HeightU, DepthU);
118   g_tTex3di4 . GetDimensions(6, WidthU, HeightU, DepthU, NumberOfLevelsU);
119
120   // 3D, uint, uint params
121   g_tTex3du4 . GetDimensions(WidthU, HeightU, DepthU);
122   g_tTex3du4 . GetDimensions(6, WidthU, HeightU, DepthU, NumberOfLevelsU);
123
124   // Cube, float tx, uint params
125   g_tTexcdf4 . GetDimensions(WidthU, HeightU);
126   g_tTexcdf4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU);
127
128   // Cube, int, uint params
129   g_tTexcdi4 . GetDimensions(WidthU, HeightU);
130   g_tTexcdi4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU);
131
132   // Cube, uint, uint params
133   g_tTexcdu4 . GetDimensions(WidthU, HeightU);
134   g_tTexcdu4 . GetDimensions(6, WidthU, HeightU, NumberOfLevelsU);
135
136   // Cubearray, float tx, uint params
137   g_tTexcdf4a . GetDimensions(WidthU, HeightU, ElementsU);
138   g_tTexcdf4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU);
139
140   // Cubearray, int, uint params
141   g_tTexcdi4a . GetDimensions(WidthU, HeightU, ElementsU);
142   g_tTexcdi4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU);
143
144   // Cubearray, uint, uint params
145   g_tTexcdu4a . GetDimensions(WidthU, HeightU, ElementsU);
146   g_tTexcdu4a . GetDimensions(6, WidthU, HeightU, ElementsU, NumberOfLevelsU);
147
148   // 2DMS, float tx, uint params
149   g_tTex2dmsf4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU);
150
151   // 2DMS, int tx, uint params
152   g_tTex2dmsi4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU);
153
154   // 2DMS, uint tx, uint params
155   g_tTex2dmsu4 . GetDimensions(WidthU, HeightU, NumberOfSamplesU);
156
157   // 2DMSArray, float tx, uint params
158   g_tTex2dmsf4a . GetDimensions(WidthU, HeightU, ElementsU, NumberOfSamplesU);
159
160   // 2DMSArray, int tx, uint params
161   g_tTex2dmsi4a . GetDimensions(WidthU, HeightU, ElementsU, NumberOfSamplesU);
162
163   // 2DMSArray, uint tx, uint params
164   g_tTex2dmsu4a . GetDimensions(WidthU, HeightU, ElementsU, NumberOfSamplesU);
165
166   // TODO: ***************************************************
167   // Change this to 1 to enable float overloads when the HLSL
168   // function overload resolution is fixed.
169#define OVERLOAD_FIX 0
170
171   // TODO: enable when function overload resolution rules are fixed
172#if OVERLOAD_FIX
173   // 1D, float tx, float params
174   g_tTex1df4 . GetDimensions(WidthF);
175   g_tTex1df4 . GetDimensions(6, WidthF, NumberOfLevelsF);
176
177   // 1D, int, float params
178   g_tTex1di4 . GetDimensions(WidthF);
179   g_tTex1di4 . GetDimensions(6, WidthF, NumberOfLevelsF);
180
181   // 1D, uint, float params
182   g_tTex1du4 . GetDimensions(WidthF);
183   g_tTex1du4 . GetDimensions(6, WidthF, NumberOfLevelsF);
184
185   // 1DArray, float tx, float params
186   g_tTex1df4a . GetDimensions(WidthF, ElementsF);
187   g_tTex1df4a . GetDimensions(6, WidthF, ElementsF, NumberOfLevelsF);
188
189   // 1DArray, int, float params
190   g_tTex1di4a . GetDimensions(WidthF, ElementsF);
191   g_tTex1di4a . GetDimensions(6, WidthF, ElementsF, NumberOfLevelsF);
192
193   // 1DArray, uint, float params
194   g_tTex1du4a . GetDimensions(WidthF, ElementsF);
195   g_tTex1du4a . GetDimensions(6, WidthF, ElementsF, NumberOfLevelsF);
196
197   // 2D, float tx, float params
198   g_tTex2df4 . GetDimensions(WidthF, HeightF);
199   g_tTex2df4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF);
200
201   // 2D, int, float params
202   g_tTex2di4 . GetDimensions(WidthF, HeightF);
203   g_tTex2di4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF);
204
205   // 2D, uint, float params
206   g_tTex2du4 . GetDimensions(WidthF, HeightF);
207   g_tTex2du4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF);
208
209   // 2Darray, float tx, float params
210   g_tTex2df4a . GetDimensions(WidthF, HeightF, ElementsF);
211   g_tTex2df4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF);
212
213   // 2Darray, int, float params
214   g_tTex2di4a . GetDimensions(WidthF, HeightF, ElementsF);
215   g_tTex2di4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF);
216
217   // 2Darray, uint, float params
218   g_tTex2du4a . GetDimensions(WidthF, HeightF, ElementsF);
219   g_tTex2du4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF);
220
221   // 3D, float tx, float params
222   g_tTex3df4 . GetDimensions(WidthF, HeightF, DepthF);
223   g_tTex3df4 . GetDimensions(6, WidthF, HeightF, DepthF, NumberOfLevelsF);
224
225   // 3D, int, float params
226   g_tTex3di4 . GetDimensions(WidthF, HeightF, DepthF);
227   g_tTex3di4 . GetDimensions(6, WidthF, HeightF, DepthF, NumberOfLevelsF);
228
229   // 3D, uint, float params
230   g_tTex3du4 . GetDimensions(WidthF, HeightF, DepthF);
231   g_tTex3du4 . GetDimensions(6, WidthF, HeightF, DepthF, NumberOfLevelsF);
232
233   // Cube, float tx, float params
234   g_tTexcdf4 . GetDimensions(WidthF, HeightF);
235   g_tTexcdf4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF);
236
237   // Cube, int, float params
238   g_tTexcdi4 . GetDimensions(WidthF, HeightF);
239   g_tTexcdi4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF);
240
241   // Cube, uint, float params
242   g_tTexcdu4 . GetDimensions(WidthF, HeightF);
243   g_tTexcdu4 . GetDimensions(6, WidthF, HeightF, NumberOfLevelsF);
244
245   // Cubearray, float tx, float params
246   g_tTexcdf4a . GetDimensions(WidthF, HeightF, ElementsF);
247   g_tTexcdf4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF);
248
249   // Cubearray, int, float params
250   g_tTexcdi4a . GetDimensions(WidthF, HeightF, ElementsF);
251   g_tTexcdi4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF);
252
253   // Cubearray, uint, float params
254   g_tTexcdu4a . GetDimensions(WidthF, HeightF, ElementsF);
255   g_tTexcdu4a . GetDimensions(6, WidthF, HeightF, ElementsF, NumberOfLevelsF);
256
257   // 2DMS, float tx, uint params
258   g_tTex2dmsf4 . GetDimensions(WidthF, HeightF, NumberOfSamplesF);
259
260   // 2DMS, int tx, uint params
261   g_tTex2dmsi4 . GetDimensions(WidthF, HeightF, NumberOfSamplesF);
262
263   // 2DMS, uint tx, uint params
264   g_tTex2dmsu4 . GetDimensions(WidthF, HeightF, NumberOfSamplesF);
265
266   // 2DMSArray, float tx, uint params
267   g_tTex2dmsf4a . GetDimensions(WidthF, HeightF, ElementsF, NumberOfSamplesF);
268
269   // 2DMSArray, int tx, uint params
270   g_tTex2dmsi4a . GetDimensions(WidthF, HeightF, ElementsF, NumberOfSamplesF);
271
272   // 2DMSArray, uint tx, uint params
273   g_tTex2dmsu4a . GetDimensions(WidthF, HeightF, ElementsF, NumberOfSamplesF);
274#endif // OVERLOAD_FIX
275
276   psout.Color = 1.0;
277   psout.Depth = 1.0;
278
279   return psout;
280}
281