2 * Copyright © 2014 Advanced Micro Devices, Inc.
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16 * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
17 * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 * USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
28 ****************************************************************************************************
29 * @file addrelemlib.cpp
30 * @brief Contains the class implementation for element/pixel related functions.
31 ****************************************************************************************************
34 #include "addrelemlib.h"
41 ****************************************************************************************************
49 ****************************************************************************************************
52 Lib
* pAddrLib
) ///< [in] Parent addrlib instance pointer
54 Object(pAddrLib
->GetClient()),
57 switch (m_pAddrLib
->GetChipFamily())
59 case ADDR_CHIP_FAMILY_R6XX
:
60 m_depthPlanarType
= ADDR_DEPTH_PLANAR_R600
;
63 case ADDR_CHIP_FAMILY_R7XX
:
64 m_depthPlanarType
= ADDR_DEPTH_PLANAR_R600
;
67 case ADDR_CHIP_FAMILY_R8XX
:
68 case ADDR_CHIP_FAMILY_NI
: // Same as 8xx
69 m_depthPlanarType
= ADDR_DEPTH_PLANAR_R800
;
74 m_depthPlanarType
= ADDR_DEPTH_PLANAR_R800
;
77 m_configFlags
.value
= 0;
81 ****************************************************************************************************
89 ****************************************************************************************************
96 ****************************************************************************************************
100 * Creates and initializes AddrLib object.
103 * Returns point to ADDR_CREATEINFO if successful.
104 ****************************************************************************************************
106 ElemLib
* ElemLib::Create(
107 const Lib
* pAddrLib
) ///< [in] Pointer of parent AddrLib instance
109 ElemLib
* pElemLib
= NULL
;
113 VOID
* pObj
= Object::ClientAlloc(sizeof(ElemLib
), pAddrLib
->GetClient());
116 pElemLib
= new(pObj
) ElemLib(const_cast<Lib
* const>(pAddrLib
));
123 /**************************************************************************************************
124 * ElemLib::Flt32sToInt32s
127 * Convert a ADDR_FLT_32 value to Int32 value
131 ****************************************************************************************************
133 VOID
ElemLib::Flt32sToInt32s(
134 ADDR_FLT_32 value
, ///< [in] ADDR_FLT_32 value
135 UINT_32 bits
, ///< [in] nubmer of bits in value
136 NumberType numberType
, ///< [in] the type of number
137 UINT_32
* pResult
) ///< [out] Int32 value
139 UINT_8 round
= 128; //ADDR_ROUND_BY_HALF
143 //convert each component to an INT_32
144 switch ( numberType
)
146 case ADDR_NO_NUMBER
: //fall through
147 case ADDR_ZERO
: //fall through
148 case ADDR_ONE
: //fall through
149 case ADDR_EPSILON
: //fall through
150 return; // these are zero-bit components, so don't set result
152 case ADDR_UINT_BITS
: // unsigned integer bit field, clamped to range
153 uscale
= (1<<bits
) - 1;
154 if (bits
== 32) // special case unsigned 32-bit int
160 if ((value
.i
< 0) || (value
.u
> uscale
))
171 // The algorithm used in the DB and TX differs at one value for 24-bit unorms
172 case ADDR_UNORM_R6XXDB
: // unsigned repeating fraction
173 if ((bits
==24) && (value
.i
== 0x33000000))
177 } // Else treat like ADDR_UNORM_R6XX
179 case ADDR_UNORM_R6XX
: // unsigned repeating fraction
182 *pResult
= 0; // first clamp to [0..1]
188 *pResult
= (1<<bits
) - 1;
192 if ((value
.i
| 0x87FFFFFF) == 0xFFFFFFFF)
194 *pResult
= 0; // NaN, so force to 0
197 #if 0 // floating point version for documentation
200 FLOAT f
= value
.f
* ((1<<bits
) - 1);
201 *pResult
= static_cast<INT_32
>(f
+ (round
/256.0f
));
208 UINT_64 truncated
, rounded
;
210 UINT_32 mask
= (1 << bits
) - 1;
211 UINT_32 half
= 1 << (bits
- 1);
212 UINT_32 mant24
= (value
.i
& 0x7FFFFF) + 0x800000;
213 UINT_64 temp
= mant24
- (mant24
>>bits
) -
214 static_cast<INT_32
>((mant24
& mask
) > half
);
215 UINT_32 exp8
= value
.i
>> 23;
216 UINT_32 shift
= 126 - exp8
+ 24 - bits
;
219 if (shift
>= 32) // This is zero, even with maximum dither add
225 final
= ((temp
<<8) + (static_cast<UINT_64
>(round
)<<shift
)) >> (shift
+8);
227 //ADDR_EXIT( *pResult == final,
228 // ("Float %x converted to %d-bit Unorm %x != bitwise %x",
229 // value.u, bits, (UINT_32)*pResult, (UINT_32)final) );
235 scaled
.f
= value
.f
* ((1<<bits
) - 1);
236 shifted
.f
= (scaled
.f
* 256);
237 truncated
= ((shifted
.i
&0x7FFFFF) + (INT_64
)0x800000) << 8;
238 altShift
= 126 + 24 + 8 - ((shifted
.i
>>23)&0xFF);
239 truncated
= (altShift
> 60) ? 0 : truncated
>> altShift
;
240 rounded
= static_cast<INT_32
>((round
+ truncated
) >> 8);
241 //if (rounded > ((1<<bits) - 1))
242 // rounded = ((1<<bits) - 1);
243 *pResult
= static_cast<INT_32
>(rounded
); //(INT_32)final;
250 case ADDR_S8FLOAT32
: // 32-bit IEEE float, passes through NaN values
254 // @@ FIX ROUNDING in this code, fix the denorm case
255 case ADDR_U4FLOATC
: // Unsigned float, 4-bit exponent. bias 15, clamped [0..1]
256 sign
= (value
.i
>> 31) & 1;
257 if ((value
.i
&0x7F800000) == 0x7F800000) // If NaN or INF:
259 if ((value
.i
&0x007FFFFF) != 0) // then if NaN
261 *pResult
= 0; // return 0
265 *pResult
= (sign
)?0:0xF00000; // else +INF->+1, -INF->0
277 *pResult
= 0xF << (bits
-4);
281 if ((value
.i
>>23) > 112 )
283 // 24-bit float: normalized
284 // value.i += 1 << (22-bits+4);
285 // round the IEEE mantissa to mantissa size
286 // @@ NOTE: add code to support rounding
287 value
.u
&= 0x7FFFFFF; // mask off high 4 exponent bits
288 *pResult
= value
.i
>> (23-bits
+4);// shift off unused mantissa bits
292 // 24-bit float: denormalized
293 value
.f
= value
.f
/ (1<<28) / (1<<28);
294 value
.f
= value
.f
/ (1<<28) / (1<<28); // convert to IEEE denorm
295 // value.i += 1 << (22-bits+4);
296 // round the IEEE mantissa to mantissa size
297 // @@ NOTE: add code to support rounding
298 *pResult
= value
.i
>> (23-bits
+4); // shift off unused mantissa bits
305 default: // invalid number mode
306 //ADDR_EXIT(0, ("Invalid AddrNumber %d", numberType) );
313 ****************************************************************************************************
314 * ElemLib::Int32sToPixel
317 * Pack 32-bit integer values into an uncompressed pixel,
318 * in the proper order
324 * This entry point packes four 32-bit integer values into
325 * an uncompressed pixel. The pixel values are specifies in
326 * standard order, e.g. depth/stencil. This routine asserts
327 * if called on compressed pixel.
328 ****************************************************************************************************
330 VOID
ElemLib::Int32sToPixel(
331 UINT_32 numComps
, ///< [in] number of components
332 UINT_32
* pComps
, ///< [in] compnents
333 UINT_32
* pCompBits
, ///< [in] total bits in each component
334 UINT_32
* pCompStart
, ///< [in] the first bit position of each component
335 ComponentFlags properties
, ///< [in] properties about byteAligned, exportNorm
336 UINT_32 resultBits
, ///< [in] result bits: total bpp after decompression
337 UINT_8
* pPixel
) ///< [out] a depth/stencil pixel value
347 UINT_32 elementXor
= 0; // address xor when reading bytes from elements
350 // @@ NOTE: assert if called on a compressed format!
352 if (properties
.byteAligned
) // Components are all byte-sized
354 for (i
= 0; i
< numComps
; i
++) // Then for each component
356 // Copy the bytes of the component into the element
357 start
= pCompStart
[i
] / 8;
358 size
= pCompBits
[i
] / 8;
359 for (j
= 0; j
< size
; j
++)
361 pPixel
[(j
+start
)^elementXor
] = static_cast<UINT_8
>(pComps
[i
] >> (8*j
));
365 else // Element is 32-bits or less, components are bit fields
367 // First, extract each component in turn and combine it into a 32-bit value
368 for (i
= 0; i
< numComps
; i
++)
370 compMask
= (1 << pCompBits
[i
]) - 1;
371 elemMask
|= compMask
<< pCompStart
[i
];
372 value
|= (pComps
[i
] & compMask
) << pCompStart
[i
];
375 // Mext, copy the masked value into the element
376 size
= (resultBits
+ 7) / 8;
377 for (i
= 0; i
< size
; i
++)
379 byte
= pPixel
[i
^elementXor
] & ~(elemMask
>> (8*i
));
380 pPixel
[i
^elementXor
] = static_cast<UINT_8
>(byte
| ((elemMask
& value
) >> (8*i
)));
386 ****************************************************************************************************
390 * Convert a FLT_32 value to a depth/stencil pixel value
394 ****************************************************************************************************
396 VOID
ElemLib::Flt32ToDepthPixel(
397 AddrDepthFormat format
, ///< [in] Depth format
398 const ADDR_FLT_32 comps
[2], ///< [in] two components of depth
399 UINT_8
* pPixel
///< [out] depth pixel value
404 ComponentFlags properties
; // byteAligned, exportNorm
405 UINT_32 resultBits
= 0; // result bits: total bits per pixel after decompression
409 // get type for each component
410 PixGetDepthCompInfo(format
, &fmt
);
412 //initialize properties
413 properties
.byteAligned
= TRUE
;
414 properties
.exportNorm
= TRUE
;
415 properties
.floatComp
= FALSE
;
417 //set properties and result bits
418 for (i
= 0; i
< 2; i
++)
420 if ((fmt
.compBit
[i
] & 7) || (fmt
.compStart
[i
] & 7))
422 properties
.byteAligned
= FALSE
;
425 if (resultBits
< fmt
.compStart
[i
] + fmt
.compBit
[i
])
427 resultBits
= fmt
.compStart
[i
] + fmt
.compBit
[i
];
430 // Clear ADDR_EXPORT_NORM if can't be represented as 11-bit or smaller [-1..+1] format
431 if (fmt
.compBit
[i
] > 11 || fmt
.numType
[i
] >= ADDR_USCALED
)
433 properties
.exportNorm
= FALSE
;
436 // Mark if there are any floating point components
437 if ((fmt
.numType
[i
] == ADDR_U4FLOATC
) || (fmt
.numType
[i
] >= ADDR_S8FLOAT
) )
439 properties
.floatComp
= TRUE
;
443 // Convert the two input floats to integer values
444 for (i
= 0; i
< 2; i
++)
446 Flt32sToInt32s(comps
[i
], fmt
.compBit
[i
], fmt
.numType
[i
], &values
[i
]);
449 // Then pack the two integer components, in the proper order
450 Int32sToPixel(2, values
, fmt
.compBit
, fmt
.compStart
, properties
, resultBits
, pPixel
);
455 ****************************************************************************************************
459 * Convert a FLT_32 value to a red/green/blue/alpha pixel value
463 ****************************************************************************************************
465 VOID
ElemLib::Flt32ToColorPixel(
466 AddrColorFormat format
, ///< [in] Color format
467 AddrSurfaceNumber surfNum
, ///< [in] Surface number
468 AddrSurfaceSwap surfSwap
, ///< [in] Surface swap
469 const ADDR_FLT_32 comps
[4], ///< [in] four components of color
470 UINT_8
* pPixel
///< [out] a red/green/blue/alpha pixel value
473 PixelFormatInfo pixelInfo
;
477 ComponentFlags properties
; // byteAligned, exportNorm
478 UINT_32 resultBits
= 0; // result bits: total bits per pixel after decompression
480 memset(&pixelInfo
, 0, sizeof(PixelFormatInfo
));
482 PixGetColorCompInfo(format
, surfNum
, surfSwap
, &pixelInfo
);
484 //initialize properties
485 properties
.byteAligned
= TRUE
;
486 properties
.exportNorm
= TRUE
;
487 properties
.floatComp
= FALSE
;
489 //set properties and result bits
490 for (i
= 0; i
< 4; i
++)
492 if ( (pixelInfo
.compBit
[i
] & 7) || (pixelInfo
.compStart
[i
] & 7) )
494 properties
.byteAligned
= FALSE
;
497 if (resultBits
< pixelInfo
.compStart
[i
] + pixelInfo
.compBit
[i
])
499 resultBits
= pixelInfo
.compStart
[i
] + pixelInfo
.compBit
[i
];
502 if (m_fp16ExportNorm
)
504 // Clear ADDR_EXPORT_NORM if can't be represented as 11-bit or smaller [-1..+1] format
505 // or if it's not FP and <=16 bits
506 if (((pixelInfo
.compBit
[i
] > 11) || (pixelInfo
.numType
[i
] >= ADDR_USCALED
))
507 && (pixelInfo
.numType
[i
] !=ADDR_U4FLOATC
))
509 properties
.exportNorm
= FALSE
;
514 // Clear ADDR_EXPORT_NORM if can't be represented as 11-bit or smaller [-1..+1] format
515 if (pixelInfo
.compBit
[i
] > 11 || pixelInfo
.numType
[i
] >= ADDR_USCALED
)
517 properties
.exportNorm
= FALSE
;
521 // Mark if there are any floating point components
522 if ( (pixelInfo
.numType
[i
] == ADDR_U4FLOATC
) ||
523 (pixelInfo
.numType
[i
] >= ADDR_S8FLOAT
) )
525 properties
.floatComp
= TRUE
;
529 // Convert the four input floats to integer values
530 for (i
= 0; i
< 4; i
++)
532 Flt32sToInt32s(comps
[i
], pixelInfo
.compBit
[i
], pixelInfo
.numType
[i
], &values
[i
]);
535 // Then pack the four integer components, in the proper order
536 Int32sToPixel(4, values
, &pixelInfo
.compBit
[0], &pixelInfo
.compStart
[0],
537 properties
, resultBits
, pPixel
);
541 ****************************************************************************************************
542 * ElemLib::GetCompType
545 * Fill per component info
550 ****************************************************************************************************
552 VOID
ElemLib::GetCompType(
553 AddrColorFormat format
, ///< [in] surface format
554 AddrSurfaceNumber numType
, ///< [in] number type
555 PixelFormatInfo
* pInfo
) ///< [in][out] per component info out
557 BOOL_32 handled
= FALSE
;
559 // Floating point formats override the number format
562 case ADDR_COLOR_16_FLOAT
: // fall through for all pure floating point format
563 case ADDR_COLOR_16_16_FLOAT
:
564 case ADDR_COLOR_16_16_16_16_FLOAT
:
565 case ADDR_COLOR_32_FLOAT
:
566 case ADDR_COLOR_32_32_FLOAT
:
567 case ADDR_COLOR_32_32_32_32_FLOAT
:
568 case ADDR_COLOR_10_11_11_FLOAT
:
569 case ADDR_COLOR_11_11_10_FLOAT
:
570 numType
= ADDR_NUMBER_FLOAT
;
572 // Special handling for the depth formats
573 case ADDR_COLOR_8_24
: // fall through for these 2 similar format
574 case ADDR_COLOR_24_8
:
575 for (UINT_32 c
= 0; c
< 4; c
++)
577 if (pInfo
->compBit
[c
] == 8)
579 pInfo
->numType
[c
] = ADDR_UINT_BITS
;
581 else if (pInfo
->compBit
[c
] == 24)
583 pInfo
->numType
[c
] = ADDR_UNORM_R6XX
;
587 pInfo
->numType
[c
] = ADDR_NO_NUMBER
;
592 case ADDR_COLOR_8_24_FLOAT
: // fall through for these 3 similar format
593 case ADDR_COLOR_24_8_FLOAT
:
594 case ADDR_COLOR_X24_8_32_FLOAT
:
595 for (UINT_32 c
= 0; c
< 4; c
++)
597 if (pInfo
->compBit
[c
] == 8)
599 pInfo
->numType
[c
] = ADDR_UINT_BITS
;
601 else if (pInfo
->compBit
[c
] == 24)
603 pInfo
->numType
[c
] = ADDR_U4FLOATC
;
605 else if (pInfo
->compBit
[c
] == 32)
607 pInfo
->numType
[c
] = ADDR_S8FLOAT32
;
611 pInfo
->numType
[c
] = ADDR_NO_NUMBER
;
622 for (UINT_32 c
= 0; c
< 4; c
++)
624 // Assign a number type for each component
625 AddrSurfaceNumber cnum
;
627 // First handle default component values
628 if (pInfo
->compBit
[c
] == 0)
632 pInfo
->numType
[c
] = ADDR_ZERO
; // Default is zero for RGB
634 else if (numType
== ADDR_NUMBER_UINT
|| numType
== ADDR_NUMBER_SINT
)
636 pInfo
->numType
[c
] = ADDR_EPSILON
; // Alpha INT_32 bits default is 0x01
640 pInfo
->numType
[c
] = ADDR_ONE
; // Alpha normal default is float 1.0
644 // Now handle small components
645 else if (pInfo
->compBit
[c
] == 1)
647 if (numType
== ADDR_NUMBER_UINT
|| numType
== ADDR_NUMBER_SINT
)
649 cnum
= ADDR_NUMBER_UINT
;
653 cnum
= ADDR_NUMBER_UNORM
;
661 // If no default, set the number type fom num, compbits, and architecture
664 case ADDR_NUMBER_SRGB
:
665 pInfo
->numType
[c
] = (c
< 3) ? ADDR_GAMMA8_R6XX
: ADDR_UNORM_R6XX
;
667 case ADDR_NUMBER_UNORM
:
668 pInfo
->numType
[c
] = ADDR_UNORM_R6XX
;
670 case ADDR_NUMBER_SNORM
:
671 pInfo
->numType
[c
] = ADDR_SNORM_R6XX
;
673 case ADDR_NUMBER_USCALED
:
674 pInfo
->numType
[c
] = ADDR_USCALED
; // @@ Do we need separate Pele routine?
676 case ADDR_NUMBER_SSCALED
:
677 pInfo
->numType
[c
] = ADDR_SSCALED
; // @@ Do we need separate Pele routine?
679 case ADDR_NUMBER_FLOAT
:
680 if (pInfo
->compBit
[c
] == 32)
682 pInfo
->numType
[c
] = ADDR_S8FLOAT32
;
684 else if (pInfo
->compBit
[c
] == 16)
686 pInfo
->numType
[c
] = ADDR_S5FLOAT
;
688 else if (pInfo
->compBit
[c
] >= 10)
690 pInfo
->numType
[c
] = ADDR_U5FLOAT
;
694 ADDR_ASSERT_ALWAYS();
697 case ADDR_NUMBER_SINT
:
698 pInfo
->numType
[c
] = ADDR_SINT_BITS
;
700 case ADDR_NUMBER_UINT
:
701 pInfo
->numType
[c
] = ADDR_UINT_BITS
;
705 ADDR_ASSERT(!"Invalid number type");
706 pInfo
->numType
[c
] = ADDR_NO_NUMBER
;
714 ****************************************************************************************************
715 * ElemLib::GetCompSwap
718 * Get components swapped for color surface
723 ****************************************************************************************************
725 VOID
ElemLib::GetCompSwap(
726 AddrSurfaceSwap swap
, ///< [in] swap mode
727 PixelFormatInfo
* pInfo
) ///< [in,out] output per component info
729 switch (pInfo
->comps
)
735 SwapComps( 0, 2, pInfo
);
737 case ADDR_SWAP_STD_REV
:
738 SwapComps( 0, 3, pInfo
);
739 SwapComps( 1, 2, pInfo
);
741 case ADDR_SWAP_ALT_REV
:
742 SwapComps( 0, 3, pInfo
);
743 SwapComps( 0, 2, pInfo
);
744 SwapComps( 0, 1, pInfo
);
753 case ADDR_SWAP_ALT_REV
:
754 SwapComps( 0, 3, pInfo
);
755 SwapComps( 0, 2, pInfo
);
757 case ADDR_SWAP_STD_REV
:
758 SwapComps( 0, 2, pInfo
);
761 SwapComps( 2, 3, pInfo
);
770 case ADDR_SWAP_ALT_REV
:
771 SwapComps( 0, 1, pInfo
);
772 SwapComps( 1, 3, pInfo
);
774 case ADDR_SWAP_STD_REV
:
775 SwapComps( 0, 1, pInfo
);
778 SwapComps( 1, 3, pInfo
);
787 case ADDR_SWAP_ALT_REV
:
788 SwapComps( 0, 3, pInfo
);
790 case ADDR_SWAP_STD_REV
:
791 SwapComps( 0, 2, pInfo
);
794 SwapComps( 0, 1, pInfo
);
804 ****************************************************************************************************
805 * ElemLib::GetCompSwap
808 * Get components swapped for color surface
813 ****************************************************************************************************
815 VOID
ElemLib::SwapComps(
816 UINT_32 c0
, ///< [in] component index 0
817 UINT_32 c1
, ///< [in] component index 1
818 PixelFormatInfo
* pInfo
) ///< [in,out] output per component info
823 start
= pInfo
->compStart
[c0
];
824 pInfo
->compStart
[c0
] = pInfo
->compStart
[c1
];
825 pInfo
->compStart
[c1
] = start
;
827 bits
= pInfo
->compBit
[c0
];
828 pInfo
->compBit
[c0
] = pInfo
->compBit
[c1
];
829 pInfo
->compBit
[c1
] = bits
;
833 ****************************************************************************************************
834 * ElemLib::PixGetColorCompInfo
837 * Get per component info for color surface
842 ****************************************************************************************************
844 VOID
ElemLib::PixGetColorCompInfo(
845 AddrColorFormat format
, ///< [in] surface format, read from register
846 AddrSurfaceNumber number
, ///< [in] pixel number type
847 AddrSurfaceSwap swap
, ///< [in] component swap mode
848 PixelFormatInfo
* pInfo
///< [out] output per component info
851 // 1. Get componet bits
855 GetCompBits(8, 0, 0, 0, pInfo
);
857 case ADDR_COLOR_1_5_5_5
:
858 GetCompBits(5, 5, 5, 1, pInfo
);
860 case ADDR_COLOR_5_6_5
:
861 GetCompBits(8, 6, 5, 0, pInfo
);
863 case ADDR_COLOR_6_5_5
:
864 GetCompBits(5, 5, 6, 0, pInfo
);
867 GetCompBits(8, 8, 0, 0, pInfo
);
869 case ADDR_COLOR_4_4_4_4
:
870 GetCompBits(4, 4, 4, 4, pInfo
);
873 GetCompBits(16, 0, 0, 0, pInfo
);
875 case ADDR_COLOR_8_8_8_8
:
876 GetCompBits(8, 8, 8, 8, pInfo
);
878 case ADDR_COLOR_2_10_10_10
:
879 GetCompBits(10, 10, 10, 2, pInfo
);
881 case ADDR_COLOR_10_11_11
:
882 GetCompBits(11, 11, 10, 0, pInfo
);
884 case ADDR_COLOR_11_11_10
:
885 GetCompBits(10, 11, 11, 0, pInfo
);
887 case ADDR_COLOR_16_16
:
888 GetCompBits(16, 16, 0, 0, pInfo
);
890 case ADDR_COLOR_16_16_16_16
:
891 GetCompBits(16, 16, 16, 16, pInfo
);
893 case ADDR_COLOR_16_FLOAT
:
894 GetCompBits(16, 0, 0, 0, pInfo
);
896 case ADDR_COLOR_16_16_FLOAT
:
897 GetCompBits(16, 16, 0, 0, pInfo
);
899 case ADDR_COLOR_32_FLOAT
:
900 GetCompBits(32, 0, 0, 0, pInfo
);
902 case ADDR_COLOR_32_32_FLOAT
:
903 GetCompBits(32, 32, 0, 0, pInfo
);
905 case ADDR_COLOR_16_16_16_16_FLOAT
:
906 GetCompBits(16, 16, 16, 16, pInfo
);
908 case ADDR_COLOR_32_32_32_32_FLOAT
:
909 GetCompBits(32, 32, 32, 32, pInfo
);
913 GetCompBits(32, 0, 0, 0, pInfo
);
915 case ADDR_COLOR_32_32
:
916 GetCompBits(32, 32, 0, 0, pInfo
);
918 case ADDR_COLOR_32_32_32_32
:
919 GetCompBits(32, 32, 32, 32, pInfo
);
921 case ADDR_COLOR_10_10_10_2
:
922 GetCompBits(2, 10, 10, 10, pInfo
);
924 case ADDR_COLOR_10_11_11_FLOAT
:
925 GetCompBits(11, 11, 10, 0, pInfo
);
927 case ADDR_COLOR_11_11_10_FLOAT
:
928 GetCompBits(10, 11, 11, 0, pInfo
);
930 case ADDR_COLOR_5_5_5_1
:
931 GetCompBits(1, 5, 5, 5, pInfo
);
933 case ADDR_COLOR_3_3_2
:
934 GetCompBits(2, 3, 3, 0, pInfo
);
937 GetCompBits(4, 4, 0, 0, pInfo
);
939 case ADDR_COLOR_8_24
:
940 case ADDR_COLOR_8_24_FLOAT
: // same bit count, fall through
941 GetCompBits(24, 8, 0, 0, pInfo
);
943 case ADDR_COLOR_24_8
:
944 case ADDR_COLOR_24_8_FLOAT
: // same bit count, fall through
945 GetCompBits(8, 24, 0, 0, pInfo
);
947 case ADDR_COLOR_X24_8_32_FLOAT
:
948 GetCompBits(32, 8, 0, 0, pInfo
);
951 case ADDR_COLOR_INVALID
:
952 GetCompBits(0, 0, 0, 0, pInfo
);
956 GetCompBits(0, 0, 0, 0, pInfo
);
960 // 2. Get component number type
962 GetCompType(format
, number
, pInfo
);
964 // 3. Swap components if needed
966 GetCompSwap(swap
, pInfo
);
970 ****************************************************************************************************
971 * ElemLib::PixGetDepthCompInfo
974 * Get per component info for depth surface
979 ****************************************************************************************************
981 VOID
ElemLib::PixGetDepthCompInfo(
982 AddrDepthFormat format
, ///< [in] surface format, read from register
983 PixelFormatInfo
* pInfo
///< [out] output per component bits and type
986 if (m_depthPlanarType
== ADDR_DEPTH_PLANAR_R800
)
988 if (format
== ADDR_DEPTH_8_24_FLOAT
)
990 format
= ADDR_DEPTH_X24_8_32_FLOAT
; // Use this format to represent R800's D24FS8
993 if (format
== ADDR_DEPTH_X8_24_FLOAT
)
995 format
= ADDR_DEPTH_32_FLOAT
;
1002 GetCompBits(16, 0, 0, 0, pInfo
);
1004 case ADDR_DEPTH_8_24
:
1005 case ADDR_DEPTH_8_24_FLOAT
: // similar format, fall through
1006 GetCompBits(24, 8, 0, 0, pInfo
);
1008 case ADDR_DEPTH_X8_24
:
1009 case ADDR_DEPTH_X8_24_FLOAT
: // similar format, fall through
1010 GetCompBits(24, 0, 0, 0, pInfo
);
1012 case ADDR_DEPTH_32_FLOAT
:
1013 GetCompBits(32, 0, 0, 0, pInfo
);
1015 case ADDR_DEPTH_X24_8_32_FLOAT
:
1016 GetCompBits(32, 8, 0, 0, pInfo
);
1018 case ADDR_DEPTH_INVALID
:
1019 GetCompBits(0, 0, 0, 0, pInfo
);
1023 GetCompBits(0, 0, 0, 0, pInfo
);
1030 pInfo
->numType
[0] = ADDR_UNORM_R6XX
;
1031 pInfo
->numType
[1] = ADDR_ZERO
;
1033 case ADDR_DEPTH_8_24
:
1034 pInfo
->numType
[0] = ADDR_UNORM_R6XXDB
;
1035 pInfo
->numType
[1] = ADDR_UINT_BITS
;
1037 case ADDR_DEPTH_8_24_FLOAT
:
1038 pInfo
->numType
[0] = ADDR_U4FLOATC
;
1039 pInfo
->numType
[1] = ADDR_UINT_BITS
;
1041 case ADDR_DEPTH_X8_24
:
1042 pInfo
->numType
[0] = ADDR_UNORM_R6XXDB
;
1043 pInfo
->numType
[1] = ADDR_ZERO
;
1045 case ADDR_DEPTH_X8_24_FLOAT
:
1046 pInfo
->numType
[0] = ADDR_U4FLOATC
;
1047 pInfo
->numType
[1] = ADDR_ZERO
;
1049 case ADDR_DEPTH_32_FLOAT
:
1050 pInfo
->numType
[0] = ADDR_S8FLOAT32
;
1051 pInfo
->numType
[1] = ADDR_ZERO
;
1053 case ADDR_DEPTH_X24_8_32_FLOAT
:
1054 pInfo
->numType
[0] = ADDR_S8FLOAT32
;
1055 pInfo
->numType
[1] = ADDR_UINT_BITS
;
1058 pInfo
->numType
[0] = ADDR_NO_NUMBER
;
1059 pInfo
->numType
[1] = ADDR_NO_NUMBER
;
1063 pInfo
->numType
[2] = ADDR_NO_NUMBER
;
1064 pInfo
->numType
[3] = ADDR_NO_NUMBER
;
1068 ****************************************************************************************************
1069 * ElemLib::PixGetExportNorm
1072 * Check if fp16 export norm can be enabled.
1075 * TRUE if this can be enabled.
1077 ****************************************************************************************************
1079 BOOL_32
ElemLib::PixGetExportNorm(
1080 AddrColorFormat colorFmt
, ///< [in] surface format, read from register
1081 AddrSurfaceNumber numberFmt
, ///< [in] pixel number type
1082 AddrSurfaceSwap swap
///< [in] components swap type
1085 BOOL_32 enabled
= TRUE
;
1087 PixelFormatInfo formatInfo
;
1089 PixGetColorCompInfo(colorFmt
, numberFmt
, swap
, &formatInfo
);
1091 for (UINT_32 c
= 0; c
< 4; c
++)
1093 if (m_fp16ExportNorm
)
1095 if (((formatInfo
.compBit
[c
] > 11) || (formatInfo
.numType
[c
] > ADDR_USCALED
)) &&
1096 (formatInfo
.numType
[c
] != ADDR_U4FLOATC
) &&
1097 (formatInfo
.numType
[c
] != ADDR_S5FLOAT
) &&
1098 (formatInfo
.numType
[c
] != ADDR_S5FLOATM
) &&
1099 (formatInfo
.numType
[c
] != ADDR_U5FLOAT
) &&
1100 (formatInfo
.numType
[c
] != ADDR_U3FLOATM
))
1108 if ((formatInfo
.compBit
[c
] > 11) || (formatInfo
.numType
[c
] > ADDR_USCALED
))
1120 ****************************************************************************************************
1121 * ElemLib::AdjustSurfaceInfo
1124 * Adjust bpp/base pitch/width/height according to elemMode and expandX/Y
1128 ****************************************************************************************************
1130 VOID
ElemLib::AdjustSurfaceInfo(
1131 ElemMode elemMode
, ///< [in] element mode
1132 UINT_32 expandX
, ///< [in] decompression expansion factor in X
1133 UINT_32 expandY
, ///< [in] decompression expansion factor in Y
1134 UINT_32
* pBpp
, ///< [in,out] bpp
1135 UINT_32
* pBasePitch
, ///< [in,out] base pitch
1136 UINT_32
* pWidth
, ///< [in,out] width
1137 UINT_32
* pHeight
) ///< [in,out] height
1144 BOOL_32 bBCnFormat
= FALSE
;
1146 ADDR_ASSERT(pBpp
!= NULL
);
1147 ADDR_ASSERT(pWidth
!= NULL
&& pHeight
!= NULL
&& pBasePitch
!= NULL
);
1156 packedBits
= bpp
/ expandX
/ expandY
;
1158 case ADDR_PACKED_STD
: // Different bit order
1159 case ADDR_PACKED_REV
:
1160 packedBits
= bpp
* expandX
* expandY
;
1162 case ADDR_PACKED_GBGR
:
1163 case ADDR_PACKED_BGRG
:
1164 packedBits
= bpp
; // 32-bit packed ==> 2 32-bit result
1166 case ADDR_PACKED_BC1
: // Fall through
1167 case ADDR_PACKED_BC4
:
1171 case ADDR_PACKED_BC2
: // Fall through
1172 case ADDR_PACKED_BC3
: // Fall through
1173 case ADDR_PACKED_BC5
: // Fall through
1176 case ADDR_PACKED_ASTC
:
1177 case ADDR_PACKED_ETC2_128BPP
:
1180 case ADDR_PACKED_ETC2_64BPP
:
1183 case ADDR_ROUND_BY_HALF
: // Fall through
1184 case ADDR_ROUND_TRUNCATE
: // Fall through
1185 case ADDR_ROUND_DITHER
: // Fall through
1186 case ADDR_UNCOMPRESSED
:
1191 ADDR_ASSERT_ALWAYS();
1198 if (pWidth
&& pHeight
&& pBasePitch
)
1200 basePitch
= *pBasePitch
;
1204 if ((expandX
> 1) || (expandY
> 1))
1206 if (elemMode
== ADDR_EXPANDED
)
1208 basePitch
*= expandX
;
1214 // Evergreen family workaround
1215 if (bBCnFormat
&& (m_pAddrLib
->GetChipFamily() == ADDR_CHIP_FAMILY_R8XX
))
1217 // For BCn we now pad it to POW2 at the beginning so it is safe to
1218 // divide by 4 directly
1219 basePitch
= basePitch
/ expandX
;
1220 width
= width
/ expandX
;
1221 height
= height
/ expandY
;
1223 width
= (width
== 0) ? 1 : width
;
1224 height
= (height
== 0) ? 1 : height
;
1226 if ((*pWidth
> PowTwoAlign(width
, 8) * expandX
) ||
1227 (*pHeight
> PowTwoAlign(height
, 8) * expandY
)) // 8 is 1D tiling alignment
1229 // if this assertion is hit we may have issues if app samples
1230 // rightmost/bottommost pixels
1231 ADDR_ASSERT_ALWAYS();
1235 else // Not BCn format we still keep old way (FMT_1? No real test yet)
1237 basePitch
= (basePitch
+ expandX
- 1) / expandX
;
1238 width
= (width
+ expandX
- 1) / expandX
;
1239 height
= (height
+ expandY
- 1) / expandY
;
1243 *pBasePitch
= basePitch
; // 0 is legal value for base pitch.
1244 *pWidth
= (width
== 0) ? 1 : width
;
1245 *pHeight
= (height
== 0) ? 1 : height
;
1246 } //if (pWidth && pHeight && pBasePitch)
1251 ****************************************************************************************************
1252 * ElemLib::RestoreSurfaceInfo
1255 * Reverse operation of AdjustSurfaceInfo
1259 ****************************************************************************************************
1261 VOID
ElemLib::RestoreSurfaceInfo(
1262 ElemMode elemMode
, ///< [in] element mode
1263 UINT_32 expandX
, ///< [in] decompression expansion factor in X
1264 UINT_32 expandY
, ///< [out] decompression expansion factor in Y
1265 UINT_32
* pBpp
, ///< [in,out] bpp
1266 UINT_32
* pWidth
, ///< [in,out] width
1267 UINT_32
* pHeight
) ///< [in,out] height
1269 UINT_32 originalBits
;
1274 ADDR_ASSERT(pBpp
!= NULL
);
1275 ADDR_ASSERT(pWidth
!= NULL
&& pHeight
!= NULL
);
1284 originalBits
= bpp
* expandX
* expandY
;
1286 case ADDR_PACKED_STD
: // Different bit order
1287 case ADDR_PACKED_REV
:
1288 originalBits
= bpp
/ expandX
/ expandY
;
1290 case ADDR_PACKED_GBGR
:
1291 case ADDR_PACKED_BGRG
:
1292 originalBits
= bpp
; // 32-bit packed ==> 2 32-bit result
1294 case ADDR_PACKED_BC1
: // Fall through
1295 case ADDR_PACKED_BC4
:
1298 case ADDR_PACKED_BC2
: // Fall through
1299 case ADDR_PACKED_BC3
: // Fall through
1300 case ADDR_PACKED_BC5
:
1302 case ADDR_PACKED_ASTC
:
1303 case ADDR_PACKED_ETC2_128BPP
:
1306 case ADDR_PACKED_ETC2_64BPP
:
1309 case ADDR_ROUND_BY_HALF
: // Fall through
1310 case ADDR_ROUND_TRUNCATE
: // Fall through
1311 case ADDR_ROUND_DITHER
: // Fall through
1312 case ADDR_UNCOMPRESSED
:
1317 ADDR_ASSERT_ALWAYS();
1321 *pBpp
= originalBits
;
1324 if (pWidth
&& pHeight
)
1329 if ((expandX
> 1) || (expandY
> 1))
1331 if (elemMode
== ADDR_EXPANDED
)
1343 *pWidth
= (width
== 0) ? 1 : width
;
1344 *pHeight
= (height
== 0) ? 1 : height
;
1349 ****************************************************************************************************
1350 * ElemLib::GetBitsPerPixel
1353 * Compute the total bits per element according to a format
1354 * code. For compressed formats, this is not the same as
1355 * the number of bits per decompressed element.
1359 ****************************************************************************************************
1361 UINT_32
ElemLib::GetBitsPerPixel(
1362 AddrFormat format
, ///< [in] surface format code
1363 ElemMode
* pElemMode
, ///< [out] element mode
1364 UINT_32
* pExpandX
, ///< [out] decompression expansion factor in X
1365 UINT_32
* pExpandY
, ///< [out] decompression expansion factor in Y
1366 UINT_32
* pUnusedBits
) ///< [out] bits unused
1369 UINT_32 expandX
= 1;
1370 UINT_32 expandY
= 1;
1371 UINT_32 bitUnused
= 0;
1372 ElemMode elemMode
= ADDR_UNCOMPRESSED
; // default value
1379 case ADDR_FMT_1_5_5_5
:
1380 case ADDR_FMT_5_6_5
:
1381 case ADDR_FMT_6_5_5
:
1383 case ADDR_FMT_4_4_4_4
:
1385 case ADDR_FMT_16_FLOAT
:
1388 case ADDR_FMT_GB_GR
: // treat as FMT_8_8
1389 elemMode
= ADDR_PACKED_GBGR
;
1392 case ADDR_FMT_BG_RG
: // treat as FMT_8_8
1393 elemMode
= ADDR_PACKED_BGRG
;
1396 case ADDR_FMT_8_8_8_8
:
1397 case ADDR_FMT_2_10_10_10
:
1398 case ADDR_FMT_10_11_11
:
1399 case ADDR_FMT_11_11_10
:
1400 case ADDR_FMT_16_16
:
1401 case ADDR_FMT_16_16_FLOAT
:
1403 case ADDR_FMT_32_FLOAT
:
1405 case ADDR_FMT_24_8_FLOAT
:
1408 case ADDR_FMT_16_16_16_16
:
1409 case ADDR_FMT_16_16_16_16_FLOAT
:
1410 case ADDR_FMT_32_32
:
1411 case ADDR_FMT_32_32_FLOAT
:
1415 case ADDR_FMT_32_32_32_32
:
1416 case ADDR_FMT_32_32_32_32_FLOAT
:
1419 case ADDR_FMT_INVALID
:
1422 case ADDR_FMT_1_REVERSED
:
1423 elemMode
= ADDR_PACKED_REV
;
1428 elemMode
= ADDR_PACKED_STD
;
1433 case ADDR_FMT_3_3_2
:
1436 case ADDR_FMT_5_5_5_1
:
1439 case ADDR_FMT_32_AS_8
:
1440 case ADDR_FMT_32_AS_8_8
:
1442 case ADDR_FMT_8_24_FLOAT
:
1443 case ADDR_FMT_10_10_10_2
:
1444 case ADDR_FMT_10_11_11_FLOAT
:
1445 case ADDR_FMT_11_11_10_FLOAT
:
1446 case ADDR_FMT_5_9_9_9_SHAREDEXP
:
1449 case ADDR_FMT_X24_8_32_FLOAT
:
1453 case ADDR_FMT_8_8_8
:
1454 elemMode
= ADDR_EXPANDED
;
1455 bpp
= 24;//@@ 8; // read 3 elements per pixel
1458 case ADDR_FMT_16_16_16
:
1459 case ADDR_FMT_16_16_16_FLOAT
:
1460 elemMode
= ADDR_EXPANDED
;
1461 bpp
= 48;//@@ 16; // read 3 elements per pixel
1464 case ADDR_FMT_32_32_32_FLOAT
:
1465 case ADDR_FMT_32_32_32
:
1466 elemMode
= ADDR_EXPANDED
;
1468 bpp
= 96;//@@ 32; // read 3 elements per pixel
1471 elemMode
= ADDR_PACKED_BC1
;
1477 elemMode
= ADDR_PACKED_BC4
;
1483 elemMode
= ADDR_PACKED_BC2
;
1489 elemMode
= ADDR_PACKED_BC3
;
1495 case ADDR_FMT_BC6
: // reuse ADDR_PACKED_BC5
1496 case ADDR_FMT_BC7
: // reuse ADDR_PACKED_BC5
1497 elemMode
= ADDR_PACKED_BC5
;
1503 case ADDR_FMT_ETC2_64BPP
:
1504 elemMode
= ADDR_PACKED_ETC2_64BPP
;
1510 case ADDR_FMT_ETC2_128BPP
:
1511 elemMode
= ADDR_PACKED_ETC2_128BPP
;
1517 case ADDR_FMT_ASTC_4x4
:
1518 elemMode
= ADDR_PACKED_ASTC
;
1524 case ADDR_FMT_ASTC_5x4
:
1525 elemMode
= ADDR_PACKED_ASTC
;
1531 case ADDR_FMT_ASTC_5x5
:
1532 elemMode
= ADDR_PACKED_ASTC
;
1538 case ADDR_FMT_ASTC_6x5
:
1539 elemMode
= ADDR_PACKED_ASTC
;
1545 case ADDR_FMT_ASTC_6x6
:
1546 elemMode
= ADDR_PACKED_ASTC
;
1552 case ADDR_FMT_ASTC_8x5
:
1553 elemMode
= ADDR_PACKED_ASTC
;
1559 case ADDR_FMT_ASTC_8x6
:
1560 elemMode
= ADDR_PACKED_ASTC
;
1566 case ADDR_FMT_ASTC_8x8
:
1567 elemMode
= ADDR_PACKED_ASTC
;
1573 case ADDR_FMT_ASTC_10x5
:
1574 elemMode
= ADDR_PACKED_ASTC
;
1580 case ADDR_FMT_ASTC_10x6
:
1581 elemMode
= ADDR_PACKED_ASTC
;
1587 case ADDR_FMT_ASTC_10x8
:
1588 elemMode
= ADDR_PACKED_ASTC
;
1594 case ADDR_FMT_ASTC_10x10
:
1595 elemMode
= ADDR_PACKED_ASTC
;
1601 case ADDR_FMT_ASTC_12x10
:
1602 elemMode
= ADDR_PACKED_ASTC
;
1608 case ADDR_FMT_ASTC_12x12
:
1609 elemMode
= ADDR_PACKED_ASTC
;
1617 ADDR_ASSERT_ALWAYS();
1619 // @@ or should this be an error?
1622 SafeAssign(pExpandX
, expandX
);
1623 SafeAssign(pExpandY
, expandY
);
1624 SafeAssign(pUnusedBits
, bitUnused
);
1625 SafeAssign(reinterpret_cast<UINT_32
*>(pElemMode
), elemMode
);
1631 ****************************************************************************************************
1632 * ElemLib::GetCompBits
1635 * Set each component's bit size and bit start. And set element mode and number type
1639 ****************************************************************************************************
1641 VOID
ElemLib::GetCompBits(
1642 UINT_32 c0
, ///< [in] bits of component 0
1643 UINT_32 c1
, ///< [in] bits of component 1
1644 UINT_32 c2
, ///< [in] bits of component 2
1645 UINT_32 c3
, ///< [in] bits of component 3
1646 PixelFormatInfo
* pInfo
, ///< [out] per component info out
1647 ElemMode elemMode
) ///< [in] element mode
1651 pInfo
->compBit
[0] = c0
;
1652 pInfo
->compBit
[1] = c1
;
1653 pInfo
->compBit
[2] = c2
;
1654 pInfo
->compBit
[3] = c3
;
1656 pInfo
->compStart
[0] = 0;
1657 pInfo
->compStart
[1] = c0
;
1658 pInfo
->compStart
[2] = c0
+c1
;
1659 pInfo
->compStart
[3] = c0
+c1
+c2
;
1661 pInfo
->elemMode
= elemMode
;
1662 // still needed since component swap may depend on number of components
1663 for (INT i
=0; i
<4; i
++)
1665 if (pInfo
->compBit
[i
] == 0)
1667 pInfo
->compStart
[i
] = 0; // all null components start at bit 0
1668 pInfo
->numType
[i
] = ADDR_NO_NUMBER
; // and have no number type
1678 ****************************************************************************************************
1679 * ElemLib::GetCompBits
1682 * Set the clear color (or clear depth/stencil) for a surface
1685 * If clearColor is zero, a default clear value is used in place of comps[4].
1686 * If float32 is set, full precision is used, else the mantissa is reduced to 12-bits
1690 ****************************************************************************************************
1692 VOID
ElemLib::SetClearComps(
1693 ADDR_FLT_32 comps
[4], ///< [in,out] components
1694 BOOL_32 clearColor
, ///< [in] TRUE if clear color is set (CLEAR_COLOR)
1695 BOOL_32 float32
) ///< [in] TRUE if float32 component (BLEND_FLOAT32)
1699 // Use default clearvalues if clearColor is disabled
1700 if (clearColor
== FALSE
)
1709 // Otherwise use the (modified) clear value
1713 { // If full precision, use clear value unchanged
1717 //comps[i] = comps[i];
1719 // Else if it is a NaN, use the standard NaN value
1720 else if ((comps
[i
].u
& 0x7FFFFFFF) > 0x7F800000)
1722 comps
[i
].u
= 0xFFC00000;
1724 // Else reduce the mantissa precision
1727 comps
[i
].u
= comps
[i
].u
& 0xFFFFF000;
1734 ****************************************************************************************************
1735 * ElemLib::IsBlockCompressed
1738 * TRUE if this is block compressed format
1744 ****************************************************************************************************
1746 BOOL_32
ElemLib::IsBlockCompressed(
1747 AddrFormat format
) ///< [in] Format
1749 return (((format
>= ADDR_FMT_BC1
) && (format
<= ADDR_FMT_BC7
)) ||
1750 ((format
>= ADDR_FMT_ASTC_4x4
) && (format
<= ADDR_FMT_ETC2_128BPP
)));
1755 ****************************************************************************************************
1756 * ElemLib::IsCompressed
1759 * TRUE if this is block compressed format or 1 bit format
1765 ****************************************************************************************************
1767 BOOL_32
ElemLib::IsCompressed(
1768 AddrFormat format
) ///< [in] Format
1770 return IsBlockCompressed(format
) || format
== ADDR_FMT_BC1
|| format
== ADDR_FMT_BC7
;
1774 ****************************************************************************************************
1775 * ElemLib::IsExpand3x
1778 * TRUE if this is 3x expand format
1784 ****************************************************************************************************
1786 BOOL_32
ElemLib::IsExpand3x(
1787 AddrFormat format
) ///< [in] Format
1789 BOOL_32 is3x
= FALSE
;
1793 case ADDR_FMT_8_8_8
:
1794 case ADDR_FMT_16_16_16
:
1795 case ADDR_FMT_16_16_16_FLOAT
:
1796 case ADDR_FMT_32_32_32
:
1797 case ADDR_FMT_32_32_32_FLOAT
: