Lines Matching full:textureformat
102 bool isSRGB (TextureFormat format)
105 DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 21);
107 return format.order == TextureFormat::sR ||
108 format.order == TextureFormat::sRG ||
109 format.order == TextureFormat::sRGB ||
110 format.order == TextureFormat::sRGBA ||
111 format.order == TextureFormat::sBGR ||
112 format.order == TextureFormat::sBGRA;
115 bool isCombinedDepthStencilType (TextureFormat::ChannelType type)
118 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 38);
120 return type == TextureFormat::UNSIGNED_INT_16_8_8 ||
121 type == TextureFormat::UNSIGNED_INT_24_8 ||
122 type == TextureFormat::UNSIGNED_INT_24_8_REV ||
123 type == TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV;
126 bool hasStencilComponent (TextureFormat::ChannelOrder order)
128 DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 21);
132 case TextureFormat::S:
133 case TextureFormat::DS:
141 bool hasDepthComponent (TextureFormat::ChannelOrder order)
143 DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 21);
147 case TextureFormat::D:
148 case TextureFormat::DS:
157 TextureChannelClass getTextureChannelClass (TextureFormat::ChannelType channelType)
160 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 38);
164 case TextureFormat::SNORM_INT8: return TEXTURECHANNELCLASS_SIGNED_FIXED_POINT;
165 case TextureFormat::SNORM_INT16: return TEXTURECHANNELCLASS_SIGNED_FIXED_POINT;
166 case TextureFormat::SNORM_INT32: return TEXTURECHANNELCLASS_SIGNED_FIXED_POINT;
167 case TextureFormat::UNORM_INT8: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
168 case TextureFormat::UNORM_INT16: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
169 case TextureFormat::UNORM_INT24: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
170 case TextureFormat::UNORM_INT32: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
171 case TextureFormat::UNORM_BYTE_44: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
172 case TextureFormat::UNORM_SHORT_565: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
173 case TextureFormat::UNORM_SHORT_555: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
174 case TextureFormat::UNORM_SHORT_4444: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
175 case TextureFormat::UNORM_SHORT_5551: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
176 case TextureFormat::UNORM_SHORT_1555: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
177 case TextureFormat::UNSIGNED_BYTE_44: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
178 case TextureFormat::UNSIGNED_SHORT_565: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
179 case TextureFormat::UNSIGNED_SHORT_4444: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
180 case TextureFormat::UNSIGNED_SHORT_5551: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
181 case TextureFormat::UNORM_INT_101010: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
182 case TextureFormat::SNORM_INT_1010102_REV: return TEXTURECHANNELCLASS_SIGNED_FIXED_POINT;
183 case TextureFormat::UNORM_INT_1010102_REV: return TEXTURECHANNELCLASS_UNSIGNED_FIXED_POINT;
184 case TextureFormat::SIGNED_INT_1010102_REV: return TEXTURECHANNELCLASS_SIGNED_INTEGER;
185 case TextureFormat::UNSIGNED_INT_1010102_REV: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
186 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: return TEXTURECHANNELCLASS_FLOATING_POINT;
187 case TextureFormat::UNSIGNED_INT_999_E5_REV: return TEXTURECHANNELCLASS_FLOATING_POINT;
188 case TextureFormat::UNSIGNED_INT_16_8_8: return TEXTURECHANNELCLASS_LAST; //!< packed unorm16-x8-uint8
189 case TextureFormat::UNSIGNED_INT_24_8: return TEXTURECHANNELCLASS_LAST; //!< packed unorm24-uint8
190 case TextureFormat::UNSIGNED_INT_24_8_REV: return TEXTURECHANNELCLASS_LAST; //!< packed unorm24-uint8
191 case TextureFormat::SIGNED_INT8: return TEXTURECHANNELCLASS_SIGNED_INTEGER;
192 case TextureFormat::SIGNED_INT16: return TEXTURECHANNELCLASS_SIGNED_INTEGER;
193 case TextureFormat::SIGNED_INT32: return TEXTURECHANNELCLASS_SIGNED_INTEGER;
194 case TextureFormat::UNSIGNED_INT8: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
195 case TextureFormat::UNSIGNED_INT16: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
196 case TextureFormat::UNSIGNED_INT24: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
197 case TextureFormat::UNSIGNED_INT32: return TEXTURECHANNELCLASS_UNSIGNED_INTEGER;
198 case TextureFormat::HALF_FLOAT: return TEXTURECHANNELCLASS_FLOATING_POINT;
199 case TextureFormat::FLOAT: return TEXTURECHANNELCLASS_FLOATING_POINT;
200 case TextureFormat::FLOAT64: return TEXTURECHANNELCLASS_FLOATING_POINT;
201 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: return TEXTURECHANNELCLASS_LAST; //!< packed float32-pad24-uint8
208 bool isAccessValid (TextureFormat format, TextureAccessType type)
212 if (format.order == TextureFormat::DS)
219 else if (format.order == TextureFormat::D)
221 else if (format.order == TextureFormat::S)
226 if (format.type == TextureFormat::UNSIGNED_INT_11F_11F_10F_REV ||
227 format.type == TextureFormat::UNSIGNED_INT_999_E5_REV)
342 static Vec2 getFloatChannelValueRange (TextureFormat::ChannelType channelType)
345 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 38);
353 case TextureFormat::SNORM_INT8:
354 case TextureFormat::SNORM_INT16:
355 case TextureFormat::SNORM_INT32:
356 case TextureFormat::SNORM_INT_1010102_REV: cMin = -1.0f; cMax = 1.0f; break;
359 case TextureFormat::UNORM_INT8:
360 case TextureFormat::UNORM_INT16:
361 case TextureFormat::UNORM_INT24:
362 case TextureFormat::UNORM_INT32:
363 case TextureFormat::UNORM_BYTE_44:
364 case TextureFormat::UNORM_SHORT_565:
365 case TextureFormat::UNORM_SHORT_555:
366 case TextureFormat::UNORM_SHORT_4444:
367 case TextureFormat::UNORM_SHORT_5551:
368 case TextureFormat::UNORM_SHORT_1555:
369 case TextureFormat::UNORM_INT_101010:
370 case TextureFormat::UNORM_INT_1010102_REV: cMin = 0.0f; cMax = 1.0f; break;
373 case TextureFormat::SIGNED_INT8: cMin = -128.0f; cMax = 127.0f; break;
374 case TextureFormat::SIGNED_INT16: cMin = -32768.0f; cMax = 32767.0f; break;
375 case TextureFormat::SIGNED_INT32: cMin = -2147483648.0f; cMax = 2147483647.0f; break;
376 case TextureFormat::UNSIGNED_INT8: cMin = 0.0f; cMax = 255.0f; break;
377 case TextureFormat::UNSIGNED_INT16: cMin = 0.0f; cMax = 65535.0f; break;
378 case TextureFormat::UNSIGNED_INT24: cMin = 0.0f; cMax = 16777215.0f; break;
379 case TextureFormat::UNSIGNED_INT32: cMin = 0.0f; cMax = 4294967295.f; break;
380 case TextureFormat::HALF_FLOAT: cMin = -1e3f; cMax = 1e3f; break;
381 case TextureFormat::FLOAT: cMin = -1e5f; cMax = 1e5f; break;
382 case TextureFormat::FLOAT64: cMin = -1e5f; cMax = 1e5f; break;
383 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: cMin = 0.0f; cMax = 1e4f; break;
384 case TextureFormat::UNSIGNED_INT_999_E5_REV: cMin = 0.0f; cMax = 1e5f; break;
385 case TextureFormat::UNSIGNED_BYTE_44: cMin = 0.0f; cMax = 15.f; break;
386 case TextureFormat::UNSIGNED_SHORT_4444: cMin = 0.0f; cMax = 15.f; break;
399 * given TextureFormat. Parameters include value ranges per channel and
403 TextureFormatInfo getTextureFormatInfo (const TextureFormat& format)
406 if (format.type == TextureFormat::UNSIGNED_INT_1010102_REV)
411 if (format.type == TextureFormat::SIGNED_INT_1010102_REV)
416 else if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
421 else if (format == TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_SHORT_5551))
426 else if (format.type == TextureFormat::UNSIGNED_SHORT_5551)
431 else if (format.type == TextureFormat::UNSIGNED_SHORT_565)
452 IVec4 getFormatMinIntValue (const TextureFormat& format)
458 case TextureFormat::SIGNED_INT8: return IVec4(std::numeric_limits<deInt8>::min());
459 case TextureFormat::SIGNED_INT16: return IVec4(std::numeric_limits<deInt16>::min());
460 case TextureFormat::SIGNED_INT32: return IVec4(std::numeric_limits<deInt32>::min());
468 IVec4 getFormatMaxIntValue (const TextureFormat& format)
474 case TextureFormat::SIGNED_INT8: return IVec4(std::numeric_limits<deInt8>::max());
475 case TextureFormat::SIGNED_INT16: return IVec4(std::numeric_limits<deInt16>::max());
476 case TextureFormat::SIGNED_INT32: return IVec4(std::numeric_limits<deInt32>::max());
484 UVec4 getFormatMaxUintValue (const TextureFormat& format)
488 if (format == TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT_1010102_REV))
493 case TextureFormat::UNSIGNED_INT8: return UVec4(std::numeric_limits<deUint8>::max());
494 case TextureFormat::UNSIGNED_INT16: return UVec4(std::numeric_limits<deUint16>::max());
495 case TextureFormat::UNSIGNED_INT24: return UVec4(0xffffffu);
496 case TextureFormat::UNSIGNED_INT32: return UVec4(std::numeric_limits<deUint32>::max());
504 static IVec4 getChannelBitDepth (TextureFormat::ChannelType channelType)
507 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 38);
511 case TextureFormat::SNORM_INT8: return IVec4(8);
512 case TextureFormat::SNORM_INT16: return IVec4(16);
513 case TextureFormat::SNORM_INT32: return IVec4(32);
514 case TextureFormat::UNORM_INT8: return IVec4(8);
515 case TextureFormat::UNORM_INT16: return IVec4(16);
516 case TextureFormat::UNORM_INT24: return IVec4(24);
517 case TextureFormat::UNORM_INT32: return IVec4(32);
518 case TextureFormat::UNORM_BYTE_44: return IVec4(4,4,0,0);
519 case TextureFormat::UNORM_SHORT_565: return IVec4(5,6,5,0);
520 case TextureFormat::UNORM_SHORT_4444: return IVec4(4);
521 case TextureFormat::UNORM_SHORT_555: return IVec4(5,5,5,0);
522 case TextureFormat::UNORM_SHORT_5551: return IVec4(5,5,5,1);
523 case TextureFormat::UNORM_SHORT_1555: return IVec4(1,5,5,5);
524 case TextureFormat::UNSIGNED_BYTE_44: return IVec4(4,4,0,0);
525 case TextureFormat::UNSIGNED_SHORT_565: return IVec4(5,6,5,0);
526 case TextureFormat::UNSIGNED_SHORT_4444: return IVec4(4);
527 case TextureFormat::UNSIGNED_SHORT_5551: return IVec4(5,5,5,1);
528 case TextureFormat::UNORM_INT_101010: return IVec4(10,10,10,0);
529 case TextureFormat::SNORM_INT_1010102_REV: return IVec4(10,10,10,2);
530 case TextureFormat::UNORM_INT_1010102_REV: return IVec4(10,10,10,2);
531 case TextureFormat::SIGNED_INT8: return IVec4(8);
532 case TextureFormat::SIGNED_INT16: return IVec4(16);
533 case TextureFormat::SIGNED_INT32: return IVec4(32);
534 case TextureFormat::UNSIGNED_INT8: return IVec4(8);
535 case TextureFormat::UNSIGNED_INT16: return IVec4(16);
536 case TextureFormat::UNSIGNED_INT24: return IVec4(24);
537 case TextureFormat::UNSIGNED_INT32: return IVec4(32);
538 case TextureFormat::SIGNED_INT_1010102_REV: return IVec4(10,10,10,2);
539 case TextureFormat::UNSIGNED_INT_1010102_REV: return IVec4(10,10,10,2);
540 case TextureFormat::UNSIGNED_INT_16_8_8: return IVec4(16,8,0,0);
541 case TextureFormat::UNSIGNED_INT_24_8: return IVec4(24,8,0,0);
542 case TextureFormat::UNSIGNED_INT_24_8_REV: return IVec4(24,8,0,0);
543 case TextureFormat::HALF_FLOAT: return IVec4(16);
544 case TextureFormat::FLOAT: return IVec4(32);
545 case TextureFormat::FLOAT64: return IVec4(64);
546 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: return IVec4(11,11,10,0);
547 case TextureFormat::UNSIGNED_INT_999_E5_REV: return IVec4(9,9,9,0);
548 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: return IVec4(32,8,0,0);
555 IVec4 getTextureFormatBitDepth (const TextureFormat& format)
571 static IVec4 getChannelMantissaBitDepth (TextureFormat::ChannelType channelType)
574 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 38);
578 case TextureFormat::SNORM_INT8:
579 case TextureFormat::SNORM_INT16:
580 case TextureFormat::SNORM_INT32:
581 case TextureFormat::UNORM_INT8:
582 case TextureFormat::UNORM_INT16:
583 case TextureFormat::UNORM_INT24:
584 case TextureFormat::UNORM_INT32:
585 case TextureFormat::UNORM_BYTE_44:
586 case TextureFormat::UNORM_SHORT_565:
587 case TextureFormat::UNORM_SHORT_4444:
588 case TextureFormat::UNORM_SHORT_555:
589 case TextureFormat::UNORM_SHORT_5551:
590 case TextureFormat::UNORM_SHORT_1555:
591 case TextureFormat::UNSIGNED_BYTE_44:
592 case TextureFormat::UNSIGNED_SHORT_565:
593 case TextureFormat::UNSIGNED_SHORT_4444:
594 case TextureFormat::UNSIGNED_SHORT_5551:
595 case TextureFormat::UNORM_INT_101010:
596 case TextureFormat::SNORM_INT_1010102_REV:
597 case TextureFormat::UNORM_INT_1010102_REV:
598 case TextureFormat::SIGNED_INT8:
599 case TextureFormat::SIGNED_INT16:
600 case TextureFormat::SIGNED_INT32:
601 case TextureFormat::UNSIGNED_INT8:
602 case TextureFormat::UNSIGNED_INT16:
603 case TextureFormat::UNSIGNED_INT24:
604 case TextureFormat::UNSIGNED_INT32:
605 case TextureFormat::SIGNED_INT_1010102_REV:
606 case TextureFormat::UNSIGNED_INT_1010102_REV:
607 case TextureFormat::UNSIGNED_INT_16_8_8:
608 case TextureFormat::UNSIGNED_INT_24_8:
609 case TextureFormat::UNSIGNED_INT_24_8_REV:
610 case TextureFormat::UNSIGNED_INT_999_E5_REV:
613 case TextureFormat::HALF_FLOAT: return IVec4(10);
614 case TextureFormat::FLOAT: return IVec4(23);
615 case TextureFormat::FLOAT64: return IVec4(52);
616 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: return IVec4(6,6,5,0);
617 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: return IVec4(23,8,0,0);
624 IVec4 getTextureFormatMantissaBitDepth (const TextureFormat& format)
640 BVec4 getTextureFormatChannelMask (const TextureFormat& format)
765 DE_ASSERT(access.getFormat().order == TextureFormat::DS || access.getFormat().order == TextureFormat::D);
772 DE_ASSERT(access.getFormat().order == TextureFormat::DS || access.getFormat().order == TextureFormat::S);
839 const bool hasDepth = access.getFormat().order == tcu::TextureFormat::DS || access.getFormat().order == tcu::TextureFormat::D;
840 const bool hasStencil = access.getFormat().order == tcu::TextureFormat::DS || access.getFormat().order == tcu::TextureFormat::S;
916 const bool hasDepth = access.getFormat().order == tcu::TextureFormat::DS || access.getFormat().order == tcu::TextureFormat::D;
917 const bool hasStencil = access.getFormat().order == tcu::TextureFormat::DS || access.getFormat().order == tcu::TextureFormat::S;
1017 const bool srcHasDepth = (src.getFormat().order == tcu::TextureFormat::DS || src.getFormat().order == tcu::TextureFormat::D);
1018 const bool srcHasStencil = (src.getFormat().order == tcu::TextureFormat::DS || src.getFormat().order == tcu::TextureFormat::S);
1019 const bool dstHasDepth = (dst.getFormat().order == tcu::TextureFormat::DS || dst.getFormat().order == tcu::TextureFormat::D);
1020 const bool dstHasStencil = (dst.getFormat().order == tcu::TextureFormat::DS || dst.getFormat().order == tcu::TextureFormat::S);
1119 const TextureFormat& format = access.getFormat();
1249 DE_STATIC_ASSERT(TextureFormat::CHANNELTYPE_LAST == 38);
1270 DE_ASSERT(baseAccess.getFormat().order == TextureFormat::DS ||
1271 (mode == Sampler::MODE_DEPTH && baseAccess.getFormat().order == TextureFormat::D) ||
1272 (mode == Sampler::MODE_STENCIL && baseAccess.getFormat().order == TextureFormat::S));
1277 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV:
1282 return AccessType(TextureFormat(TextureFormat::D, TextureFormat::FLOAT),
1290 return AccessType(TextureFormat(TextureFormat::S, TextureFormat::UNSIGNED_INT8),
1303 case TextureFormat::UNSIGNED_INT_16_8_8:
1308 return AccessType(TextureFormat(TextureFormat::D, TextureFormat::UNORM_INT16),
1316 return AccessType(TextureFormat(TextureFormat::S, TextureFormat::UNSIGNED_INT8),
1329 case TextureFormat::UNSIGNED_INT_24_8:
1334 return AccessType(TextureFormat(TextureFormat::D, TextureFormat::UNORM_INT24),
1342 return AccessType(TextureFormat(TextureFormat::S, TextureFormat::UNSIGNED_INT8),
1355 case TextureFormat::UNSIGNED_INT_24_8_REV:
1360 return AccessType(TextureFormat(TextureFormat::D, TextureFormat::UNORM_INT24),
1368 return AccessType(TextureFormat(TextureFormat::S, TextureFormat::UNSIGNED_INT8),
1401 TextureFormat getEffectiveDepthStencilTextureFormat (const TextureFormat& baseFormat, Sampler::DepthStencilMode mode)
1480 static const TextureSwizzle& getBorderColorReadSwizzle (TextureFormat::ChannelOrder order)
1483 DE_STATIC_ASSERT(TextureFormat::CHANNELORDER_LAST == 21);
1502 case TextureFormat::R: swizzle = &R; break;
1503 case TextureFormat::A: swizzle = &A; break;
1504 case TextureFormat::I: swizzle = &I; break;
1505 case TextureFormat::L: swizzle = &L; break;
1506 case TextureFormat::LA: swizzle = &LA; break;
1507 case TextureFormat::RG: swizzle = &RG; break;
1508 case TextureFormat::RA: swizzle = &RA; break;
1509 case TextureFormat::RGB: swizzle = &RGB; break;
1510 case TextureFormat::RGBA: swizzle = &RGBA; break;
1511 case TextureFormat::ARGB: swizzle = &RGBA; break;
1512 case TextureFormat::BGR: swizzle = &RGB; break;
1513 case TextureFormat::BGRA: swizzle = &RGBA; break;
1514 case TextureFormat::sR: swizzle = &R; break;
1515 case TextureFormat::sRG: swizzle = &RG; break;
1516 case TextureFormat::sRGB: swizzle = &RGB; break;
1517 case TextureFormat::sRGBA: swizzle = &RGBA; break;
1518 case TextureFormat::sBGR: swizzle = &RGB; break;
1519 case TextureFormat::sBGRA: swizzle = &RGBA; break;
1520 case TextureFormat::D: swizzle = &D; break;
1521 case TextureFormat::S: swizzle = &S; break;
1523 case TextureFormat::DS:
1579 static tcu::Vec4 getTextureBorderColorFloat (const TextureFormat& format, const Sampler& sampler)
1615 static tcu::IVec4 getTextureBorderColorInt (const TextureFormat& format, const Sampler& sampler)
1644 static tcu::UVec4 getTextureBorderColorUint (const TextureFormat& format, const Sampler& sampler)
1673 tcu::Vector<ScalarType, 4> sampleTextureBorder (const TextureFormat& format, const Sampler& sampler)
1697 template tcu::Vector<float, 4> sampleTextureBorder (const TextureFormat& format, const Sampler& sampler);
1698 template tcu::Vector<deInt32, 4> sampleTextureBorder (const TextureFormat& format, const Sampler& sampler);
1699 template tcu::Vector<deUint32, 4> sampleTextureBorder (const TextureFormat& format, const Sampler& sampler);