revert 213 commits (to 56092) from the last month. 10 still need work to resolve...
[AROS.git] / workbench / libs / mesa / src / gallium / auxiliary / translate / translate_generic.c
blobe4e1c86833324917a2eb6ce99d71dd98acb6a871
1 /**************************************************************************
2 *
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
29 * Authors:
30 * Keith Whitwell <keith@tungstengraphics.com>
33 #include "util/u_memory.h"
34 #include "util/u_format.h"
35 #include "util/u_math.h"
36 #include "pipe/p_state.h"
37 #include "translate.h"
40 #define DRAW_DBG 0
42 typedef void (*fetch_func)(float *dst,
43 const uint8_t *src,
44 unsigned i, unsigned j);
45 typedef void (*emit_func)(const float *attrib, void *ptr);
49 struct translate_generic {
50 struct translate translate;
52 struct {
53 enum translate_element_type type;
55 fetch_func fetch;
56 unsigned buffer;
57 unsigned input_offset;
58 unsigned instance_divisor;
60 emit_func emit;
61 unsigned output_offset;
63 const uint8_t *input_ptr;
64 unsigned input_stride;
65 unsigned max_index;
67 /* this value is set to -1 if this is a normal element with output_format != input_format:
68 * in this case, u_format is used to do a full conversion
70 * this value is set to the format size in bytes if output_format == input_format or for 32-bit instance ids:
71 * in this case, memcpy is used to copy this amount of bytes
73 int copy_size;
75 } attrib[PIPE_MAX_ATTRIBS];
77 unsigned nr_attrib;
81 static struct translate_generic *translate_generic( struct translate *translate )
83 return (struct translate_generic *)translate;
86 /**
87 * Fetch a float[4] vertex attribute from memory, doing format/type
88 * conversion as needed.
90 * This is probably needed/dupliocated elsewhere, eg format
91 * conversion, texture sampling etc.
93 #define ATTRIB( NAME, SZ, TYPE, TO ) \
94 static void \
95 emit_##NAME(const float *attrib, void *ptr) \
96 { \
97 unsigned i; \
98 TYPE *out = (TYPE *)ptr; \
100 for (i = 0; i < SZ; i++) { \
101 out[i] = TO(attrib[i]); \
106 #define TO_64_FLOAT(x) ((double) x)
107 #define TO_32_FLOAT(x) (x)
109 #define TO_8_USCALED(x) ((unsigned char) x)
110 #define TO_16_USCALED(x) ((unsigned short) x)
111 #define TO_32_USCALED(x) ((unsigned int) x)
113 #define TO_8_SSCALED(x) ((char) x)
114 #define TO_16_SSCALED(x) ((short) x)
115 #define TO_32_SSCALED(x) ((int) x)
117 #define TO_8_UNORM(x) ((unsigned char) (x * 255.0f))
118 #define TO_16_UNORM(x) ((unsigned short) (x * 65535.0f))
119 #define TO_32_UNORM(x) ((unsigned int) (x * 4294967295.0f))
121 #define TO_8_SNORM(x) ((char) (x * 127.0f))
122 #define TO_16_SNORM(x) ((short) (x * 32767.0f))
123 #define TO_32_SNORM(x) ((int) (x * 2147483647.0f))
125 #define TO_32_FIXED(x) ((int) (x * 65536.0f))
128 ATTRIB( R64G64B64A64_FLOAT, 4, double, TO_64_FLOAT )
129 ATTRIB( R64G64B64_FLOAT, 3, double, TO_64_FLOAT )
130 ATTRIB( R64G64_FLOAT, 2, double, TO_64_FLOAT )
131 ATTRIB( R64_FLOAT, 1, double, TO_64_FLOAT )
133 ATTRIB( R32G32B32A32_FLOAT, 4, float, TO_32_FLOAT )
134 ATTRIB( R32G32B32_FLOAT, 3, float, TO_32_FLOAT )
135 ATTRIB( R32G32_FLOAT, 2, float, TO_32_FLOAT )
136 ATTRIB( R32_FLOAT, 1, float, TO_32_FLOAT )
138 ATTRIB( R32G32B32A32_USCALED, 4, unsigned, TO_32_USCALED )
139 ATTRIB( R32G32B32_USCALED, 3, unsigned, TO_32_USCALED )
140 ATTRIB( R32G32_USCALED, 2, unsigned, TO_32_USCALED )
141 ATTRIB( R32_USCALED, 1, unsigned, TO_32_USCALED )
143 ATTRIB( R32G32B32A32_SSCALED, 4, int, TO_32_SSCALED )
144 ATTRIB( R32G32B32_SSCALED, 3, int, TO_32_SSCALED )
145 ATTRIB( R32G32_SSCALED, 2, int, TO_32_SSCALED )
146 ATTRIB( R32_SSCALED, 1, int, TO_32_SSCALED )
148 ATTRIB( R32G32B32A32_UNORM, 4, unsigned, TO_32_UNORM )
149 ATTRIB( R32G32B32_UNORM, 3, unsigned, TO_32_UNORM )
150 ATTRIB( R32G32_UNORM, 2, unsigned, TO_32_UNORM )
151 ATTRIB( R32_UNORM, 1, unsigned, TO_32_UNORM )
153 ATTRIB( R32G32B32A32_SNORM, 4, int, TO_32_SNORM )
154 ATTRIB( R32G32B32_SNORM, 3, int, TO_32_SNORM )
155 ATTRIB( R32G32_SNORM, 2, int, TO_32_SNORM )
156 ATTRIB( R32_SNORM, 1, int, TO_32_SNORM )
158 ATTRIB( R16G16B16A16_USCALED, 4, ushort, TO_16_USCALED )
159 ATTRIB( R16G16B16_USCALED, 3, ushort, TO_16_USCALED )
160 ATTRIB( R16G16_USCALED, 2, ushort, TO_16_USCALED )
161 ATTRIB( R16_USCALED, 1, ushort, TO_16_USCALED )
163 ATTRIB( R16G16B16A16_SSCALED, 4, short, TO_16_SSCALED )
164 ATTRIB( R16G16B16_SSCALED, 3, short, TO_16_SSCALED )
165 ATTRIB( R16G16_SSCALED, 2, short, TO_16_SSCALED )
166 ATTRIB( R16_SSCALED, 1, short, TO_16_SSCALED )
168 ATTRIB( R16G16B16A16_UNORM, 4, ushort, TO_16_UNORM )
169 ATTRIB( R16G16B16_UNORM, 3, ushort, TO_16_UNORM )
170 ATTRIB( R16G16_UNORM, 2, ushort, TO_16_UNORM )
171 ATTRIB( R16_UNORM, 1, ushort, TO_16_UNORM )
173 ATTRIB( R16G16B16A16_SNORM, 4, short, TO_16_SNORM )
174 ATTRIB( R16G16B16_SNORM, 3, short, TO_16_SNORM )
175 ATTRIB( R16G16_SNORM, 2, short, TO_16_SNORM )
176 ATTRIB( R16_SNORM, 1, short, TO_16_SNORM )
178 ATTRIB( R8G8B8A8_USCALED, 4, ubyte, TO_8_USCALED )
179 ATTRIB( R8G8B8_USCALED, 3, ubyte, TO_8_USCALED )
180 ATTRIB( R8G8_USCALED, 2, ubyte, TO_8_USCALED )
181 ATTRIB( R8_USCALED, 1, ubyte, TO_8_USCALED )
183 ATTRIB( R8G8B8A8_SSCALED, 4, char, TO_8_SSCALED )
184 ATTRIB( R8G8B8_SSCALED, 3, char, TO_8_SSCALED )
185 ATTRIB( R8G8_SSCALED, 2, char, TO_8_SSCALED )
186 ATTRIB( R8_SSCALED, 1, char, TO_8_SSCALED )
188 ATTRIB( R8G8B8A8_UNORM, 4, ubyte, TO_8_UNORM )
189 ATTRIB( R8G8B8_UNORM, 3, ubyte, TO_8_UNORM )
190 ATTRIB( R8G8_UNORM, 2, ubyte, TO_8_UNORM )
191 ATTRIB( R8_UNORM, 1, ubyte, TO_8_UNORM )
193 ATTRIB( R8G8B8A8_SNORM, 4, char, TO_8_SNORM )
194 ATTRIB( R8G8B8_SNORM, 3, char, TO_8_SNORM )
195 ATTRIB( R8G8_SNORM, 2, char, TO_8_SNORM )
196 ATTRIB( R8_SNORM, 1, char, TO_8_SNORM )
198 static void
199 emit_A8R8G8B8_UNORM( const float *attrib, void *ptr)
201 ubyte *out = (ubyte *)ptr;
202 out[0] = TO_8_UNORM(attrib[3]);
203 out[1] = TO_8_UNORM(attrib[0]);
204 out[2] = TO_8_UNORM(attrib[1]);
205 out[3] = TO_8_UNORM(attrib[2]);
208 static void
209 emit_B8G8R8A8_UNORM( const float *attrib, void *ptr)
211 ubyte *out = (ubyte *)ptr;
212 out[2] = TO_8_UNORM(attrib[0]);
213 out[1] = TO_8_UNORM(attrib[1]);
214 out[0] = TO_8_UNORM(attrib[2]);
215 out[3] = TO_8_UNORM(attrib[3]);
218 static void
219 emit_NULL( const float *attrib, void *ptr )
221 /* do nothing is the only sensible option */
224 static emit_func get_emit_func( enum pipe_format format )
226 switch (format) {
227 case PIPE_FORMAT_R64_FLOAT:
228 return &emit_R64_FLOAT;
229 case PIPE_FORMAT_R64G64_FLOAT:
230 return &emit_R64G64_FLOAT;
231 case PIPE_FORMAT_R64G64B64_FLOAT:
232 return &emit_R64G64B64_FLOAT;
233 case PIPE_FORMAT_R64G64B64A64_FLOAT:
234 return &emit_R64G64B64A64_FLOAT;
236 case PIPE_FORMAT_R32_FLOAT:
237 return &emit_R32_FLOAT;
238 case PIPE_FORMAT_R32G32_FLOAT:
239 return &emit_R32G32_FLOAT;
240 case PIPE_FORMAT_R32G32B32_FLOAT:
241 return &emit_R32G32B32_FLOAT;
242 case PIPE_FORMAT_R32G32B32A32_FLOAT:
243 return &emit_R32G32B32A32_FLOAT;
245 case PIPE_FORMAT_R32_UNORM:
246 return &emit_R32_UNORM;
247 case PIPE_FORMAT_R32G32_UNORM:
248 return &emit_R32G32_UNORM;
249 case PIPE_FORMAT_R32G32B32_UNORM:
250 return &emit_R32G32B32_UNORM;
251 case PIPE_FORMAT_R32G32B32A32_UNORM:
252 return &emit_R32G32B32A32_UNORM;
254 case PIPE_FORMAT_R32_USCALED:
255 return &emit_R32_USCALED;
256 case PIPE_FORMAT_R32G32_USCALED:
257 return &emit_R32G32_USCALED;
258 case PIPE_FORMAT_R32G32B32_USCALED:
259 return &emit_R32G32B32_USCALED;
260 case PIPE_FORMAT_R32G32B32A32_USCALED:
261 return &emit_R32G32B32A32_USCALED;
263 case PIPE_FORMAT_R32_SNORM:
264 return &emit_R32_SNORM;
265 case PIPE_FORMAT_R32G32_SNORM:
266 return &emit_R32G32_SNORM;
267 case PIPE_FORMAT_R32G32B32_SNORM:
268 return &emit_R32G32B32_SNORM;
269 case PIPE_FORMAT_R32G32B32A32_SNORM:
270 return &emit_R32G32B32A32_SNORM;
272 case PIPE_FORMAT_R32_SSCALED:
273 return &emit_R32_SSCALED;
274 case PIPE_FORMAT_R32G32_SSCALED:
275 return &emit_R32G32_SSCALED;
276 case PIPE_FORMAT_R32G32B32_SSCALED:
277 return &emit_R32G32B32_SSCALED;
278 case PIPE_FORMAT_R32G32B32A32_SSCALED:
279 return &emit_R32G32B32A32_SSCALED;
281 case PIPE_FORMAT_R16_UNORM:
282 return &emit_R16_UNORM;
283 case PIPE_FORMAT_R16G16_UNORM:
284 return &emit_R16G16_UNORM;
285 case PIPE_FORMAT_R16G16B16_UNORM:
286 return &emit_R16G16B16_UNORM;
287 case PIPE_FORMAT_R16G16B16A16_UNORM:
288 return &emit_R16G16B16A16_UNORM;
290 case PIPE_FORMAT_R16_USCALED:
291 return &emit_R16_USCALED;
292 case PIPE_FORMAT_R16G16_USCALED:
293 return &emit_R16G16_USCALED;
294 case PIPE_FORMAT_R16G16B16_USCALED:
295 return &emit_R16G16B16_USCALED;
296 case PIPE_FORMAT_R16G16B16A16_USCALED:
297 return &emit_R16G16B16A16_USCALED;
299 case PIPE_FORMAT_R16_SNORM:
300 return &emit_R16_SNORM;
301 case PIPE_FORMAT_R16G16_SNORM:
302 return &emit_R16G16_SNORM;
303 case PIPE_FORMAT_R16G16B16_SNORM:
304 return &emit_R16G16B16_SNORM;
305 case PIPE_FORMAT_R16G16B16A16_SNORM:
306 return &emit_R16G16B16A16_SNORM;
308 case PIPE_FORMAT_R16_SSCALED:
309 return &emit_R16_SSCALED;
310 case PIPE_FORMAT_R16G16_SSCALED:
311 return &emit_R16G16_SSCALED;
312 case PIPE_FORMAT_R16G16B16_SSCALED:
313 return &emit_R16G16B16_SSCALED;
314 case PIPE_FORMAT_R16G16B16A16_SSCALED:
315 return &emit_R16G16B16A16_SSCALED;
317 case PIPE_FORMAT_R8_UNORM:
318 return &emit_R8_UNORM;
319 case PIPE_FORMAT_R8G8_UNORM:
320 return &emit_R8G8_UNORM;
321 case PIPE_FORMAT_R8G8B8_UNORM:
322 return &emit_R8G8B8_UNORM;
323 case PIPE_FORMAT_R8G8B8A8_UNORM:
324 return &emit_R8G8B8A8_UNORM;
326 case PIPE_FORMAT_R8_USCALED:
327 return &emit_R8_USCALED;
328 case PIPE_FORMAT_R8G8_USCALED:
329 return &emit_R8G8_USCALED;
330 case PIPE_FORMAT_R8G8B8_USCALED:
331 return &emit_R8G8B8_USCALED;
332 case PIPE_FORMAT_R8G8B8A8_USCALED:
333 return &emit_R8G8B8A8_USCALED;
335 case PIPE_FORMAT_R8_SNORM:
336 return &emit_R8_SNORM;
337 case PIPE_FORMAT_R8G8_SNORM:
338 return &emit_R8G8_SNORM;
339 case PIPE_FORMAT_R8G8B8_SNORM:
340 return &emit_R8G8B8_SNORM;
341 case PIPE_FORMAT_R8G8B8A8_SNORM:
342 return &emit_R8G8B8A8_SNORM;
344 case PIPE_FORMAT_R8_SSCALED:
345 return &emit_R8_SSCALED;
346 case PIPE_FORMAT_R8G8_SSCALED:
347 return &emit_R8G8_SSCALED;
348 case PIPE_FORMAT_R8G8B8_SSCALED:
349 return &emit_R8G8B8_SSCALED;
350 case PIPE_FORMAT_R8G8B8A8_SSCALED:
351 return &emit_R8G8B8A8_SSCALED;
353 case PIPE_FORMAT_B8G8R8A8_UNORM:
354 return &emit_B8G8R8A8_UNORM;
356 case PIPE_FORMAT_A8R8G8B8_UNORM:
357 return &emit_A8R8G8B8_UNORM;
359 default:
360 assert(0);
361 return &emit_NULL;
365 static ALWAYS_INLINE void PIPE_CDECL generic_run_one( struct translate_generic *tg,
366 unsigned elt,
367 unsigned instance_id,
368 void *vert )
370 unsigned nr_attrs = tg->nr_attrib;
371 unsigned attr;
373 for (attr = 0; attr < nr_attrs; attr++) {
374 float data[4];
375 uint8_t *dst = (uint8_t *)vert + tg->attrib[attr].output_offset;
377 if (tg->attrib[attr].type == TRANSLATE_ELEMENT_NORMAL) {
378 const uint8_t *src;
379 unsigned index;
380 int copy_size;
382 if (tg->attrib[attr].instance_divisor) {
383 index = instance_id / tg->attrib[attr].instance_divisor;
384 /* XXX we need to clamp the index here too, but to a
385 * per-array max value, not the draw->pt.max_index value
386 * that's being given to us via translate->set_buffer().
389 else {
390 index = elt;
391 /* clamp to avoid going out of bounds */
392 index = MIN2(index, tg->attrib[attr].max_index);
395 src = tg->attrib[attr].input_ptr +
396 tg->attrib[attr].input_stride * index;
398 copy_size = tg->attrib[attr].copy_size;
399 if(likely(copy_size >= 0))
400 memcpy(dst, src, copy_size);
401 else
403 tg->attrib[attr].fetch( data, src, 0, 0 );
405 if (0)
406 debug_printf("Fetch linear attr %d from %p stride %d index %d: "
407 " %f, %f, %f, %f \n",
408 attr,
409 tg->attrib[attr].input_ptr,
410 tg->attrib[attr].input_stride,
411 index,
412 data[0], data[1],data[2], data[3]);
414 tg->attrib[attr].emit( data, dst );
416 } else {
417 if(likely(tg->attrib[attr].copy_size >= 0))
418 memcpy(data, &instance_id, 4);
419 else
421 data[0] = (float)instance_id;
422 tg->attrib[attr].emit( data, dst );
429 * Fetch vertex attributes for 'count' vertices.
431 static void PIPE_CDECL generic_run_elts( struct translate *translate,
432 const unsigned *elts,
433 unsigned count,
434 unsigned instance_id,
435 void *output_buffer )
437 struct translate_generic *tg = translate_generic(translate);
438 char *vert = output_buffer;
439 unsigned i;
441 for (i = 0; i < count; i++) {
442 generic_run_one(tg, *elts++, instance_id, vert);
443 vert += tg->translate.key.output_stride;
447 static void PIPE_CDECL generic_run_elts16( struct translate *translate,
448 const uint16_t *elts,
449 unsigned count,
450 unsigned instance_id,
451 void *output_buffer )
453 struct translate_generic *tg = translate_generic(translate);
454 char *vert = output_buffer;
455 unsigned i;
457 for (i = 0; i < count; i++) {
458 generic_run_one(tg, *elts++, instance_id, vert);
459 vert += tg->translate.key.output_stride;
463 static void PIPE_CDECL generic_run_elts8( struct translate *translate,
464 const uint8_t *elts,
465 unsigned count,
466 unsigned instance_id,
467 void *output_buffer )
469 struct translate_generic *tg = translate_generic(translate);
470 char *vert = output_buffer;
471 unsigned i;
473 for (i = 0; i < count; i++) {
474 generic_run_one(tg, *elts++, instance_id, vert);
475 vert += tg->translate.key.output_stride;
479 static void PIPE_CDECL generic_run( struct translate *translate,
480 unsigned start,
481 unsigned count,
482 unsigned instance_id,
483 void *output_buffer )
485 struct translate_generic *tg = translate_generic(translate);
486 char *vert = output_buffer;
487 unsigned i;
489 for (i = 0; i < count; i++) {
490 generic_run_one(tg, start + i, instance_id, vert);
491 vert += tg->translate.key.output_stride;
497 static void generic_set_buffer( struct translate *translate,
498 unsigned buf,
499 const void *ptr,
500 unsigned stride,
501 unsigned max_index )
503 struct translate_generic *tg = translate_generic(translate);
504 unsigned i;
506 for (i = 0; i < tg->nr_attrib; i++) {
507 if (tg->attrib[i].buffer == buf) {
508 tg->attrib[i].input_ptr = ((const uint8_t *)ptr +
509 tg->attrib[i].input_offset);
510 tg->attrib[i].input_stride = stride;
511 tg->attrib[i].max_index = max_index;
517 static void generic_release( struct translate *translate )
519 /* Refcount?
521 FREE(translate);
524 struct translate *translate_generic_create( const struct translate_key *key )
526 struct translate_generic *tg = CALLOC_STRUCT(translate_generic);
527 unsigned i;
529 if (tg == NULL)
530 return NULL;
532 tg->translate.key = *key;
533 tg->translate.release = generic_release;
534 tg->translate.set_buffer = generic_set_buffer;
535 tg->translate.run_elts = generic_run_elts;
536 tg->translate.run_elts16 = generic_run_elts16;
537 tg->translate.run_elts8 = generic_run_elts8;
538 tg->translate.run = generic_run;
540 for (i = 0; i < key->nr_elements; i++) {
541 const struct util_format_description *format_desc =
542 util_format_description(key->element[i].input_format);
544 assert(format_desc);
545 assert(format_desc->fetch_rgba_float);
547 tg->attrib[i].type = key->element[i].type;
549 tg->attrib[i].fetch = format_desc->fetch_rgba_float;
550 tg->attrib[i].buffer = key->element[i].input_buffer;
551 tg->attrib[i].input_offset = key->element[i].input_offset;
552 tg->attrib[i].instance_divisor = key->element[i].instance_divisor;
554 tg->attrib[i].output_offset = key->element[i].output_offset;
556 tg->attrib[i].copy_size = -1;
557 if (tg->attrib[i].type == TRANSLATE_ELEMENT_INSTANCE_ID)
559 if(key->element[i].output_format == PIPE_FORMAT_R32_USCALED
560 || key->element[i].output_format == PIPE_FORMAT_R32_SSCALED)
561 tg->attrib[i].copy_size = 4;
563 else
565 if(key->element[i].input_format == key->element[i].output_format
566 && format_desc->block.width == 1
567 && format_desc->block.height == 1
568 && !(format_desc->block.bits & 7))
569 tg->attrib[i].copy_size = format_desc->block.bits >> 3;
572 if(tg->attrib[i].copy_size < 0)
573 tg->attrib[i].emit = get_emit_func(key->element[i].output_format);
574 else
575 tg->attrib[i].emit = NULL;
578 tg->nr_attrib = key->nr_elements;
581 return &tg->translate;
584 boolean translate_generic_is_output_format_supported(enum pipe_format format)
586 switch(format)
588 case PIPE_FORMAT_R64G64B64A64_FLOAT: return TRUE;
589 case PIPE_FORMAT_R64G64B64_FLOAT: return TRUE;
590 case PIPE_FORMAT_R64G64_FLOAT: return TRUE;
591 case PIPE_FORMAT_R64_FLOAT: return TRUE;
593 case PIPE_FORMAT_R32G32B32A32_FLOAT: return TRUE;
594 case PIPE_FORMAT_R32G32B32_FLOAT: return TRUE;
595 case PIPE_FORMAT_R32G32_FLOAT: return TRUE;
596 case PIPE_FORMAT_R32_FLOAT: return TRUE;
598 case PIPE_FORMAT_R32G32B32A32_USCALED: return TRUE;
599 case PIPE_FORMAT_R32G32B32_USCALED: return TRUE;
600 case PIPE_FORMAT_R32G32_USCALED: return TRUE;
601 case PIPE_FORMAT_R32_USCALED: return TRUE;
603 case PIPE_FORMAT_R32G32B32A32_SSCALED: return TRUE;
604 case PIPE_FORMAT_R32G32B32_SSCALED: return TRUE;
605 case PIPE_FORMAT_R32G32_SSCALED: return TRUE;
606 case PIPE_FORMAT_R32_SSCALED: return TRUE;
608 case PIPE_FORMAT_R32G32B32A32_UNORM: return TRUE;
609 case PIPE_FORMAT_R32G32B32_UNORM: return TRUE;
610 case PIPE_FORMAT_R32G32_UNORM: return TRUE;
611 case PIPE_FORMAT_R32_UNORM: return TRUE;
613 case PIPE_FORMAT_R32G32B32A32_SNORM: return TRUE;
614 case PIPE_FORMAT_R32G32B32_SNORM: return TRUE;
615 case PIPE_FORMAT_R32G32_SNORM: return TRUE;
616 case PIPE_FORMAT_R32_SNORM: return TRUE;
618 case PIPE_FORMAT_R16G16B16A16_USCALED: return TRUE;
619 case PIPE_FORMAT_R16G16B16_USCALED: return TRUE;
620 case PIPE_FORMAT_R16G16_USCALED: return TRUE;
621 case PIPE_FORMAT_R16_USCALED: return TRUE;
623 case PIPE_FORMAT_R16G16B16A16_SSCALED: return TRUE;
624 case PIPE_FORMAT_R16G16B16_SSCALED: return TRUE;
625 case PIPE_FORMAT_R16G16_SSCALED: return TRUE;
626 case PIPE_FORMAT_R16_SSCALED: return TRUE;
628 case PIPE_FORMAT_R16G16B16A16_UNORM: return TRUE;
629 case PIPE_FORMAT_R16G16B16_UNORM: return TRUE;
630 case PIPE_FORMAT_R16G16_UNORM: return TRUE;
631 case PIPE_FORMAT_R16_UNORM: return TRUE;
633 case PIPE_FORMAT_R16G16B16A16_SNORM: return TRUE;
634 case PIPE_FORMAT_R16G16B16_SNORM: return TRUE;
635 case PIPE_FORMAT_R16G16_SNORM: return TRUE;
636 case PIPE_FORMAT_R16_SNORM: return TRUE;
638 case PIPE_FORMAT_R8G8B8A8_USCALED: return TRUE;
639 case PIPE_FORMAT_R8G8B8_USCALED: return TRUE;
640 case PIPE_FORMAT_R8G8_USCALED: return TRUE;
641 case PIPE_FORMAT_R8_USCALED: return TRUE;
643 case PIPE_FORMAT_R8G8B8A8_SSCALED: return TRUE;
644 case PIPE_FORMAT_R8G8B8_SSCALED: return TRUE;
645 case PIPE_FORMAT_R8G8_SSCALED: return TRUE;
646 case PIPE_FORMAT_R8_SSCALED: return TRUE;
648 case PIPE_FORMAT_R8G8B8A8_UNORM: return TRUE;
649 case PIPE_FORMAT_R8G8B8_UNORM: return TRUE;
650 case PIPE_FORMAT_R8G8_UNORM: return TRUE;
651 case PIPE_FORMAT_R8_UNORM: return TRUE;
653 case PIPE_FORMAT_R8G8B8A8_SNORM: return TRUE;
654 case PIPE_FORMAT_R8G8B8_SNORM: return TRUE;
655 case PIPE_FORMAT_R8G8_SNORM: return TRUE;
656 case PIPE_FORMAT_R8_SNORM: return TRUE;
658 case PIPE_FORMAT_A8R8G8B8_UNORM: return TRUE;
659 case PIPE_FORMAT_B8G8R8A8_UNORM: return TRUE;
660 default: return FALSE;