Lines Matching refs:TextureFormat
274 inline float channelToFloat (const deUint8* value, TextureFormat::ChannelType type) in channelToFloat()
277 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40); in channelToFloat()
281 case TextureFormat::SNORM_INT8: return de::max(-1.0f, (float)*((const deInt8*)value) / 127.0f); in channelToFloat()
282 …case TextureFormat::SNORM_INT16: return de::max(-1.0f, (float)*((const deInt16*)value) / 32767.0f… in channelToFloat()
283 …case TextureFormat::SNORM_INT32: return de::max(-1.0f, (float)*((const deInt32*)value) / 21474836… in channelToFloat()
284 case TextureFormat::UNORM_INT8: return (float)*((const deUint8*)value) / 255.0f; in channelToFloat()
285 case TextureFormat::UNORM_INT16: return (float)*((const deUint16*)value) / 65535.0f; in channelToFloat()
286 case TextureFormat::UNORM_INT24: return (float)readUint24(value) / 16777215.0f; in channelToFloat()
287 case TextureFormat::UNORM_INT32: return (float)*((const deUint32*)value) / 4294967295.0f; in channelToFloat()
288 case TextureFormat::SIGNED_INT8: return (float)*((const deInt8*)value); in channelToFloat()
289 case TextureFormat::SIGNED_INT16: return (float)*((const deInt16*)value); in channelToFloat()
290 case TextureFormat::SIGNED_INT32: return (float)*((const deInt32*)value); in channelToFloat()
291 case TextureFormat::UNSIGNED_INT8: return (float)*((const deUint8*)value); in channelToFloat()
292 case TextureFormat::UNSIGNED_INT16: return (float)*((const deUint16*)value); in channelToFloat()
293 case TextureFormat::UNSIGNED_INT24: return (float)readUint24(value); in channelToFloat()
294 case TextureFormat::UNSIGNED_INT32: return (float)*((const deUint32*)value); in channelToFloat()
295 case TextureFormat::HALF_FLOAT: return deFloat16To32(*(const deFloat16*)value); in channelToFloat()
296 case TextureFormat::FLOAT: return *((const float*)value); in channelToFloat()
297 case TextureFormat::FLOAT64: return (float)*((const double*)value); in channelToFloat()
298 case TextureFormat::UNORM_SHORT_10: return (float)((*((const deUint16*)value)) >> 6u) / 1023.0f; in channelToFloat()
299 case TextureFormat::UNORM_SHORT_12: return (float)((*((const deUint16*)value)) >> 4u) / 4095.0f; in channelToFloat()
306 inline int channelToInt (const deUint8* value, TextureFormat::ChannelType type) in channelToInt()
309 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40); in channelToInt()
313 case TextureFormat::SNORM_INT8: return (int)*((const deInt8*)value); in channelToInt()
314 case TextureFormat::SNORM_INT16: return (int)*((const deInt16*)value); in channelToInt()
315 case TextureFormat::SNORM_INT32: return (int)*((const deInt32*)value); in channelToInt()
316 case TextureFormat::UNORM_INT8: return (int)*((const deUint8*)value); in channelToInt()
317 case TextureFormat::UNORM_INT16: return (int)*((const deUint16*)value); in channelToInt()
318 case TextureFormat::UNORM_INT24: return (int)readUint24(value); in channelToInt()
319 case TextureFormat::UNORM_INT32: return (int)*((const deUint32*)value); in channelToInt()
320 case TextureFormat::SIGNED_INT8: return (int)*((const deInt8*)value); in channelToInt()
321 case TextureFormat::SIGNED_INT16: return (int)*((const deInt16*)value); in channelToInt()
322 case TextureFormat::SIGNED_INT32: return (int)*((const deInt32*)value); in channelToInt()
323 case TextureFormat::UNSIGNED_INT8: return (int)*((const deUint8*)value); in channelToInt()
324 case TextureFormat::UNSIGNED_INT16: return (int)*((const deUint16*)value); in channelToInt()
325 case TextureFormat::UNSIGNED_INT24: return (int)readUint24(value); in channelToInt()
326 case TextureFormat::UNSIGNED_INT32: return (int)*((const deUint32*)value); in channelToInt()
327 case TextureFormat::HALF_FLOAT: return (int)deFloat16To32(*(const deFloat16*)value); in channelToInt()
328 case TextureFormat::FLOAT: return (int)*((const float*)value); in channelToInt()
329 case TextureFormat::FLOAT64: return (int)*((const double*)value); in channelToInt()
330 case TextureFormat::UNORM_SHORT_10: return (int)((*(((const deUint16*)value))) >> 6u); in channelToInt()
331 case TextureFormat::UNORM_SHORT_12: return (int)((*(((const deUint16*)value))) >> 4u); in channelToInt()
338 void floatToChannel (deUint8* dst, float src, TextureFormat::ChannelType type) in floatToChannel()
341 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40); in floatToChannel()
345 …case TextureFormat::SNORM_INT8: *((deInt8*)dst) = convertSatRte<deInt8> (src * 127.0f); br… in floatToChannel()
346 …case TextureFormat::SNORM_INT16: *((deInt16*)dst) = convertSatRte<deInt16> (src * 32767.0f); b… in floatToChannel()
347 …case TextureFormat::SNORM_INT32: *((deInt32*)dst) = convertSatRte<deInt32> (src * 2147483647.0f)… in floatToChannel()
348 …case TextureFormat::UNORM_INT8: *((deUint8*)dst) = convertSatRte<deUint8> (src * 255.0f); br… in floatToChannel()
349 …case TextureFormat::UNORM_INT16: *((deUint16*)dst) = convertSatRte<deUint16> (src * 65535.0f); … in floatToChannel()
350 …case TextureFormat::UNORM_INT24: writeUint24(dst, convertSatRteUint24 (src * 16777215.0f)); … in floatToChannel()
351 …case TextureFormat::UNORM_INT32: *((deUint32*)dst) = convertSatRte<deUint32> (src * 4294967295.0… in floatToChannel()
352 case TextureFormat::SIGNED_INT8: *((deInt8*)dst) = convertSatRte<deInt8> (src); break; in floatToChannel()
353 case TextureFormat::SIGNED_INT16: *((deInt16*)dst) = convertSatRte<deInt16> (src); break; in floatToChannel()
354 case TextureFormat::SIGNED_INT32: *((deInt32*)dst) = convertSatRte<deInt32> (src); break; in floatToChannel()
355 case TextureFormat::UNSIGNED_INT8: *((deUint8*)dst) = convertSatRte<deUint8> (src); break; in floatToChannel()
356 …case TextureFormat::UNSIGNED_INT16: *((deUint16*)dst) = convertSatRte<deUint16> (src); brea… in floatToChannel()
357 case TextureFormat::UNSIGNED_INT24: writeUint24(dst, convertSatRteUint24 (src)); break; in floatToChannel()
358 …case TextureFormat::UNSIGNED_INT32: *((deUint32*)dst) = convertSatRte<deUint32> (src); brea… in floatToChannel()
359 case TextureFormat::HALF_FLOAT: *((deFloat16*)dst) = deFloat32To16 (src); break; in floatToChannel()
360 case TextureFormat::FLOAT: *((float*)dst) = src; break; in floatToChannel()
361 case TextureFormat::FLOAT64: *((double*)dst) = (double)src; break; in floatToChannel()
362 …case TextureFormat::UNORM_SHORT_10: *((deUint16*)dst) = (deUint16)(convertSatRteUint10(src * 102… in floatToChannel()
363 …case TextureFormat::UNORM_SHORT_12: *((deUint16*)dst) = (deUint16)(convertSatRteUint12(src * 409… in floatToChannel()
425 void intToChannel (deUint8* dst, int src, TextureFormat::ChannelType type) in intToChannel()
428 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40); in intToChannel()
432 case TextureFormat::SNORM_INT8: *((deInt8*)dst) = convertSat<deInt8> (src); break; in intToChannel()
433 case TextureFormat::SNORM_INT16: *((deInt16*)dst) = convertSat<deInt16> (src); break; in intToChannel()
434 case TextureFormat::UNORM_INT8: *((deUint8*)dst) = convertSat<deUint8> (src); break; in intToChannel()
435 case TextureFormat::UNORM_INT16: *((deUint16*)dst) = convertSat<deUint16> (src); break; in intToChannel()
436 case TextureFormat::UNORM_INT24: writeUint24(dst, convertSatUint24 (src)); break; in intToChannel()
437 case TextureFormat::SIGNED_INT8: *((deInt8*)dst) = convertSat<deInt8> (src); break; in intToChannel()
438 case TextureFormat::SIGNED_INT16: *((deInt16*)dst) = convertSat<deInt16> (src); break; in intToChannel()
439 case TextureFormat::SIGNED_INT32: *((deInt32*)dst) = convertSat<deInt32> (src); break; in intToChannel()
440 …case TextureFormat::UNSIGNED_INT8: *((deUint8*)dst) = convertSat<deUint8> ((deUint32)src); break; in intToChannel()
441 …case TextureFormat::UNSIGNED_INT16: *((deUint16*)dst) = convertSat<deUint16> ((deUint32)src); br… in intToChannel()
442 …case TextureFormat::UNSIGNED_INT24: writeUint24(dst, convertSatUint24 ((deUint32)src)); break; in intToChannel()
443 …case TextureFormat::UNSIGNED_INT32: *((deUint32*)dst) = convertSat<deUint32> ((deUint32)src); br… in intToChannel()
444 case TextureFormat::HALF_FLOAT: *((deFloat16*)dst) = deFloat32To16((float)src); break; in intToChannel()
445 case TextureFormat::FLOAT: *((float*)dst) = (float)src; break; in intToChannel()
446 case TextureFormat::FLOAT64: *((double*)dst) = (double)src; break; in intToChannel()
447 …case TextureFormat::UNORM_SHORT_10: *((deUint16*)dst) = (deUint16)(convertSatUint10(src) << 6u);… in intToChannel()
448 …case TextureFormat::UNORM_SHORT_12: *((deUint16*)dst) = (deUint16)(convertSatUint12(src) << 4u);… in intToChannel()
530 bool isColorOrder (TextureFormat::ChannelOrder order) in isColorOrder()
532 DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 21); in isColorOrder()
536 case TextureFormat::R: in isColorOrder()
537 case TextureFormat::A: in isColorOrder()
538 case TextureFormat::I: in isColorOrder()
539 case TextureFormat::L: in isColorOrder()
540 case TextureFormat::LA: in isColorOrder()
541 case TextureFormat::RG: in isColorOrder()
542 case TextureFormat::RA: in isColorOrder()
543 case TextureFormat::RGB: in isColorOrder()
544 case TextureFormat::RGBA: in isColorOrder()
545 case TextureFormat::ARGB: in isColorOrder()
546 case TextureFormat::BGR: in isColorOrder()
547 case TextureFormat::BGRA: in isColorOrder()
548 case TextureFormat::sR: in isColorOrder()
549 case TextureFormat::sRG: in isColorOrder()
550 case TextureFormat::sRGB: in isColorOrder()
551 case TextureFormat::sRGBA: in isColorOrder()
552 case TextureFormat::sBGR: in isColorOrder()
553 case TextureFormat::sBGRA: in isColorOrder()
563 bool isValid (TextureFormat format) in isValid()
569 case TextureFormat::SNORM_INT8: in isValid()
570 case TextureFormat::SNORM_INT16: in isValid()
571 case TextureFormat::SNORM_INT32: in isValid()
574 case TextureFormat::UNORM_INT8: in isValid()
575 case TextureFormat::UNORM_INT16: in isValid()
576 case TextureFormat::UNORM_INT24: in isValid()
577 case TextureFormat::UNORM_INT32: in isValid()
578 return isColor || format.order == TextureFormat::D; in isValid()
580 case TextureFormat::UNORM_BYTE_44: in isValid()
581 case TextureFormat::UNSIGNED_BYTE_44: in isValid()
582 return format.order == TextureFormat::RG; in isValid()
584 case TextureFormat::UNORM_SHORT_565: in isValid()
585 case TextureFormat::UNORM_SHORT_555: in isValid()
586 case TextureFormat::UNSIGNED_SHORT_565: in isValid()
587 return format.order == TextureFormat::RGB || format.order == TextureFormat::BGR; in isValid()
589 case TextureFormat::UNORM_SHORT_4444: in isValid()
590 case TextureFormat::UNORM_SHORT_5551: in isValid()
591 case TextureFormat::UNSIGNED_SHORT_4444: in isValid()
592 case TextureFormat::UNSIGNED_SHORT_5551: in isValid()
593 return format.order == TextureFormat::RGBA || format.order == TextureFormat::BGRA; in isValid()
595 case TextureFormat::UNORM_SHORT_1555: in isValid()
596 return format.order == TextureFormat::ARGB; in isValid()
598 case TextureFormat::UNORM_INT_101010: in isValid()
599 return format.order == TextureFormat::RGB; in isValid()
601 case TextureFormat::SNORM_INT_1010102_REV: in isValid()
602 case TextureFormat::UNORM_INT_1010102_REV: in isValid()
603 case TextureFormat::SIGNED_INT_1010102_REV: in isValid()
604 case TextureFormat::UNSIGNED_INT_1010102_REV: in isValid()
605 return format.order == TextureFormat::RGBA || format.order == TextureFormat::BGRA; in isValid()
607 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: in isValid()
608 case TextureFormat::UNSIGNED_INT_999_E5_REV: in isValid()
609 return format.order == TextureFormat::RGB; in isValid()
611 case TextureFormat::UNSIGNED_INT_16_8_8: in isValid()
612 return format.order == TextureFormat::DS; in isValid()
614 case TextureFormat::UNSIGNED_INT_24_8: in isValid()
615 case TextureFormat::UNSIGNED_INT_24_8_REV: in isValid()
616 return format.order == TextureFormat::D || format.order == TextureFormat::DS; in isValid()
618 case TextureFormat::SIGNED_INT8: in isValid()
619 case TextureFormat::SIGNED_INT16: in isValid()
620 case TextureFormat::SIGNED_INT32: in isValid()
623 case TextureFormat::UNSIGNED_INT8: in isValid()
624 case TextureFormat::UNSIGNED_INT16: in isValid()
625 case TextureFormat::UNSIGNED_INT24: in isValid()
626 case TextureFormat::UNSIGNED_INT32: in isValid()
627 return isColor || format.order == TextureFormat::S; in isValid()
629 case TextureFormat::HALF_FLOAT: in isValid()
630 case TextureFormat::FLOAT: in isValid()
631 case TextureFormat::FLOAT64: in isValid()
632 return isColor || format.order == TextureFormat::D; in isValid()
634 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: in isValid()
635 return format.order == TextureFormat::DS; in isValid()
637 case TextureFormat::UNORM_SHORT_10: in isValid()
638 case TextureFormat::UNORM_SHORT_12: in isValid()
646 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40); in isValid()
649 int getNumUsedChannels (TextureFormat::ChannelOrder order) in getNumUsedChannels()
652 DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 21); in getNumUsedChannels()
656 case TextureFormat::R: return 1; in getNumUsedChannels()
657 case TextureFormat::A: return 1; in getNumUsedChannels()
658 case TextureFormat::I: return 1; in getNumUsedChannels()
659 case TextureFormat::L: return 1; in getNumUsedChannels()
660 case TextureFormat::LA: return 2; in getNumUsedChannels()
661 case TextureFormat::RG: return 2; in getNumUsedChannels()
662 case TextureFormat::RA: return 2; in getNumUsedChannels()
663 case TextureFormat::RGB: return 3; in getNumUsedChannels()
664 case TextureFormat::RGBA: return 4; in getNumUsedChannels()
665 case TextureFormat::ARGB: return 4; in getNumUsedChannels()
666 case TextureFormat::BGR: return 3; in getNumUsedChannels()
667 case TextureFormat::BGRA: return 4; in getNumUsedChannels()
668 case TextureFormat::sR: return 1; in getNumUsedChannels()
669 case TextureFormat::sRG: return 2; in getNumUsedChannels()
670 case TextureFormat::sRGB: return 3; in getNumUsedChannels()
671 case TextureFormat::sRGBA: return 4; in getNumUsedChannels()
672 case TextureFormat::sBGR: return 3; in getNumUsedChannels()
673 case TextureFormat::sBGRA: return 4; in getNumUsedChannels()
674 case TextureFormat::D: return 1; in getNumUsedChannels()
675 case TextureFormat::S: return 1; in getNumUsedChannels()
676 case TextureFormat::DS: return 2; in getNumUsedChannels()
683 int getChannelSize (TextureFormat::ChannelType type) in getChannelSize()
686 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40); in getChannelSize()
690 case TextureFormat::SNORM_INT8: return 1; in getChannelSize()
691 case TextureFormat::SNORM_INT16: return 2; in getChannelSize()
692 case TextureFormat::SNORM_INT32: return 4; in getChannelSize()
693 case TextureFormat::UNORM_INT8: return 1; in getChannelSize()
694 case TextureFormat::UNORM_INT16: return 2; in getChannelSize()
695 case TextureFormat::UNORM_INT24: return 3; in getChannelSize()
696 case TextureFormat::UNORM_INT32: return 4; in getChannelSize()
697 case TextureFormat::SIGNED_INT8: return 1; in getChannelSize()
698 case TextureFormat::SIGNED_INT16: return 2; in getChannelSize()
699 case TextureFormat::SIGNED_INT32: return 4; in getChannelSize()
700 case TextureFormat::UNSIGNED_INT8: return 1; in getChannelSize()
701 case TextureFormat::UNSIGNED_INT16: return 2; in getChannelSize()
702 case TextureFormat::UNSIGNED_INT24: return 3; in getChannelSize()
703 case TextureFormat::UNSIGNED_INT32: return 4; in getChannelSize()
704 case TextureFormat::HALF_FLOAT: return 2; in getChannelSize()
705 case TextureFormat::FLOAT: return 4; in getChannelSize()
706 case TextureFormat::FLOAT64: return 8; in getChannelSize()
707 case TextureFormat::UNORM_SHORT_10: return 2; in getChannelSize()
708 case TextureFormat::UNORM_SHORT_12: return 2; in getChannelSize()
716 int getPixelSize (TextureFormat format) in getPixelSize()
718 const TextureFormat::ChannelOrder order = format.order; in getPixelSize()
719 const TextureFormat::ChannelType type = format.type; in getPixelSize()
724 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 40); in getPixelSize()
728 case TextureFormat::UNORM_BYTE_44: in getPixelSize()
729 case TextureFormat::UNSIGNED_BYTE_44: in getPixelSize()
732 case TextureFormat::UNORM_SHORT_565: in getPixelSize()
733 case TextureFormat::UNORM_SHORT_555: in getPixelSize()
734 case TextureFormat::UNORM_SHORT_4444: in getPixelSize()
735 case TextureFormat::UNORM_SHORT_5551: in getPixelSize()
736 case TextureFormat::UNORM_SHORT_1555: in getPixelSize()
737 case TextureFormat::UNSIGNED_SHORT_565: in getPixelSize()
738 case TextureFormat::UNSIGNED_SHORT_4444: in getPixelSize()
739 case TextureFormat::UNSIGNED_SHORT_5551: in getPixelSize()
742 case TextureFormat::UNORM_INT_101010: in getPixelSize()
743 case TextureFormat::UNSIGNED_INT_999_E5_REV: in getPixelSize()
744 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: in getPixelSize()
745 case TextureFormat::SNORM_INT_1010102_REV: in getPixelSize()
746 case TextureFormat::UNORM_INT_1010102_REV: in getPixelSize()
747 case TextureFormat::SIGNED_INT_1010102_REV: in getPixelSize()
748 case TextureFormat::UNSIGNED_INT_1010102_REV: in getPixelSize()
749 case TextureFormat::UNSIGNED_INT_24_8: in getPixelSize()
750 case TextureFormat::UNSIGNED_INT_24_8_REV: in getPixelSize()
751 case TextureFormat::UNSIGNED_INT_16_8_8: in getPixelSize()
754 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: in getPixelSize()
762 int TextureFormat::getPixelSize (void) const in getPixelSize()
767 const TextureSwizzle& getChannelReadSwizzle (TextureFormat::ChannelOrder order) in getChannelReadSwizzle()
770 DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 21); in getChannelReadSwizzle()
790 case TextureFormat::R: return R; in getChannelReadSwizzle()
791 case TextureFormat::A: return A; in getChannelReadSwizzle()
792 case TextureFormat::I: return I; in getChannelReadSwizzle()
793 case TextureFormat::L: return L; in getChannelReadSwizzle()
794 case TextureFormat::LA: return LA; in getChannelReadSwizzle()
795 case TextureFormat::RG: return RG; in getChannelReadSwizzle()
796 case TextureFormat::RA: return RA; in getChannelReadSwizzle()
797 case TextureFormat::RGB: return RGB; in getChannelReadSwizzle()
798 case TextureFormat::RGBA: return RGBA; in getChannelReadSwizzle()
799 case TextureFormat::ARGB: return ARGB; in getChannelReadSwizzle()
800 case TextureFormat::BGR: return BGR; in getChannelReadSwizzle()
801 case TextureFormat::BGRA: return BGRA; in getChannelReadSwizzle()
802 case TextureFormat::sR: return R; in getChannelReadSwizzle()
803 case TextureFormat::sRG: return RG; in getChannelReadSwizzle()
804 case TextureFormat::sRGB: return RGB; in getChannelReadSwizzle()
805 case TextureFormat::sRGBA: return RGBA; in getChannelReadSwizzle()
806 case TextureFormat::sBGR: return BGR; in getChannelReadSwizzle()
807 case TextureFormat::sBGRA: return BGRA; in getChannelReadSwizzle()
808 case TextureFormat::D: return D; in getChannelReadSwizzle()
809 case TextureFormat::S: return S; in getChannelReadSwizzle()
811 case TextureFormat::DS: in getChannelReadSwizzle()
821 const TextureSwizzle& getChannelWriteSwizzle (TextureFormat::ChannelOrder order) in getChannelWriteSwizzle()
824 DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 21); in getChannelWriteSwizzle()
844 case TextureFormat::R: return R; in getChannelWriteSwizzle()
845 case TextureFormat::A: return A; in getChannelWriteSwizzle()
846 case TextureFormat::I: return I; in getChannelWriteSwizzle()
847 case TextureFormat::L: return L; in getChannelWriteSwizzle()
848 case TextureFormat::LA: return LA; in getChannelWriteSwizzle()
849 case TextureFormat::RG: return RG; in getChannelWriteSwizzle()
850 case TextureFormat::RA: return RA; in getChannelWriteSwizzle()
851 case TextureFormat::RGB: return RGB; in getChannelWriteSwizzle()
852 case TextureFormat::RGBA: return RGBA; in getChannelWriteSwizzle()
853 case TextureFormat::ARGB: return ARGB; in getChannelWriteSwizzle()
854 case TextureFormat::BGR: return BGR; in getChannelWriteSwizzle()
855 case TextureFormat::BGRA: return BGRA; in getChannelWriteSwizzle()
856 case TextureFormat::sR: return R; in getChannelWriteSwizzle()
857 case TextureFormat::sRG: return RG; in getChannelWriteSwizzle()
858 case TextureFormat::sRGB: return RGB; in getChannelWriteSwizzle()
859 case TextureFormat::sRGBA: return RGBA; in getChannelWriteSwizzle()
860 case TextureFormat::sBGR: return BGR; in getChannelWriteSwizzle()
861 case TextureFormat::sBGRA: return BGRA; in getChannelWriteSwizzle()
862 case TextureFormat::D: return D; in getChannelWriteSwizzle()
863 case TextureFormat::S: return S; in getChannelWriteSwizzle()
865 case TextureFormat::DS: in getChannelWriteSwizzle()
875 IVec3 calculatePackedPitch (const TextureFormat& format, const IVec3& size) in calculatePackedPitch()
891 ConstPixelBufferAccess::ConstPixelBufferAccess (const TextureFormat& format, int width, int height,… in ConstPixelBufferAccess()
900 ConstPixelBufferAccess::ConstPixelBufferAccess (const TextureFormat& format, const IVec3& size, con… in ConstPixelBufferAccess()
909 ConstPixelBufferAccess::ConstPixelBufferAccess (const TextureFormat& format, int width, int height,… in ConstPixelBufferAccess()
918 ConstPixelBufferAccess::ConstPixelBufferAccess (const TextureFormat& format, const IVec3& size, con… in ConstPixelBufferAccess()
936 PixelBufferAccess::PixelBufferAccess (const TextureFormat& format, int width, int height, int depth… in PixelBufferAccess()
941 PixelBufferAccess::PixelBufferAccess (const TextureFormat& format, const IVec3& size, void* data) in PixelBufferAccess()
946 PixelBufferAccess::PixelBufferAccess (const TextureFormat& format, int width, int height, int depth… in PixelBufferAccess()
951 PixelBufferAccess::PixelBufferAccess (const TextureFormat& format, const IVec3& size, const IVec3& … in PixelBufferAccess()
963 Vector<T, 4> swizzleRB (const Vector<T, 4>& v, TextureFormat::ChannelOrder src, TextureFormat::Chan… in swizzleRB()
969 DE_ASSERT((src == TextureFormat::RGB && dst == TextureFormat::BGR) || in swizzleRB()
970 (src == TextureFormat::BGR && dst == TextureFormat::RGB) || in swizzleRB()
971 (src == TextureFormat::RGBA && dst == TextureFormat::BGRA) || in swizzleRB()
972 (src == TextureFormat::BGRA && dst == TextureFormat::RGBA)); in swizzleRB()
983 DE_ASSERT(m_format.order != TextureFormat::DS); // combined formats cannot be accessed directly in getPixel()
988 if (m_format.type == TextureFormat::UNORM_INT8) in getPixel()
990 if (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA) in getPixel()
992 else if (m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB) in getPixel()
1008 case TextureFormat::UNORM_BYTE_44: return Vec4(UN8 (4, 4), UN8 ( 0, 4), 0.0f, 1.0f); in getPixel()
1009 …case TextureFormat::UNSIGNED_BYTE_44: return UVec4(UI8 (4, 4), UI8 ( 0, 4), 0u, 1u).cast<f… in getPixel()
1010 …case TextureFormat::UNORM_SHORT_565: return swizzleRB( Vec4(UN16(11, 5), UN16( 5, 6), UN16( 0,… in getPixel()
1011 …case TextureFormat::UNSIGNED_SHORT_565: return swizzleRB(UVec4(UI16(11, 5), UI16( 5, 6), UI16(… in getPixel()
1012 …case TextureFormat::UNORM_SHORT_555: return swizzleRB( Vec4(UN16(10, 5), UN16( 5, 5), UN16( 0,… in getPixel()
1013 …case TextureFormat::UNORM_SHORT_4444: return swizzleRB( Vec4(UN16(12, 4), UN16( 8, 4), UN16( 4… in getPixel()
1014 …ase TextureFormat::UNSIGNED_SHORT_4444: return swizzleRB(UVec4(UI16(12, 4), UI16( 8, 4), UI16( … in getPixel()
1015 …case TextureFormat::UNORM_SHORT_5551: return swizzleRB( Vec4(UN16(11, 5), UN16( 6, 5), UN16( 1… in getPixel()
1016 …ase TextureFormat::UNSIGNED_SHORT_5551: return swizzleRB(UVec4(UI16(11, 5), UI16( 6, 5), UI16( … in getPixel()
1017 …case TextureFormat::UNORM_INT_101010: return Vec4(UN32(22, 10), UN32(12, 10), UN32( 2, 10), … in getPixel()
1018 …se TextureFormat::UNORM_INT_1010102_REV: return swizzleRB( Vec4(UN32( 0, 10), UN32(10, 10), UN32(… in getPixel()
1019 …se TextureFormat::SNORM_INT_1010102_REV: return swizzleRB( Vec4(SN32( 0, 10), SN32(10, 10), SN32(… in getPixel()
1020 …e TextureFormat::UNSIGNED_INT_1010102_REV: return swizzleRB( UVec4(UI32(0, 10), UI32(10, 10), UI32… in getPixel()
1021 …e TextureFormat::SIGNED_INT_1010102_REV: return swizzleRB( UVec4(SI32(0, 10), SI32(10, 10), SI32(… in getPixel()
1022 case TextureFormat::UNSIGNED_INT_999_E5_REV: return unpackRGB999E5(*((const deUint32*)pixelPtr)); in getPixel()
1024 case TextureFormat::UNORM_SHORT_1555: in getPixel()
1025 DE_ASSERT(m_format.order == TextureFormat::ARGB); in getPixel()
1028 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: in getPixel()
1082 DE_ASSERT(m_format.order != TextureFormat::DS); // combined formats cannot be accessed directly in getPixelInt()
1088 if (m_format.type == TextureFormat::UNORM_INT8) in getPixelInt()
1090 if (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA) in getPixelInt()
1092 else if (m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB) in getPixelInt()
1103 case TextureFormat::UNSIGNED_BYTE_44: // Fall-through in getPixelInt()
1104 …case TextureFormat::UNORM_BYTE_44: return UVec4(U8 ( 4, 4), U8 ( 0, 4), 0u, 1u).cast<int>(… in getPixelInt()
1105 case TextureFormat::UNSIGNED_SHORT_565: // Fall-through in getPixelInt()
1106 …case TextureFormat::UNORM_SHORT_565: return swizzleRB(UVec4(U16(11, 5), U16( 5, 6), U16( 0, 5… in getPixelInt()
1107 …case TextureFormat::UNORM_SHORT_555: return swizzleRB(UVec4(U16(10, 5), U16( 5, 5), U16( 0, 5… in getPixelInt()
1108 case TextureFormat::UNSIGNED_SHORT_4444: // Fall-through in getPixelInt()
1109 … TextureFormat::UNORM_SHORT_4444: return swizzleRB(UVec4(U16(12, 4), U16( 8, 4), U16( 4, 4), … in getPixelInt()
1110 case TextureFormat::UNSIGNED_SHORT_5551: // Fall-through in getPixelInt()
1111 … TextureFormat::UNORM_SHORT_5551: return swizzleRB(UVec4(U16(11, 5), U16( 6, 5), U16( 1, 5), … in getPixelInt()
1112 …case TextureFormat::UNORM_INT_101010: return UVec4(U32(22, 10), U32(12, 10), U32( 2, 10), 1).… in getPixelInt()
1113 case TextureFormat::UNORM_INT_1010102_REV: // Fall-through in getPixelInt()
1114 …ase TextureFormat::UNSIGNED_INT_1010102_REV: return swizzleRB(UVec4(U32( 0, 10), U32(10, 10), U32(… in getPixelInt()
1115 case TextureFormat::SNORM_INT_1010102_REV: // Fall-through in getPixelInt()
1116 …ase TextureFormat::SIGNED_INT_1010102_REV: return swizzleRB(IVec4(S32( 0, 10), S32(10, 10), S32(2… in getPixelInt()
1118 case TextureFormat::UNORM_SHORT_1555: in getPixelInt()
1119 DE_ASSERT(m_format.order == TextureFormat::ARGB); in getPixelInt()
1190 case TextureFormat::UNSIGNED_INT_16_8_8: in getPixDepth()
1191 DE_ASSERT(m_format.order == TextureFormat::DS); in getPixDepth()
1194 case TextureFormat::UNSIGNED_INT_24_8: in getPixDepth()
1195 DE_ASSERT(m_format.order == TextureFormat::D || m_format.order == TextureFormat::DS); in getPixDepth()
1198 case TextureFormat::UNSIGNED_INT_24_8_REV: in getPixDepth()
1199 DE_ASSERT(m_format.order == TextureFormat::D || m_format.order == TextureFormat::DS); in getPixDepth()
1202 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: in getPixDepth()
1203 DE_ASSERT(m_format.order == TextureFormat::DS); in getPixDepth()
1207 DE_ASSERT(m_format.order == TextureFormat::D); // no other combined depth stencil types in getPixDepth()
1222 case TextureFormat::UNSIGNED_INT_24_8_REV: in getPixStencil()
1223 DE_ASSERT(m_format.order == TextureFormat::DS); in getPixStencil()
1226 case TextureFormat::UNSIGNED_INT_16_8_8: in getPixStencil()
1227 case TextureFormat::UNSIGNED_INT_24_8: in getPixStencil()
1228 DE_ASSERT(m_format.order == TextureFormat::DS); in getPixStencil()
1231 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: in getPixStencil()
1232 DE_ASSERT(m_format.order == TextureFormat::DS); in getPixStencil()
1237 DE_ASSERT(m_format.order == TextureFormat::S); // no other combined depth stencil types in getPixStencil()
1249 DE_ASSERT(m_format.order != TextureFormat::DS); // combined formats cannot be accessed directly in setPixel()
1254 if (m_format.type == TextureFormat::UNORM_INT8) in setPixel()
1256 if (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA) in setPixel()
1261 else if (m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB) in setPixel()
1275 …case TextureFormat::UNORM_BYTE_44: *((deUint8 *)pixelPtr) = (deUint8)(PN(color[0], 4, 4) | PN(col… in setPixel()
1276 …case TextureFormat::UNSIGNED_BYTE_44: *((deUint8 *)pixelPtr) = (deUint8)(PU((deUint32)color[0], 4,… in setPixel()
1277 …case TextureFormat::UNORM_INT_101010: *((deUint32*)pixelPtr) = PN(color[0], 22, 10) | PN(color[1],… in setPixel()
1279 case TextureFormat::UNORM_SHORT_565: in setPixel()
1281 const Vec4 swizzled = swizzleRB(color, TextureFormat::RGB, m_format.order); in setPixel()
1286 case TextureFormat::UNSIGNED_SHORT_565: in setPixel()
1288 const UVec4 swizzled = swizzleRB(color.cast<deUint32>(), TextureFormat::RGB, m_format.order); in setPixel()
1293 case TextureFormat::UNORM_SHORT_555: in setPixel()
1295 const Vec4 swizzled = swizzleRB(color, TextureFormat::RGB, m_format.order); in setPixel()
1300 case TextureFormat::UNORM_SHORT_4444: in setPixel()
1302 const Vec4 swizzled = swizzleRB(color, TextureFormat::RGBA, m_format.order); in setPixel()
1307 case TextureFormat::UNSIGNED_SHORT_4444: in setPixel()
1309 const UVec4 swizzled = swizzleRB(color.cast<deUint32>(), TextureFormat::RGBA, m_format.order); in setPixel()
1314 case TextureFormat::UNORM_SHORT_5551: in setPixel()
1316 const Vec4 swizzled = swizzleRB(color, TextureFormat::RGBA, m_format.order); in setPixel()
1321 case TextureFormat::UNORM_SHORT_1555: in setPixel()
1328 case TextureFormat::UNSIGNED_SHORT_5551: in setPixel()
1330 const UVec4 swizzled = swizzleRB(color.cast<deUint32>(), TextureFormat::RGBA, m_format.order); in setPixel()
1335 case TextureFormat::UNORM_INT_1010102_REV: in setPixel()
1337 const Vec4 u = swizzleRB(color, TextureFormat::RGBA, m_format.order); in setPixel()
1342 case TextureFormat::SNORM_INT_1010102_REV: in setPixel()
1344 const Vec4 u = swizzleRB(color, TextureFormat::RGBA, m_format.order); in setPixel()
1349 case TextureFormat::UNSIGNED_INT_1010102_REV: in setPixel()
1351 const UVec4 u = swizzleRB(color.cast<deUint32>(), TextureFormat::RGBA, m_format.order); in setPixel()
1356 case TextureFormat::SIGNED_INT_1010102_REV: in setPixel()
1358 const IVec4 u = swizzleRB(color.cast<deInt32>(), TextureFormat::RGBA, m_format.order); in setPixel()
1363 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: in setPixel()
1367 case TextureFormat::UNSIGNED_INT_999_E5_REV: in setPixel()
1399 DE_ASSERT(m_format.order != TextureFormat::DS); // combined formats cannot be accessed directly in setPixel()
1404 if (m_format.type == TextureFormat::UNORM_INT8) in setPixel()
1406 if (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA) in setPixel()
1411 else if (m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB) in setPixel()
1423 case TextureFormat::UNSIGNED_BYTE_44: // Fall-through in setPixel()
1424 …case TextureFormat::UNORM_BYTE_44: *((deUint8 *)pixelPtr) = (deUint8 )(PU(color[0], 4, 4) | PU(c… in setPixel()
1425 …case TextureFormat::UNORM_INT_101010: *((deUint32*)pixelPtr) = PU(color[0], 22, 10) | PU(color[1],… in setPixel()
1427 case TextureFormat::UNORM_SHORT_565: in setPixel()
1428 case TextureFormat::UNSIGNED_SHORT_565: in setPixel()
1430 const IVec4 swizzled = swizzleRB(color, TextureFormat::RGB, m_format.order); in setPixel()
1435 case TextureFormat::UNORM_SHORT_555: in setPixel()
1437 const IVec4 swizzled = swizzleRB(color, TextureFormat::RGB, m_format.order); in setPixel()
1442 case TextureFormat::UNORM_SHORT_4444: in setPixel()
1443 case TextureFormat::UNSIGNED_SHORT_4444: in setPixel()
1445 const IVec4 swizzled = swizzleRB(color, TextureFormat::RGBA, m_format.order); in setPixel()
1450 case TextureFormat::UNORM_SHORT_5551: in setPixel()
1451 case TextureFormat::UNSIGNED_SHORT_5551: in setPixel()
1453 const IVec4 swizzled = swizzleRB(color, TextureFormat::RGBA, m_format.order); in setPixel()
1458 case TextureFormat::UNORM_SHORT_1555: in setPixel()
1465 case TextureFormat::UNORM_INT_1010102_REV: in setPixel()
1466 case TextureFormat::UNSIGNED_INT_1010102_REV: in setPixel()
1468 const IVec4 swizzled = swizzleRB(color, TextureFormat::RGBA, m_format.order); in setPixel()
1473 case TextureFormat::SNORM_INT_1010102_REV: in setPixel()
1474 case TextureFormat::SIGNED_INT_1010102_REV: in setPixel()
1476 const IVec4 swizzled = swizzleRB(color, TextureFormat::RGBA, m_format.order); in setPixel()
1511 case TextureFormat::UNSIGNED_INT_16_8_8: in setPixDepth()
1512 DE_ASSERT(m_format.order == TextureFormat::DS); in setPixDepth()
1516 case TextureFormat::UNSIGNED_INT_24_8: in setPixDepth()
1517 DE_ASSERT(m_format.order == TextureFormat::D || m_format.order == TextureFormat::DS); in setPixDepth()
1521 case TextureFormat::UNSIGNED_INT_24_8_REV: in setPixDepth()
1522 DE_ASSERT(m_format.order == TextureFormat::D || m_format.order == TextureFormat::DS); in setPixDepth()
1526 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: in setPixDepth()
1527 DE_ASSERT(m_format.order == TextureFormat::DS); in setPixDepth()
1532 DE_ASSERT(m_format.order == TextureFormat::D); // no other combined depth stencil types in setPixDepth()
1548 case TextureFormat::UNSIGNED_INT_16_8_8: in setPixStencil()
1549 case TextureFormat::UNSIGNED_INT_24_8: in setPixStencil()
1550 DE_ASSERT(m_format.order == TextureFormat::DS); in setPixStencil()
1554 case TextureFormat::UNSIGNED_INT_24_8_REV: in setPixStencil()
1555 DE_ASSERT(m_format.order == TextureFormat::DS); in setPixStencil()
1559 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: in setPixStencil()
1560 DE_ASSERT(m_format.order == TextureFormat::DS); in setPixStencil()
1565 DE_ASSERT(m_format.order == TextureFormat::S); // no other combined depth stencil types in setPixStencil()
1654 static bool isFixedPointDepthTextureFormat (const tcu::TextureFormat& format) in isFixedPointDepthTextureFormat()
1656 DE_ASSERT(format.order == TextureFormat::D); in isFixedPointDepthTextureFormat()
1673 const TextureFormat& format = access.getFormat(); in lookup()
1677 if (format.type == TextureFormat::UNORM_INT8 && format.order == TextureFormat::sRGB) in lookup()
1679 else if (format.type == TextureFormat::UNORM_INT8 && format.order == TextureFormat::sRGBA) in lookup()
1691 static inline Vec4 lookupBorder (const tcu::TextureFormat& format, const tcu::Sampler& sampler) in lookupBorder()
2130 TextureLevel::TextureLevel (const TextureFormat& format) in TextureLevel()
2136 TextureLevel::TextureLevel (const TextureFormat& format, int width, int height, int depth) in TextureLevel()
2147 void TextureLevel::setStorage (const TextureFormat& format, int width, int height, int depth) in setStorage()
2418 DE_ASSERT(src.getFormat().order == TextureFormat::D || src.getFormat().order == TextureFormat::DS); in gatherArray2DOffsetsCompare()
3110 TextureLevelPyramid::TextureLevelPyramid (const TextureFormat& format, int numLevels) in TextureLevelPyramid()
3183 Texture1D::Texture1D (const TextureFormat& format, int width) in Texture1D()
3225 Texture2D::Texture2D (const TextureFormat& format, int width, int height) in Texture2D()
3343 …SSERT(m_levels[0][0].getFormat().order == TextureFormat::D || m_levels[0][0].getFormat().order == … in gatherCompare()
3360 TextureCube::TextureCube (const TextureFormat& format, int size) in TextureCube()
3546 Texture1DArray::Texture1DArray (const TextureFormat& format, int width, int numLayers) in Texture1DArray()
3591 Texture2DArray::Texture2DArray (const TextureFormat& format, int width, int height, int numLayers) in Texture2DArray()
3648 Texture3D::Texture3D (const TextureFormat& format, int width, int height, int depth) in Texture3D()
3742 TextureCubeArray::TextureCubeArray (const TextureFormat& format, int size, int depth) in TextureCubeArray()
3789 std::ostream& operator<< (std::ostream& str, TextureFormat::ChannelOrder order) in operator <<()
3818 return str << de::getSizedArrayElement<TextureFormat::CHANNELORDER_LAST>(orderStrings, order); in operator <<()
3821 std::ostream& operator<< (std::ostream& str, TextureFormat::ChannelType type) in operator <<()
3867 return str << de::getSizedArrayElement<TextureFormat::CHANNELTYPE_LAST>(typeStrings, type); in operator <<()
3885 std::ostream& operator<< (std::ostream& str, TextureFormat format) in operator <<()