2 * Copyright 2010 Christoph Bumiller
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 #include "nvc0_screen.h"
24 #include "nvc0_3d.xml.h"
25 #include "nv50/nv50_defs.xml.h"
26 #include "nv50/nv50_texture.xml.h"
27 #include "pipe/p_defines.h"
29 #define A_(cr, cg, cb, ca, t0, t1, t2, t3, sz, r) \
30 (NV50_TIC_MAP_##cr << NV50_TIC_0_MAPR__SHIFT) | \
31 (NV50_TIC_TYPE_##t0 << NV50_TIC_0_TYPE0__SHIFT) | \
32 (NV50_TIC_MAP_##cg << NV50_TIC_0_MAPG__SHIFT) | \
33 (NV50_TIC_TYPE_##t1 << NV50_TIC_0_TYPE1__SHIFT) | \
34 (NV50_TIC_MAP_##cb << NV50_TIC_0_MAPB__SHIFT) | \
35 (NV50_TIC_TYPE_##t2 << NV50_TIC_0_TYPE2__SHIFT) | \
36 (NV50_TIC_MAP_##ca << NV50_TIC_0_MAPA__SHIFT) | \
37 (NV50_TIC_TYPE_##t3 << NV50_TIC_0_TYPE3__SHIFT) | \
38 NV50_TIC_0_FMT_##sz, \
39 NVC0_3D_VERTEX_ATTRIB_FORMAT_SIZE_##sz | \
40 NVC0_3D_VERTEX_ATTRIB_FORMAT_TYPE_##t0 | \
43 #define B_(cr, cg, cb, ca, t0, t1, t2, t3, sz, r) \
44 (NV50_TIC_MAP_##cr << NV50_TIC_0_MAPR__SHIFT) | \
45 (NV50_TIC_TYPE_##t0 << NV50_TIC_0_TYPE0__SHIFT) | \
46 (NV50_TIC_MAP_##cg << NV50_TIC_0_MAPG__SHIFT) | \
47 (NV50_TIC_TYPE_##t1 << NV50_TIC_0_TYPE1__SHIFT) | \
48 (NV50_TIC_MAP_##cb << NV50_TIC_0_MAPB__SHIFT) | \
49 (NV50_TIC_TYPE_##t2 << NV50_TIC_0_TYPE2__SHIFT) | \
50 (NV50_TIC_MAP_##ca << NV50_TIC_0_MAPA__SHIFT) | \
51 (NV50_TIC_TYPE_##t3 << NV50_TIC_0_TYPE3__SHIFT) | \
52 NV50_TIC_0_FMT_##sz, 0
54 #define VERTEX_BUFFER PIPE_BIND_VERTEX_BUFFER
55 #define SAMPLER_VIEW PIPE_BIND_SAMPLER_VIEW
56 #define RENDER_TARGET PIPE_BIND_RENDER_TARGET
57 #define DEPTH_STENCIL PIPE_BIND_DEPTH_STENCIL
58 #define SCANOUT PIPE_BIND_SCANOUT
60 /* for vertex buffers: */
61 #define NV50_TIC_0_FMT_8_8_8 NV50_TIC_0_FMT_8_8_8_8
62 #define NV50_TIC_0_FMT_16_16_16 NV50_TIC_0_FMT_16_16_16_16
63 #define NV50_TIC_0_FMT_32_32_32 NV50_TIC_0_FMT_32_32_32_32
65 const struct nvc0_format nvc0_format_table
[PIPE_FORMAT_COUNT
] =
69 [PIPE_FORMAT_B8G8R8A8_UNORM
] = { NV50_SURFACE_FORMAT_A8R8G8B8_UNORM
,
70 A_(C2
, C1
, C0
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8_8_8
, 1),
71 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
| SCANOUT
},
73 [PIPE_FORMAT_B8G8R8X8_UNORM
] = { NV50_SURFACE_FORMAT_X8R8G8B8_UNORM
,
74 A_(C2
, C1
, C0
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8_8_8
, 1),
75 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
| SCANOUT
},
77 [PIPE_FORMAT_B8G8R8A8_SRGB
] = { NV50_SURFACE_FORMAT_A8R8G8B8_SRGB
,
78 A_(C2
, C1
, C0
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8_8_8
, 1),
79 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
81 [PIPE_FORMAT_B8G8R8X8_SRGB
] = { NV50_SURFACE_FORMAT_X8R8G8B8_SRGB
,
82 A_(C2
, C1
, C0
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8_8_8
, 1),
83 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
85 [PIPE_FORMAT_B5G6R5_UNORM
] = { NV50_SURFACE_FORMAT_R5G6B5_UNORM
,
86 B_(C2
, C1
, C0
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 5_6_5
, 1),
87 SAMPLER_VIEW
| RENDER_TARGET
| SCANOUT
},
89 [PIPE_FORMAT_B5G5R5A1_UNORM
] = { NV50_SURFACE_FORMAT_A1R5G5B5_UNORM
,
90 B_(C2
, C1
, C0
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 1_5_5_5
, 1),
91 SAMPLER_VIEW
| RENDER_TARGET
| SCANOUT
},
93 [PIPE_FORMAT_B5G5R5X1_UNORM
] = { 0,
94 B_(C2
, C1
, C0
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 1_5_5_5
, 1),
95 SAMPLER_VIEW
| SCANOUT
},
97 [PIPE_FORMAT_B4G4R4A4_UNORM
] = { 0,
98 B_(C2
, C1
, C0
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 4_4_4_4
, 1),
101 [PIPE_FORMAT_B4G4R4X4_UNORM
] = { 0,
102 B_(C2
, C1
, C0
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 4_4_4_4
, 1),
105 [PIPE_FORMAT_R10G10B10A2_UNORM
] = { NV50_SURFACE_FORMAT_A2B10G10R10_UNORM
,
106 A_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 2_10_10_10
, 0),
107 SAMPLER_VIEW
| RENDER_TARGET
| VERTEX_BUFFER
| SCANOUT
},
109 [PIPE_FORMAT_B10G10R10A2_UNORM
] = { NV50_SURFACE_FORMAT_A2R10G10B10_UNORM
,
110 A_(C2
, C1
, C0
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 2_10_10_10
, 1),
111 SAMPLER_VIEW
| RENDER_TARGET
| VERTEX_BUFFER
},
113 /* DEPTH/STENCIL FORMATS */
115 [PIPE_FORMAT_Z16_UNORM
] = { NV50_ZETA_FORMAT_Z16_UNORM
,
116 B_(C0
, C0
, C0
, ONE_FLOAT
, UNORM
, UINT
, UINT
, UINT
, Z16
, 0),
117 SAMPLER_VIEW
| DEPTH_STENCIL
},
119 [PIPE_FORMAT_Z24_UNORM_S8_USCALED
] = { NV50_ZETA_FORMAT_S8Z24_UNORM
,
120 B_(C0
, C0
, C0
, ONE_FLOAT
, UNORM
, UINT
, UINT
, UINT
, S8Z24
, 0),
121 SAMPLER_VIEW
| DEPTH_STENCIL
},
123 [PIPE_FORMAT_Z24X8_UNORM
] = { NV50_ZETA_FORMAT_X8Z24_UNORM
,
124 B_(C0
, C0
, C0
, ONE_FLOAT
, UNORM
, UINT
, UINT
, UINT
, X8Z24
, 0),
125 SAMPLER_VIEW
| DEPTH_STENCIL
},
127 [PIPE_FORMAT_S8_USCALED_Z24_UNORM
] = { NV50_ZETA_FORMAT_Z24S8_UNORM
,
128 B_(C1
, C1
, C1
, ONE_FLOAT
, UINT
, UNORM
, UINT
, UINT
, Z24S8
, 0),
129 SAMPLER_VIEW
| DEPTH_STENCIL
},
131 [PIPE_FORMAT_Z32_FLOAT
] = { NV50_ZETA_FORMAT_Z32_FLOAT
,
132 B_(C0
, C0
, C0
, ONE_FLOAT
, FLOAT
, UINT
, UINT
, UINT
, Z32
, 0),
133 SAMPLER_VIEW
| DEPTH_STENCIL
},
135 [PIPE_FORMAT_Z32_FLOAT_S8X24_USCALED
] = {
136 NV50_ZETA_FORMAT_Z32_FLOAT_X24S8_UNORM
,
137 B_(C0
, C0
, C0
, ONE_FLOAT
, FLOAT
, UINT
, UINT
, UINT
, X24S8Z32
, 0),
138 SAMPLER_VIEW
| DEPTH_STENCIL
},
140 /* LUMINANCE, ALPHA, INTENSITY */
142 [PIPE_FORMAT_L8_UNORM
] = { NV50_SURFACE_FORMAT_R8_UNORM
,
143 A_(C0
, C0
, C0
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 8, 0),
144 SAMPLER_VIEW
| RENDER_TARGET
},
146 [PIPE_FORMAT_L8_SRGB
] = { NV50_SURFACE_FORMAT_R8_UNORM
,
147 A_(C0
, C0
, C0
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 8, 0),
148 SAMPLER_VIEW
| RENDER_TARGET
},
150 [PIPE_FORMAT_L16_SNORM
] = { NV50_SURFACE_FORMAT_R16_SNORM
,
151 B_(C0
, C0
, C0
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 16, 0),
152 SAMPLER_VIEW
| RENDER_TARGET
},
154 [PIPE_FORMAT_L16_FLOAT
] = { NV50_SURFACE_FORMAT_R16_FLOAT
,
155 B_(C0
, C0
, C0
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 16, 0),
156 SAMPLER_VIEW
| RENDER_TARGET
},
158 [PIPE_FORMAT_L32_FLOAT
] = { NV50_SURFACE_FORMAT_R32_FLOAT
,
159 B_(C0
, C0
, C0
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32, 0),
160 SAMPLER_VIEW
| RENDER_TARGET
},
162 [PIPE_FORMAT_I8_UNORM
] = { 0,
163 A_(C0
, C0
, C0
, C0
, UNORM
, UNORM
, UNORM
, UNORM
, 8, 0),
166 [PIPE_FORMAT_I16_UNORM
] = { 0,
167 A_(C0
, C0
, C0
, C0
, UNORM
, UNORM
, UNORM
, UNORM
, 16, 0),
170 [PIPE_FORMAT_I16_SNORM
] = { 0,
171 B_(C0
, C0
, C0
, C0
, SNORM
, SNORM
, SNORM
, SNORM
, 16, 0),
174 [PIPE_FORMAT_I16_FLOAT
] = { 0,
175 B_(C0
, C0
, C0
, C0
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 16, 0),
178 [PIPE_FORMAT_I32_FLOAT
] = { 0,
179 B_(C0
, C0
, C0
, C0
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32, 0),
182 [PIPE_FORMAT_A8_UNORM
] = { NV50_SURFACE_FORMAT_A8_UNORM
,
183 A_(ZERO
, ZERO
, ZERO
, C0
, UNORM
, UNORM
, UNORM
, UNORM
, 8, 0),
184 SAMPLER_VIEW
| RENDER_TARGET
},
186 [PIPE_FORMAT_A8_SNORM
] = { 0,
187 A_(ZERO
, ZERO
, ZERO
, C0
, SNORM
, SNORM
, SNORM
, SNORM
, 8, 0),
190 [PIPE_FORMAT_A16_UNORM
] = { 0,
191 A_(ZERO
, ZERO
, ZERO
, C0
, UNORM
, UNORM
, UNORM
, UNORM
, 16, 0),
194 [PIPE_FORMAT_A16_SNORM
] = { 0,
195 A_(ZERO
, ZERO
, ZERO
, C0
, SNORM
, SNORM
, SNORM
, SNORM
, 16, 0),
198 [PIPE_FORMAT_A16_FLOAT
] = { 0,
199 B_(ZERO
, ZERO
, ZERO
, C0
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 16, 0),
202 [PIPE_FORMAT_A32_FLOAT
] = { 0,
203 B_(ZERO
, ZERO
, ZERO
, C0
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32, 0),
206 [PIPE_FORMAT_L8A8_UNORM
] = { 0,
207 A_(C0
, C0
, C0
, C1
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8
, 0),
210 [PIPE_FORMAT_L8A8_SRGB
] = { 0,
211 A_(C0
, C0
, C0
, C1
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8
, 0),
214 [PIPE_FORMAT_L16A16_UNORM
] = { 0,
215 A_(C0
, C0
, C0
, C1
, UNORM
, UNORM
, UNORM
, UNORM
, 16_16
, 0),
218 [PIPE_FORMAT_L16A16_SNORM
] = { 0,
219 A_(C0
, C0
, C0
, C1
, SNORM
, SNORM
, SNORM
, SNORM
, 16_16
, 0),
222 [PIPE_FORMAT_L16A16_FLOAT
] = { 0,
223 B_(C0
, C0
, C0
, C1
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 16_16
, 0),
226 [PIPE_FORMAT_L32A32_FLOAT
] = { 0,
227 B_(C0
, C0
, C0
, C1
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32_32
, 0),
230 [PIPE_FORMAT_L4A4_UNORM
] = { 0,
231 B_(C0
, C0
, C0
, C1
, UNORM
, UNORM
, UNORM
, UNORM
, 4_4
, 0),
236 [PIPE_FORMAT_DXT1_RGB
] = { 0,
237 B_(C0
, C1
, C2
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, DXT1
, 0),
240 [PIPE_FORMAT_DXT1_RGBA
] = { 0,
241 B_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, DXT1
, 0),
244 [PIPE_FORMAT_DXT3_RGBA
] = { 0,
245 B_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, DXT3
, 0),
248 [PIPE_FORMAT_DXT5_RGBA
] = { 0,
249 B_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, DXT5
, 0),
252 [PIPE_FORMAT_DXT1_SRGB
] = { 0,
253 B_(C0
, C1
, C2
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, DXT1
, 0),
256 [PIPE_FORMAT_DXT1_SRGBA
] = { 0,
257 B_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, DXT1
, 0),
260 [PIPE_FORMAT_DXT3_SRGBA
] = { 0,
261 B_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, DXT3
, 0),
264 [PIPE_FORMAT_DXT5_SRGBA
] = { 0,
265 B_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, DXT5
, 0),
268 [PIPE_FORMAT_RGTC1_UNORM
] = { 0,
269 B_(C0
, ZERO
, ZERO
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, RGTC1
, 0),
272 [PIPE_FORMAT_RGTC1_SNORM
] = { 0,
273 B_(C0
, ZERO
, ZERO
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, RGTC1
, 0),
276 [PIPE_FORMAT_RGTC2_UNORM
] = { 0,
277 B_(C0
, C1
, ZERO
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, RGTC2
, 0),
280 [PIPE_FORMAT_RGTC2_SNORM
] = { 0,
281 B_(C0
, C1
, ZERO
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, RGTC2
, 0),
286 [PIPE_FORMAT_R16G16B16A16_FLOAT
] = { NV50_SURFACE_FORMAT_R16G16B16A16_FLOAT
,
287 A_(C0
, C1
, C2
, C3
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 16_16_16_16
, 0),
288 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
290 [PIPE_FORMAT_R16G16B16_FLOAT
] = { NV50_SURFACE_FORMAT_R16G16B16X16_FLOAT
,
291 A_(C0
, C1
, C2
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 16_16_16
, 0),
294 [PIPE_FORMAT_R16G16_FLOAT
] = { NV50_SURFACE_FORMAT_R16G16_FLOAT
,
295 A_(C0
, C1
, ZERO
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 16_16
, 0),
296 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
298 [PIPE_FORMAT_R16_FLOAT
] = { NV50_SURFACE_FORMAT_R16_FLOAT
,
299 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 16, 0),
300 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
304 [PIPE_FORMAT_R32G32B32A32_FLOAT
] = { NV50_SURFACE_FORMAT_R32G32B32A32_FLOAT
,
305 A_(C0
, C1
, C2
, C3
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32_32_32_32
, 0),
306 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
308 [PIPE_FORMAT_R32G32B32_FLOAT
] = { NV50_SURFACE_FORMAT_R32G32B32X32_FLOAT
,
309 A_(C0
, C1
, C2
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32_32_32
, 0),
312 [PIPE_FORMAT_R32G32_FLOAT
] = { NV50_SURFACE_FORMAT_R32G32_FLOAT
,
313 A_(C0
, C1
, ZERO
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32_32
, 0),
314 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
316 [PIPE_FORMAT_R32_FLOAT
] = { NV50_SURFACE_FORMAT_R32_FLOAT
,
317 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32, 0),
318 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
322 [PIPE_FORMAT_R11G11B10_FLOAT
] = { NV50_SURFACE_FORMAT_B10G11R11_FLOAT
,
323 B_(C0
, C1
, C2
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 10_11_11
, 0),
324 SAMPLER_VIEW
| RENDER_TARGET
| VERTEX_BUFFER
},
326 [PIPE_FORMAT_R9G9B9E5_FLOAT
] = { 0,
327 B_(C0
, C1
, C2
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, E5_9_9_9
, 0),
332 [PIPE_FORMAT_R32G32B32A32_SNORM
] = { 0,
333 A_(C0
, C1
, C2
, C3
, SNORM
, SNORM
, SNORM
, SNORM
, 32_32_32_32
, 0),
334 VERTEX_BUFFER
| SAMPLER_VIEW
},
336 [PIPE_FORMAT_R32G32B32_SNORM
] = { 0,
337 A_(C0
, C1
, C2
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 32_32_32
, 0),
340 [PIPE_FORMAT_R32G32_SNORM
] = { 0,
341 A_(C0
, C1
, ZERO
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 32_32
, 0),
342 VERTEX_BUFFER
| SAMPLER_VIEW
},
344 [PIPE_FORMAT_R32_SNORM
] = { 0,
345 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 32, 0),
346 VERTEX_BUFFER
| SAMPLER_VIEW
},
350 [PIPE_FORMAT_R32G32B32A32_UNORM
] = { 0,
351 A_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 32_32_32_32
, 0),
352 VERTEX_BUFFER
| SAMPLER_VIEW
},
354 [PIPE_FORMAT_R32G32B32_UNORM
] = { 0,
355 A_(C0
, C1
, C2
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 32_32_32
, 0),
358 [PIPE_FORMAT_R32G32_UNORM
] = { 0,
359 A_(C0
, C1
, ZERO
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 32_32
, 0),
360 VERTEX_BUFFER
| SAMPLER_VIEW
},
362 [PIPE_FORMAT_R32_UNORM
] = { 0,
363 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 32, 0),
364 VERTEX_BUFFER
| SAMPLER_VIEW
},
368 [PIPE_FORMAT_R16G16B16A16_SNORM
] = { NV50_SURFACE_FORMAT_R16G16B16A16_SNORM
,
369 A_(C0
, C1
, C2
, C3
, SNORM
, SNORM
, SNORM
, SNORM
, 16_16_16_16
, 0),
370 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
372 [PIPE_FORMAT_R16G16B16_SNORM
] = { 0,
373 A_(C0
, C1
, C2
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 16_16_16
, 0),
376 [PIPE_FORMAT_R16G16_SNORM
] = { NV50_SURFACE_FORMAT_R16G16_SNORM
,
377 A_(C0
, C1
, ZERO
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 16_16
, 0),
378 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
380 [PIPE_FORMAT_R16_SNORM
] = { NV50_SURFACE_FORMAT_R16_SNORM
,
381 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 16, 0),
382 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
386 [PIPE_FORMAT_R16G16B16A16_UNORM
] = { NV50_SURFACE_FORMAT_R16G16B16A16_UNORM
,
387 A_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 16_16_16_16
, 0),
388 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
390 [PIPE_FORMAT_R16G16B16_UNORM
] = { 0,
391 A_(C0
, C1
, C2
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 16_16_16
, 0),
394 [PIPE_FORMAT_R16G16_UNORM
] = { NV50_SURFACE_FORMAT_R16G16_UNORM
,
395 A_(C0
, C1
, ZERO
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 16_16
, 0),
396 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
398 [PIPE_FORMAT_R16_UNORM
] = { NV50_SURFACE_FORMAT_R16_UNORM
,
399 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 16, 0),
400 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
404 [PIPE_FORMAT_R8G8B8A8_SNORM
] = { NV50_SURFACE_FORMAT_A8B8G8R8_SNORM
,
405 A_(C0
, C1
, C2
, C3
, SNORM
, SNORM
, SNORM
, SNORM
, 8_8_8_8
, 0),
406 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
408 [PIPE_FORMAT_R8G8B8_SNORM
] = { 0,
409 A_(C0
, C1
, C2
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 8_8_8
, 0),
412 [PIPE_FORMAT_R8G8_SNORM
] = { NV50_SURFACE_FORMAT_R8G8_SNORM
,
413 A_(C0
, C1
, ZERO
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 8_8
, 0),
414 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
416 [PIPE_FORMAT_R8_SNORM
] = { NV50_SURFACE_FORMAT_R8_SNORM
,
417 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, SNORM
, SNORM
, SNORM
, SNORM
, 8, 0),
418 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
422 [PIPE_FORMAT_R8G8B8A8_UNORM
] = { NV50_SURFACE_FORMAT_A8B8G8R8_UNORM
,
423 A_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8_8_8
, 0),
424 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
426 [PIPE_FORMAT_R8G8B8A8_SRGB
] = { NV50_SURFACE_FORMAT_A8B8G8R8_SRGB
,
427 A_(C0
, C1
, C2
, C3
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8_8_8
, 0),
428 SAMPLER_VIEW
| RENDER_TARGET
},
430 [PIPE_FORMAT_R8G8B8X8_UNORM
] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM
,
431 B_(C0
, C1
, C2
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8_8_8
, 0),
432 SAMPLER_VIEW
| RENDER_TARGET
},
434 [PIPE_FORMAT_R8G8B8_UNORM
] = { NV50_SURFACE_FORMAT_X8B8G8R8_UNORM
,
435 A_(C0
, C1
, C2
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8_8
, 0),
438 [PIPE_FORMAT_R8G8_UNORM
] = { NV50_SURFACE_FORMAT_R8G8_UNORM
,
439 A_(C0
, C1
, ZERO
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8
, 0),
440 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
442 [PIPE_FORMAT_R8_UNORM
] = { NV50_SURFACE_FORMAT_R8_UNORM
,
443 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, 8, 0),
444 VERTEX_BUFFER
| SAMPLER_VIEW
| RENDER_TARGET
},
446 /* SSCALED 32 (not integer, converted to float on fetch !) */
448 [PIPE_FORMAT_R32G32B32A32_SSCALED
] = { 0,
449 A_(C0
, C1
, C2
, C3
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 32_32_32_32
, 0),
452 [PIPE_FORMAT_R32G32B32_SSCALED
] = { 0,
453 A_(C0
, C1
, C2
, ONE_FLOAT
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 32_32_32
, 0),
456 [PIPE_FORMAT_R32G32_SSCALED
] = { 0,
457 A_(C0
, C1
, ZERO
, ONE_FLOAT
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 32_32
, 0),
460 [PIPE_FORMAT_R32_SSCALED
] = { 0,
461 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 32, 0),
466 [PIPE_FORMAT_R32G32B32A32_USCALED
] = { 0,
467 A_(C0
, C1
, C2
, C3
, USCALED
, USCALED
, USCALED
, USCALED
, 32_32_32_32
, 0),
470 [PIPE_FORMAT_R32G32B32_USCALED
] = { 0,
471 A_(C0
, C1
, C2
, ONE_FLOAT
, USCALED
, USCALED
, USCALED
, USCALED
, 32_32_32
, 0),
474 [PIPE_FORMAT_R32G32_USCALED
] = { 0,
475 A_(C0
, C1
, ZERO
, ONE_FLOAT
, USCALED
, USCALED
, USCALED
, USCALED
, 32_32
, 0),
478 [PIPE_FORMAT_R32_USCALED
] = { 0,
479 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, USCALED
, USCALED
, USCALED
, USCALED
, 32, 0),
484 [PIPE_FORMAT_R16G16B16A16_SSCALED
] = { 0,
485 A_(C0
, C1
, C2
, C3
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 16_16_16_16
, 0),
488 [PIPE_FORMAT_R16G16B16_SSCALED
] = { 0,
489 A_(C0
, C1
, C2
, ONE_FLOAT
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 16_16_16
, 0),
492 [PIPE_FORMAT_R16G16_SSCALED
] = { 0,
493 A_(C0
, C1
, ZERO
, ONE_FLOAT
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 16_16
, 0),
496 [PIPE_FORMAT_R16_SSCALED
] = { 0,
497 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 16, 0),
502 [PIPE_FORMAT_R16G16B16A16_USCALED
] = { 0,
503 A_(C0
, C1
, C2
, C3
, USCALED
, USCALED
, USCALED
, USCALED
, 16_16_16_16
, 0),
506 [PIPE_FORMAT_R16G16B16_USCALED
] = { 0,
507 A_(C0
, C1
, C2
, ONE_FLOAT
, USCALED
, USCALED
, USCALED
, USCALED
, 16_16_16
, 0),
510 [PIPE_FORMAT_R16G16_USCALED
] = { 0,
511 A_(C0
, C1
, ZERO
, ONE_FLOAT
, USCALED
, USCALED
, USCALED
, USCALED
, 16_16
, 0),
514 [PIPE_FORMAT_R16_USCALED
] = { 0,
515 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, USCALED
, USCALED
, USCALED
, USCALED
, 16, 0),
520 [PIPE_FORMAT_R8G8B8A8_SSCALED
] = { 0,
521 A_(C0
, C1
, C2
, C3
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 8_8_8_8
, 0),
524 [PIPE_FORMAT_R8G8B8_SSCALED
] = { 0,
525 A_(C0
, C1
, C2
, ONE_FLOAT
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 8_8_8
, 0),
528 [PIPE_FORMAT_R8G8_SSCALED
] = { 0,
529 A_(C0
, C1
, ZERO
, ONE_FLOAT
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 8_8
, 0),
532 [PIPE_FORMAT_R8_SSCALED
] = { 0,
533 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, SSCALED
, SSCALED
, SSCALED
, SSCALED
, 8, 0),
538 [PIPE_FORMAT_R8G8B8A8_USCALED
] = { 0,
539 A_(C0
, C1
, C2
, C3
, USCALED
, USCALED
, USCALED
, USCALED
, 8_8_8_8
, 0),
542 [PIPE_FORMAT_R8G8B8_USCALED
] = { 0,
543 A_(C0
, C1
, C2
, ONE_FLOAT
, USCALED
, USCALED
, USCALED
, USCALED
, 8_8_8
, 0),
546 [PIPE_FORMAT_R8G8_USCALED
] = { 0,
547 A_(C0
, C1
, ZERO
, ONE_FLOAT
, USCALED
, USCALED
, USCALED
, USCALED
, 8_8
, 0),
550 [PIPE_FORMAT_R8_USCALED
] = { 0,
551 A_(C0
, ZERO
, ZERO
, ONE_FLOAT
, USCALED
, USCALED
, USCALED
, USCALED
, 8, 0),
556 [PIPE_FORMAT_R8G8_B8G8_UNORM
] = { 0,
557 B_(C0
, C1
, C2
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, C1_C2_C1_C0
, 0),
560 [PIPE_FORMAT_G8R8_G8B8_UNORM
] = { 0,
561 B_(C0
, C1
, C2
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, C2_C1_C0_C1
, 0),
564 [PIPE_FORMAT_R8SG8SB8UX8U_NORM
] = { 0,
565 B_(C0
, C1
, C2
, ONE_FLOAT
, SNORM
, SNORM
, UNORM
, UNORM
, 8_8_8_8
, 0),
568 [PIPE_FORMAT_R5SG5SB6U_NORM
] = { 0,
569 B_(C0
, C1
, C2
, ONE_FLOAT
, SNORM
, SNORM
, UNORM
, UNORM
, 6_5_5
, 0),
572 [PIPE_FORMAT_R1_UNORM
] = { 0,
573 B_(C0
, ZERO
, ZERO
, ONE_FLOAT
, UNORM
, UNORM
, UNORM
, UNORM
, BITMAP_8X8
, 0),
576 [PIPE_FORMAT_A8B8G8R8_UNORM
] = { 0,
577 B_(C3
, C2
, C1
, C0
, UNORM
, UNORM
, UNORM
, UNORM
, 8_8_8_8
, 0),
580 /* FIXED FORMATS - hw doesn't support these, convert on vbo push for now */
582 [PIPE_FORMAT_R32G32B32A32_FIXED
] = { 0,
583 B_(C0
, C1
, C2
, C3
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32_32_32_32
, 0),
586 [PIPE_FORMAT_R32G32B32_FIXED
] = { 0,
587 B_(C0
, C1
, C2
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32_32_32
, 0),
590 [PIPE_FORMAT_R32G32_FIXED
] = { 0,
591 B_(C0
, C1
, ZERO
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32_32
, 0),
594 [PIPE_FORMAT_R32_FIXED
] = { 0,
595 B_(C0
, ZERO
, ZERO
, ONE_FLOAT
, FLOAT
, FLOAT
, FLOAT
, FLOAT
, 32, 0),