Lines Matching defs:order
597 bool isColorOrder (TextureFormat::ChannelOrder order)
601 switch (order)
638 const bool isColor = isColorOrder(format.order);
651 return isColor || format.order == TextureFormat::D;
655 return format.order == TextureFormat::RG;
660 return format.order == TextureFormat::RGB || format.order == TextureFormat::BGR;
666 return format.order == TextureFormat::RGBA || format.order == TextureFormat::BGRA
667 || format.order == TextureFormat::ARGB || format.order == TextureFormat::ABGR;
670 return format.order == TextureFormat::ARGB || format.order == TextureFormat::ABGR;
673 return format.order == TextureFormat::RGB;
681 return format.order == TextureFormat::RGBA || format.order == TextureFormat::BGRA;
685 return format.order == TextureFormat::RGB;
688 return format.order == TextureFormat::DS;
692 return format.order == TextureFormat::D || format.order == TextureFormat::DS;
709 return isColor || format.order == TextureFormat::S;
714 return isColor || format.order == TextureFormat::D;
717 return format.order == TextureFormat::DS;
731 int getNumUsedChannels (TextureFormat::ChannelOrder order)
736 switch (order)
807 const TextureFormat::ChannelOrder order = format.order;
849 return getNumUsedChannels(order) * getChannelSize(type);
858 const TextureSwizzle& getChannelReadSwizzle (TextureFormat::ChannelOrder order)
881 switch (order)
912 const TextureSwizzle& getChannelWriteSwizzle (TextureFormat::ChannelOrder order)
934 switch (order)
1077 //! Swizzle generally based on channel order.
1116 DE_ASSERT(m_format.order != TextureFormat::DS); // combined formats cannot be accessed directly
1123 if (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA)
1125 else if (m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB)
1143 case TextureFormat::UNORM_SHORT_565: return swizzleGe( Vec4(UN16(11, 5), UN16( 5, 6), UN16( 0, 5), 1.0f), m_format.order, TextureFormat::RGB);
1144 case TextureFormat::UNSIGNED_SHORT_565: return swizzleGe(UVec4(UI16(11, 5), UI16( 5, 6), UI16( 0, 5), 1u), m_format.order, TextureFormat::RGB).cast<float>();
1145 case TextureFormat::UNORM_SHORT_555: return swizzleGe( Vec4(UN16(10, 5), UN16( 5, 5), UN16( 0, 5), 1.0f), m_format.order, TextureFormat::RGB);
1146 case TextureFormat::UNORM_SHORT_4444: return swizzleGe( Vec4(UN16(12, 4), UN16( 8, 4), UN16( 4, 4), UN16( 0, 4)), m_format.order, TextureFormat::RGBA);
1147 case TextureFormat::UNSIGNED_SHORT_4444: return swizzleGe(UVec4(UI16(12, 4), UI16( 8, 4), UI16( 4, 4), UI16( 0, 4)), m_format.order, TextureFormat::RGBA).cast<float>();
1148 case TextureFormat::UNORM_SHORT_5551: return swizzleGe( Vec4(UN16(11, 5), UN16( 6, 5), UN16( 1, 5), UN16( 0, 1)), m_format.order, TextureFormat::RGBA);
1149 case TextureFormat::UNSIGNED_SHORT_5551: return swizzleGe(UVec4(UI16(11, 5), UI16( 6, 5), UI16( 1, 5), UI16( 0, 1)), m_format.order, TextureFormat::RGBA).cast<float>();
1150 case TextureFormat::UNORM_SHORT_1555: return swizzleGe( Vec4(UN16(15, 1), UN16(10, 5), UN16( 5, 5), UN16( 0, 5)), m_format.order, TextureFormat::RGBA);
1152 case TextureFormat::UNORM_INT_1010102_REV: return swizzleGe( Vec4(UN32( 0, 10), UN32(10, 10), UN32(20, 10), UN32(30, 2)), m_format.order, TextureFormat::RGBA);
1153 case TextureFormat::SNORM_INT_1010102_REV: return swizzleGe( Vec4(SN32( 0, 10), SN32(10, 10), SN32(20, 10), SN32(30, 2)), m_format.order, TextureFormat::RGBA);
1155 case TextureFormat::UNSIGNED_INT_1010102_REV: return swizzleGe( UVec4(UI32(0, 10), UI32(10, 10), UI32(20, 10), UI32(30, 2)), m_format.order, TextureFormat::RGBA).cast<float>();
1157 case TextureFormat::SIGNED_INT_1010102_REV: return swizzleGe( UVec4(SI32(0, 10), SI32(10, 10), SI32(20, 10), SI32(30, 2)), m_format.order, TextureFormat::RGBA).cast<float>();
1178 const TextureSwizzle::Channel* channelMap = getChannelReadSwizzle(m_format.order).components;
1214 const TextureSwizzle::Channel* channelMap = getChannelReadSwizzle(format.order).components;
1249 const TextureSwizzle::Channel* channelMap = getChannelReadSwizzle(format.order).components;
1285 DE_ASSERT(m_format.order != TextureFormat::DS); // combined formats cannot be accessed directly
1292 if (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA)
1294 else if (m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB)
1308 case TextureFormat::UNORM_SHORT_565: return swizzleGe(UVec4(U16(11, 5), U16( 5, 6), U16( 0, 5), 1).cast<int>(), m_format.order, TextureFormat::RGB);
1309 case TextureFormat::UNORM_SHORT_555: return swizzleGe(UVec4(U16(10, 5), U16( 5, 5), U16( 0, 5), 1).cast<int>(), m_format.order, TextureFormat::RGB);
1311 case TextureFormat::UNORM_SHORT_4444: return swizzleGe(UVec4(U16(12, 4), U16( 8, 4), U16( 4, 4), U16( 0, 4)).cast<int>(), m_format.order, TextureFormat::RGBA);
1313 case TextureFormat::UNORM_SHORT_5551: return swizzleGe(UVec4(U16(11, 5), U16( 6, 5), U16( 1, 5), U16( 0, 1)).cast<int>(), m_format.order, TextureFormat::RGBA);
1314 case TextureFormat::UNORM_SHORT_1555: return swizzleGe(UVec4(U16(15, 1), U16(10, 5), U16( 5, 5), U16( 0, 5)).cast<int>(), m_format.order, TextureFormat::RGBA);
1318 case TextureFormat::UNSIGNED_INT_1010102_REV: return swizzleGe(UVec4(U32( 0, 10), U32(10, 10), U32(20, 10), U32(30, 2)), m_format.order, TextureFormat::RGBA).cast<int>();
1321 case TextureFormat::SIGNED_INT_1010102_REV: return swizzleGe(IVec4(S32( 0, 10), S32(10, 10), S32(20, 10), S32(30, 2)), m_format.order, TextureFormat::RGBA);
1340 (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA ||
1341 m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB))
1382 DE_ASSERT(m_format.order != TextureFormat::DS); // combined formats cannot be accessed directly
1388 if (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA)
1390 else if (m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB)
1403 case TextureFormat::UNORM_SHORT_565: return swizzleGe(U64Vec4(U16(11, 5), U16( 5, 6), U16( 0, 5), 1), m_format.order, TextureFormat::RGB);
1404 case TextureFormat::UNORM_SHORT_555: return swizzleGe(U64Vec4(U16(10, 5), U16( 5, 5), U16( 0, 5), 1), m_format.order, TextureFormat::RGB);
1406 case TextureFormat::UNORM_SHORT_4444: return swizzleGe(U64Vec4(U16(12, 4), U16( 8, 4), U16( 4, 4), U16( 0, 4)), m_format.order, TextureFormat::RGBA);
1408 case TextureFormat::UNORM_SHORT_5551: return swizzleGe(U64Vec4(U16(11, 5), U16( 6, 5), U16( 1, 5), U16( 0, 1)), m_format.order, TextureFormat::RGBA);
1412 case TextureFormat::UNSIGNED_INT_1010102_REV: return swizzleGe(U64Vec4(U32( 0, 10), U32(10, 10), U32(20, 10), U32(30, 2)), m_format.order, TextureFormat::RGBA);
1415 case TextureFormat::SIGNED_INT_1010102_REV: return swizzleGe(U64Vec4(U32( 0, 10), U32(10, 10), U32(20, 10), U32(30, 2)), m_format.order, TextureFormat::RGBA);
1416 case TextureFormat::UNORM_SHORT_1555: return swizzleGe(U64Vec4(U16(15, 1), U16(10, 5), U16( 5, 5), U16( 0, 5)), m_format.order, TextureFormat::RGBA);
1472 DE_ASSERT(m_format.order == TextureFormat::DS);
1476 DE_ASSERT(m_format.order == TextureFormat::D || m_format.order == TextureFormat::DS);
1480 DE_ASSERT(m_format.order == TextureFormat::D || m_format.order == TextureFormat::DS);
1484 DE_ASSERT(m_format.order == TextureFormat::DS);
1488 DE_ASSERT(m_format.order == TextureFormat::D); // no other combined depth stencil types
1504 DE_ASSERT(m_format.order == TextureFormat::DS);
1509 DE_ASSERT(m_format.order == TextureFormat::DS);
1513 DE_ASSERT(m_format.order == TextureFormat::DS);
1518 DE_ASSERT(m_format.order == TextureFormat::S); // no other combined depth stencil types
1530 DE_ASSERT(m_format.order != TextureFormat::DS); // combined formats cannot be accessed directly
1537 if (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA)
1542 else if (m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB)
1562 const Vec4 swizzled = swizzleGe(color, TextureFormat::RGB, m_format.order);
1569 const UVec4 swizzled = swizzleGe(color.cast<deUint32>(), TextureFormat::RGB, m_format.order);
1576 const Vec4 swizzled = swizzleGe(color, TextureFormat::RGB, m_format.order);
1583 const Vec4 swizzled = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1590 const UVec4 swizzled = swizzleGe(color.cast<deUint32>(), TextureFormat::RGBA, m_format.order);
1597 const Vec4 swizzled = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1604 const Vec4 swizzled = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1611 const UVec4 swizzled = swizzleGe(color.cast<deUint32>(), TextureFormat::RGBA, m_format.order);
1618 const Vec4 u = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1625 const Vec4 u = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1633 const UVec4 u = swizzleGe(color.cast<deUint32>(), TextureFormat::RGBA, m_format.order);
1641 const IVec4 u = swizzleGe(color.cast<deInt32>(), TextureFormat::RGBA, m_format.order);
1657 int numChannels = getNumUsedChannels(m_format.order);
1658 const TextureSwizzle::Channel* map = getChannelWriteSwizzle(m_format.order).components;
1682 DE_ASSERT(m_format.order != TextureFormat::DS); // combined formats cannot be accessed directly
1689 if (m_format.order == TextureFormat::RGBA || m_format.order == TextureFormat::sRGBA)
1694 else if (m_format.order == TextureFormat::RGB || m_format.order == TextureFormat::sRGB)
1713 const IVec4 swizzled = swizzleGe(color, TextureFormat::RGB, m_format.order);
1720 const IVec4 swizzled = swizzleGe(color, TextureFormat::RGB, m_format.order);
1728 const IVec4 swizzled = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1736 const IVec4 swizzled = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1743 const IVec4 swizzled = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1752 const IVec4 swizzled = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1761 const IVec4 swizzled = swizzleGe(color, TextureFormat::RGBA, m_format.order);
1769 int numChannels = getNumUsedChannels(m_format.order);
1770 const TextureSwizzle::Channel* map = getChannelWriteSwizzle(m_format.order).components;
1797 DE_ASSERT(m_format.order == TextureFormat::DS);
1802 DE_ASSERT(m_format.order == TextureFormat::D || m_format.order == TextureFormat::DS);
1807 DE_ASSERT(m_format.order == TextureFormat::D || m_format.order == TextureFormat::DS);
1812 DE_ASSERT(m_format.order == TextureFormat::DS);
1817 DE_ASSERT(m_format.order == TextureFormat::D); // no other combined depth stencil types
1835 DE_ASSERT(m_format.order == TextureFormat::DS);
1840 DE_ASSERT(m_format.order == TextureFormat::DS);
1845 DE_ASSERT(m_format.order == TextureFormat::DS);
1850 DE_ASSERT(m_format.order == TextureFormat::S); // no other combined depth stencil types
1941 DE_ASSERT(format.order == TextureFormat::D || format.order == TextureFormat::R);
1962 if (format.type == TextureFormat::UNORM_INT8 && format.order == TextureFormat::sRGB)
1964 else if (format.type == TextureFormat::UNORM_INT8 && format.order == TextureFormat::sRGBA)
2952 DE_ASSERT(src.getFormat().order == TextureFormat::D || src.getFormat().order == TextureFormat::DS);
3934 const int sampleIndices[4] = { 2, 3, 1, 0 }; // \note Gather returns the samples in a non-obvious order.
3945 DE_ASSERT(m_levels[0][0].getFormat().order == TextureFormat::D || m_levels[0][0].getFormat().order == TextureFormat::DS);
4393 std::ostream& operator<< (std::ostream& str, TextureFormat::ChannelOrder order)
4423 return str << de::getSizedArrayElement<TextureFormat::CHANNELORDER_LAST>(orderStrings, order);
4502 return str << format.order << ", " << format.type << "";