Lines Matching refs:TextureFormat
38 * \brief Map tcu::TextureFormat to GL pixel transfer format.
46 TransferFormat getTransferFormat (tcu::TextureFormat texFormat)
48 using tcu::TextureFormat;
56 case TextureFormat::SIGNED_INT8:
57 case TextureFormat::SIGNED_INT16:
58 case TextureFormat::SIGNED_INT32:
59 case TextureFormat::UNSIGNED_INT8:
60 case TextureFormat::UNSIGNED_INT16:
61 case TextureFormat::UNSIGNED_INT32:
62 case TextureFormat::UNSIGNED_INT_1010102_REV:
73 case TextureFormat::A: format = GL_ALPHA; break;
74 case TextureFormat::L: format = GL_LUMINANCE; break;
75 case TextureFormat::LA: format = GL_LUMINANCE_ALPHA; break;
76 case TextureFormat::R: format = isInt ? GL_RED_INTEGER : GL_RED; break;
77 case TextureFormat::RG: format = isInt ? GL_RG_INTEGER : GL_RG; break;
78 case TextureFormat::RGB: format = isInt ? GL_RGB_INTEGER : GL_RGB; break;
79 case TextureFormat::RGBA: format = isInt ? GL_RGBA_INTEGER : GL_RGBA; break;
80 case TextureFormat::sR: format = GL_RED; break;
81 case TextureFormat::sRG: format = GL_RG; break;
82 case TextureFormat::sRGB: format = GL_RGB; break;
83 case TextureFormat::sRGBA: format = GL_RGBA; break;
84 case TextureFormat::D: format = GL_DEPTH_COMPONENT; break;
85 case TextureFormat::DS: format = GL_DEPTH_STENCIL; break;
86 case TextureFormat::S: format = GL_STENCIL_INDEX; break;
88 case TextureFormat::BGRA:
99 case TextureFormat::SNORM_INT8: type = GL_BYTE; break;
100 case TextureFormat::SNORM_INT16: type = GL_SHORT; break;
101 case TextureFormat::UNORM_INT8: type = GL_UNSIGNED_BYTE; break;
102 case TextureFormat::UNORM_INT16: type = GL_UNSIGNED_SHORT; break;
103 case TextureFormat::UNORM_SHORT_565: type = GL_UNSIGNED_SHORT_5_6_5; break;
104 case TextureFormat::UNORM_SHORT_4444: type = GL_UNSIGNED_SHORT_4_4_4_4; break;
105 case TextureFormat::UNORM_SHORT_5551: type = GL_UNSIGNED_SHORT_5_5_5_1; break;
106 case TextureFormat::SIGNED_INT8: type = GL_BYTE; break;
107 case TextureFormat::SIGNED_INT16: type = GL_SHORT; break;
108 case TextureFormat::SIGNED_INT32: type = GL_INT; break;
109 case TextureFormat::UNSIGNED_INT8: type = GL_UNSIGNED_BYTE; break;
110 case TextureFormat::UNSIGNED_INT16: type = GL_UNSIGNED_SHORT; break;
111 case TextureFormat::UNSIGNED_INT32: type = GL_UNSIGNED_INT; break;
112 case TextureFormat::FLOAT: type = GL_FLOAT; break;
113 case TextureFormat::UNORM_INT_101010: type = GL_UNSIGNED_INT_2_10_10_10_REV; break;
114 case TextureFormat::UNORM_INT_1010102_REV: type = GL_UNSIGNED_INT_2_10_10_10_REV; break;
115 case TextureFormat::UNSIGNED_INT_1010102_REV: type = GL_UNSIGNED_INT_2_10_10_10_REV; break;
116 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: type = GL_UNSIGNED_INT_10F_11F_11F_REV; break;
117 case TextureFormat::UNSIGNED_INT_999_E5_REV: type = GL_UNSIGNED_INT_5_9_9_9_REV; break;
118 case TextureFormat::HALF_FLOAT: type = GL_HALF_FLOAT; break;
119 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV; break;
120 case TextureFormat::UNSIGNED_INT_24_8: type = texFormat.order == TextureFormat::D
132 * \brief Map tcu::TextureFormat to GL internal sized format.
140 deUint32 getInternalFormat (tcu::TextureFormat texFormat)
142 DE_STATIC_ASSERT(tcu::TextureFormat::CHANNELORDER_LAST < (1<<16));
143 DE_STATIC_ASSERT(tcu::TextureFormat::CHANNELTYPE_LAST < (1<<16));
146 #define FMT_CASE(ORDER, TYPE) PACK_FMT(tcu::TextureFormat::ORDER, tcu::TextureFormat::TYPE)
396 static tcu::TextureFormat::ChannelType mapGLChannelType (deUint32 dataType, bool normalized)
399 using tcu::TextureFormat;
403 case GL_UNSIGNED_BYTE: return normalized ? TextureFormat::UNORM_INT8 : TextureFormat::UNSIGNED_INT8;
404 case GL_BYTE: return normalized ? TextureFormat::SNORM_INT8 : TextureFormat::SIGNED_INT8;
405 case GL_UNSIGNED_SHORT: return normalized ? TextureFormat::UNORM_INT16 : TextureFormat::UNSIGNED_INT16;
406 case GL_SHORT: return normalized ? TextureFormat::SNORM_INT16 : TextureFormat::SIGNED_INT16;
407 case GL_UNSIGNED_INT: return normalized ? TextureFormat::UNORM_INT32 : TextureFormat::UNSIGNED_INT32;
408 case GL_INT: return normalized ? TextureFormat::SNORM_INT32 : TextureFormat::SIGNED_INT32;
409 case GL_FLOAT: return TextureFormat::FLOAT;
410 case GL_UNSIGNED_SHORT_4_4_4_4: return TextureFormat::UNORM_SHORT_4444;
411 case GL_UNSIGNED_SHORT_5_5_5_1: return TextureFormat::UNORM_SHORT_5551;
412 case GL_UNSIGNED_SHORT_5_6_5: return TextureFormat::UNORM_SHORT_565;
413 case GL_HALF_FLOAT: return TextureFormat::HALF_FLOAT;
414 case GL_UNSIGNED_INT_2_10_10_10_REV: return normalized ? TextureFormat::UNORM_INT_1010102_REV : TextureFormat::UNSIGNED_INT_1010102_REV;
415 case GL_UNSIGNED_INT_10F_11F_11F_REV: return TextureFormat::UNSIGNED_INT_11F_11F_10F_REV;
416 case GL_UNSIGNED_INT_24_8: return TextureFormat::UNSIGNED_INT_24_8;
417 case GL_FLOAT_32_UNSIGNED_INT_24_8_REV: return TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV;
418 case GL_UNSIGNED_INT_5_9_9_9_REV: return TextureFormat::UNSIGNED_INT_999_E5_REV;
421 case GL_HALF_FLOAT_OES: return TextureFormat::HALF_FLOAT;
425 return TextureFormat::CHANNELTYPE_LAST;
430 * \brief Map GL pixel transfer format to tcu::TextureFormat.
438 tcu::TextureFormat mapGLTransferFormat (deUint32 format, deUint32 dataType)
440 using tcu::TextureFormat;
443 case GL_ALPHA: return TextureFormat(TextureFormat::A, mapGLChannelType(dataType, true));
444 case GL_LUMINANCE: return TextureFormat(TextureFormat::L, mapGLChannelType(dataType, true));
445 case GL_LUMINANCE_ALPHA: return TextureFormat(TextureFormat::LA, mapGLChannelType(dataType, true));
446 case GL_RGB: return TextureFormat(TextureFormat::RGB, mapGLChannelType(dataType, true));
447 case GL_RGBA: return TextureFormat(TextureFormat::RGBA, mapGLChannelType(dataType, true));
448 case GL_BGRA: return TextureFormat(TextureFormat::BGRA, mapGLChannelType(dataType, true));
449 case GL_RG: return TextureFormat(TextureFormat::RG, mapGLChannelType(dataType, true));
450 case GL_RED: return TextureFormat(TextureFormat::R, mapGLChannelType(dataType, true));
451 case GL_RGBA_INTEGER: return TextureFormat(TextureFormat::RGBA, mapGLChannelType(dataType, false));
452 case GL_RGB_INTEGER: return TextureFormat(TextureFormat::RGB, mapGLChannelType(dataType, false));
453 case GL_RG_INTEGER: return TextureFormat(TextureFormat::RG, mapGLChannelType(dataType, false));
454 case GL_RED_INTEGER: return TextureFormat(TextureFormat::R, mapGLChannelType(dataType, false));
455 case GL_SRGB: return TextureFormat(TextureFormat::sRGB, mapGLChannelType(dataType, false));
456 case GL_SRGB_ALPHA: return TextureFormat(TextureFormat::sRGBA, mapGLChannelType(dataType, false));
458 case GL_DEPTH_COMPONENT: return TextureFormat(TextureFormat::D, mapGLChannelType(dataType, true));
459 case GL_DEPTH_STENCIL: return TextureFormat(TextureFormat::DS, mapGLChannelType(dataType, true));
467 * \brief Map GL internal texture format to tcu::TextureFormat.
474 tcu::TextureFormat mapGLInternalFormat (deUint32 internalFormat)
476 using tcu::TextureFormat;
479 case GL_RGB5_A1: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_SHORT_5551);
480 case GL_RGBA4: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_SHORT_4444);
481 case GL_RGB565: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_SHORT_565);
482 case GL_DEPTH_COMPONENT16: return TextureFormat(TextureFormat::D, TextureFormat::UNORM_INT16);
483 case GL_STENCIL_INDEX8: return TextureFormat(TextureFormat::S, TextureFormat::UNSIGNED_INT8);
485 case GL_RGBA32F: return TextureFormat(TextureFormat::RGBA, TextureFormat::FLOAT);
486 case GL_RGBA32I: return TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT32);
487 case GL_RGBA32UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT32);
488 case GL_RGBA16: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT16);
489 case GL_RGBA16_SNORM: return TextureFormat(TextureFormat::RGBA, TextureFormat::SNORM_INT16);
490 case GL_RGBA16F: return TextureFormat(TextureFormat::RGBA, TextureFormat::HALF_FLOAT);
491 case GL_RGBA16I: return TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT16);
492 case GL_RGBA16UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT16);
493 case GL_RGBA8: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8);
494 case GL_RGBA8I: return TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT8);
495 case GL_RGBA8UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT8);
496 case GL_SRGB8_ALPHA8: return TextureFormat(TextureFormat::sRGBA, TextureFormat::UNORM_INT8);
497 case GL_RGB10_A2: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT_1010102_REV);
498 case GL_RGB10_A2UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT_1010102_REV);
499 case GL_RGBA8_SNORM: return TextureFormat(TextureFormat::RGBA, TextureFormat::SNORM_INT8);
501 case GL_RGB8: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_INT8);
502 case GL_R11F_G11F_B10F: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT_11F_11F_10F_REV);
503 case GL_RGB32F: return TextureFormat(TextureFormat::RGB, TextureFormat::FLOAT);
504 case GL_RGB32I: return TextureFormat(TextureFormat::RGB, TextureFormat::SIGNED_INT32);
505 case GL_RGB32UI: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT32);
506 case GL_RGB16: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_INT16);
507 case GL_RGB16_SNORM: return TextureFormat(TextureFormat::RGB, TextureFormat::SNORM_INT16);
508 case GL_RGB16F: return TextureFormat(TextureFormat::RGB, TextureFormat::HALF_FLOAT);
509 case GL_RGB16I: return TextureFormat(TextureFormat::RGB, TextureFormat::SIGNED_INT16);
510 case GL_RGB16UI: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT16);
511 case GL_RGB8_SNORM: return TextureFormat(TextureFormat::RGB, TextureFormat::SNORM_INT8);
512 case GL_RGB8I: return TextureFormat(TextureFormat::RGB, TextureFormat::SIGNED_INT8);
513 case GL_RGB8UI: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT8);
514 case GL_SRGB8: return TextureFormat(TextureFormat::sRGB, TextureFormat::UNORM_INT8);
515 case GL_RGB9_E5: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT_999_E5_REV);
516 case GL_RGB10: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_INT_1010102_REV);
518 case GL_RG32F: return TextureFormat(TextureFormat::RG, TextureFormat::FLOAT);
519 case GL_RG32I: return TextureFormat(TextureFormat::RG, TextureFormat::SIGNED_INT32);
520 case GL_RG32UI: return TextureFormat(TextureFormat::RG, TextureFormat::UNSIGNED_INT32);
521 case GL_RG16: return TextureFormat(TextureFormat::RG, TextureFormat::UNORM_INT16);
522 case GL_RG16_SNORM: return TextureFormat(TextureFormat::RG, TextureFormat::SNORM_INT16);
523 case GL_RG16F: return TextureFormat(TextureFormat::RG, TextureFormat::HALF_FLOAT);
524 case GL_RG16I: return TextureFormat(TextureFormat::RG, TextureFormat::SIGNED_INT16);
525 case GL_RG16UI: return TextureFormat(TextureFormat::RG, TextureFormat::UNSIGNED_INT16);
526 case GL_RG8: return TextureFormat(TextureFormat::RG, TextureFormat::UNORM_INT8);
527 case GL_RG8I: return TextureFormat(TextureFormat::RG, TextureFormat::SIGNED_INT8);
528 case GL_RG8UI: return TextureFormat(TextureFormat::RG, TextureFormat::UNSIGNED_INT8);
529 case GL_RG8_SNORM: return TextureFormat(TextureFormat::RG, TextureFormat::SNORM_INT8);
530 case GL_SRG8_EXT: return TextureFormat(TextureFormat::sRG, TextureFormat::UNORM_INT8);
532 case GL_R32F: return TextureFormat(TextureFormat::R, TextureFormat::FLOAT);
533 case GL_R32I: return TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT32);
534 case GL_R32UI: return TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32);
535 case GL_R16: return TextureFormat(TextureFormat::R, TextureFormat::UNORM_INT16);
536 case GL_R16_SNORM: return TextureFormat(TextureFormat::R, TextureFormat::SNORM_INT16);
537 case GL_R16F: return TextureFormat(TextureFormat::R, TextureFormat::HALF_FLOAT);
538 case GL_R16I: return TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT16);
539 case GL_R16UI: return TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT16);
540 case GL_R8: return TextureFormat(TextureFormat::R, TextureFormat::UNORM_INT8);
541 case GL_R8I: return TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT8);
542 case GL_R8UI: return TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT8);
543 case GL_R8_SNORM: return TextureFormat(TextureFormat::R, TextureFormat::SNORM_INT8);
544 case GL_SR8_EXT: return TextureFormat(TextureFormat::sR, TextureFormat::UNORM_INT8);
546 case GL_DEPTH_COMPONENT32F: return TextureFormat(TextureFormat::D, TextureFormat::FLOAT);
547 case GL_DEPTH_COMPONENT24: return TextureFormat(TextureFormat::D, TextureFormat::UNSIGNED_INT_24_8);
548 case GL_DEPTH_COMPONENT32: return TextureFormat(TextureFormat::D, TextureFormat::UNSIGNED_INT32);
549 case GL_DEPTH32F_STENCIL8: return TextureFormat(TextureFormat::DS, TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV);
550 case GL_DEPTH24_STENCIL8: return TextureFormat(TextureFormat::DS, TextureFormat::UNSIGNED_INT_24_8);
861 DataType getSampler1DType (tcu::TextureFormat format)
863 using tcu::TextureFormat;
865 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
868 if (format.order == TextureFormat::S)
897 DataType getSampler2DType (tcu::TextureFormat format)
899 using tcu::TextureFormat;
901 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
904 if (format.order == TextureFormat::S)
933 DataType getSamplerCubeType (tcu::TextureFormat format)
935 using tcu::TextureFormat;
937 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
940 if (format.order == TextureFormat::S)
969 DataType getSampler1DArrayType (tcu::TextureFormat format)
971 using tcu::TextureFormat;
973 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
976 if (format.order == TextureFormat::S)
1005 DataType getSampler2DArrayType (tcu::TextureFormat format)
1007 using tcu::TextureFormat;
1009 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
1012 if (format.order == TextureFormat::S)
1041 DataType getSampler3DType (tcu::TextureFormat format)
1043 using tcu::TextureFormat;
1045 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
1048 if (format.order == TextureFormat::S)
1077 DataType getSamplerCubeArrayType (tcu::TextureFormat format)
1079 using tcu::TextureFormat;
1081 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
1084 if (format.order == TextureFormat::S)