Home | History | Annotate | Download | only in opengl

Lines Matching refs:TextureFormat

37  * \brief Map tcu::TextureFormat to GL pixel transfer format.
45 TransferFormat getTransferFormat (tcu::TextureFormat texFormat)
47 using tcu::TextureFormat;
55 case TextureFormat::SIGNED_INT8:
56 case TextureFormat::SIGNED_INT16:
57 case TextureFormat::SIGNED_INT32:
58 case TextureFormat::UNSIGNED_INT8:
59 case TextureFormat::UNSIGNED_INT16:
60 case TextureFormat::UNSIGNED_INT32:
61 case TextureFormat::UNSIGNED_INT_1010102_REV:
72 case TextureFormat::A: format = GL_ALPHA; break;
73 case TextureFormat::L: format = GL_LUMINANCE; break;
74 case TextureFormat::LA: format = GL_LUMINANCE_ALPHA; break;
75 case TextureFormat::R: format = isInt ? GL_RED_INTEGER : GL_RED; break;
76 case TextureFormat::RG: format = isInt ? GL_RG_INTEGER : GL_RG; break;
77 case TextureFormat::RGB: format = isInt ? GL_RGB_INTEGER : GL_RGB; break;
78 case TextureFormat::RGBA: format = isInt ? GL_RGBA_INTEGER : GL_RGBA; break;
79 case TextureFormat::sRGB: format = GL_RGB; break;
80 case TextureFormat::sRGBA: format = GL_RGBA; break;
81 case TextureFormat::D: format = GL_DEPTH_COMPONENT; break;
82 case TextureFormat::DS: format = GL_DEPTH_STENCIL; break;
83 case TextureFormat::S: format = GL_STENCIL_INDEX; break;
91 case TextureFormat::SNORM_INT8: type = GL_BYTE; break;
92 case TextureFormat::SNORM_INT16: type = GL_SHORT; break;
93 case TextureFormat::UNORM_INT8: type = GL_UNSIGNED_BYTE; break;
94 case TextureFormat::UNORM_INT16: type = GL_UNSIGNED_SHORT; break;
95 case TextureFormat::UNORM_SHORT_565: type = GL_UNSIGNED_SHORT_5_6_5; break;
96 case TextureFormat::UNORM_SHORT_4444: type = GL_UNSIGNED_SHORT_4_4_4_4; break;
97 case TextureFormat::UNORM_SHORT_5551: type = GL_UNSIGNED_SHORT_5_5_5_1; break;
98 case TextureFormat::SIGNED_INT8: type = GL_BYTE; break;
99 case TextureFormat::SIGNED_INT16: type = GL_SHORT; break;
100 case TextureFormat::SIGNED_INT32: type = GL_INT; break;
101 case TextureFormat::UNSIGNED_INT8: type = GL_UNSIGNED_BYTE; break;
102 case TextureFormat::UNSIGNED_INT16: type = GL_UNSIGNED_SHORT; break;
103 case TextureFormat::UNSIGNED_INT32: type = GL_UNSIGNED_INT; break;
104 case TextureFormat::FLOAT: type = GL_FLOAT; break;
105 case TextureFormat::UNORM_INT_101010: type = GL_UNSIGNED_INT_2_10_10_10_REV; break;
106 case TextureFormat::UNORM_INT_1010102_REV: type = GL_UNSIGNED_INT_2_10_10_10_REV; break;
107 case TextureFormat::UNSIGNED_INT_1010102_REV: type = GL_UNSIGNED_INT_2_10_10_10_REV; break;
108 case TextureFormat::UNSIGNED_INT_11F_11F_10F_REV: type = GL_UNSIGNED_INT_10F_11F_11F_REV; break;
109 case TextureFormat::UNSIGNED_INT_999_E5_REV: type = GL_UNSIGNED_INT_5_9_9_9_REV; break;
110 case TextureFormat::HALF_FLOAT: type = GL_HALF_FLOAT; break;
111 case TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV: type = GL_FLOAT_32_UNSIGNED_INT_24_8_REV; break;
112 case TextureFormat::UNSIGNED_INT_24_8: type = texFormat.order == TextureFormat::D
124 * \brief Map tcu::TextureFormat to GL internal sized format.
132 deUint32 getInternalFormat (tcu::TextureFormat texFormat)
134 DE_STATIC_ASSERT(tcu::TextureFormat::CHANNELORDER_LAST < (1<<16));
135 DE_STATIC_ASSERT(tcu::TextureFormat::CHANNELTYPE_LAST < (1<<16));
138 #define FMT_CASE(ORDER, TYPE) PACK_FMT(tcu::TextureFormat::ORDER, tcu::TextureFormat::TYPE)
277 static tcu::TextureFormat::ChannelType mapGLChannelType (deUint32 dataType, bool normalized)
280 using tcu::TextureFormat;
284 case GL_UNSIGNED_BYTE: return normalized ? TextureFormat::UNORM_INT8 : TextureFormat::UNSIGNED_INT8;
285 case GL_BYTE: return normalized ? TextureFormat::SNORM_INT8 : TextureFormat::SIGNED_INT8;
286 case GL_UNSIGNED_SHORT: return normalized ? TextureFormat::UNORM_INT16 : TextureFormat::UNSIGNED_INT16;
287 case GL_SHORT: return normalized ? TextureFormat::SNORM_INT16 : TextureFormat::SIGNED_INT16;
288 case GL_UNSIGNED_INT: return normalized ? TextureFormat::UNORM_INT32 : TextureFormat::UNSIGNED_INT32;
289 case GL_INT: return normalized ? TextureFormat::SNORM_INT32 : TextureFormat::SIGNED_INT32;
290 case GL_FLOAT: return TextureFormat::FLOAT;
291 case GL_UNSIGNED_SHORT_4_4_4_4: return TextureFormat::UNORM_SHORT_4444;
292 case GL_UNSIGNED_SHORT_5_5_5_1: return TextureFormat::UNORM_SHORT_5551;
293 case GL_UNSIGNED_SHORT_5_6_5: return TextureFormat::UNORM_SHORT_565;
294 case GL_HALF_FLOAT: return TextureFormat::HALF_FLOAT;
295 case GL_UNSIGNED_INT_2_10_10_10_REV: return normalized ? TextureFormat::UNORM_INT_1010102_REV : TextureFormat::UNSIGNED_INT_1010102_REV;
296 case GL_UNSIGNED_INT_10F_11F_11F_REV: return TextureFormat::UNSIGNED_INT_11F_11F_10F_REV;
297 case GL_UNSIGNED_INT_24_8: return TextureFormat::UNSIGNED_INT_24_8;
298 case GL_FLOAT_32_UNSIGNED_INT_24_8_REV: return TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV;
299 case GL_UNSIGNED_INT_5_9_9_9_REV: return TextureFormat::UNSIGNED_INT_999_E5_REV;
303 return TextureFormat::CHANNELTYPE_LAST;
308 * \brief Map GL pixel transfer format to tcu::TextureFormat.
316 tcu::TextureFormat
318 using tcu::TextureFormat;
321 case GL_ALPHA: return TextureFormat(TextureFormat::A, mapGLChannelType(dataType, true));
322 case GL_LUMINANCE: return TextureFormat(TextureFormat::L, mapGLChannelType(dataType, true));
323 case GL_LUMINANCE_ALPHA: return TextureFormat(TextureFormat::LA, mapGLChannelType(dataType, true));
324 case GL_RGB: return TextureFormat(TextureFormat::RGB, mapGLChannelType(dataType, true));
325 case GL_RGBA: return TextureFormat(TextureFormat::RGBA, mapGLChannelType(dataType, true));
326 case GL_BGRA: return TextureFormat(TextureFormat::BGRA, mapGLChannelType(dataType, true));
327 case GL_RG: return TextureFormat(TextureFormat::RG, mapGLChannelType(dataType, true));
328 case GL_RED: return TextureFormat(TextureFormat::R, mapGLChannelType(dataType, true));
329 case GL_RGBA_INTEGER: return TextureFormat(TextureFormat::RGBA, mapGLChannelType(dataType, false));
330 case GL_RGB_INTEGER: return TextureFormat(TextureFormat::RGB, mapGLChannelType(dataType, false));
331 case GL_RG_INTEGER: return TextureFormat(TextureFormat::RG, mapGLChannelType(dataType, false));
332 case GL_RED_INTEGER: return TextureFormat(TextureFormat::R, mapGLChannelType(dataType, false));
334 case GL_DEPTH_COMPONENT: return TextureFormat(TextureFormat::D, mapGLChannelType(dataType, true));
335 case GL_DEPTH_STENCIL: return TextureFormat(TextureFormat::DS, mapGLChannelType(dataType, true));
343 * \brief Map GL internal texture format to tcu::TextureFormat.
350 tcu::TextureFormat mapGLInternalFormat (deUint32 internalFormat)
352 using tcu::TextureFormat;
355 case GL_RGB5_A1: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_SHORT_5551);
356 case GL_RGBA4: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_SHORT_4444);
357 case GL_RGB565: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_SHORT_565);
358 case GL_DEPTH_COMPONENT16: return TextureFormat(TextureFormat::D, TextureFormat::UNORM_INT16);
359 case GL_STENCIL_INDEX8: return TextureFormat(TextureFormat::S, TextureFormat::UNSIGNED_INT8);
361 case GL_RGBA32F: return TextureFormat(TextureFormat::RGBA, TextureFormat::FLOAT);
362 case GL_RGBA32I: return TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT32);
363 case GL_RGBA32UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT32);
364 case GL_RGBA16: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT16);
365 case GL_RGBA16_SNORM: return TextureFormat(TextureFormat::RGBA, TextureFormat::SNORM_INT16);
366 case GL_RGBA16F: return TextureFormat(TextureFormat::RGBA, TextureFormat::HALF_FLOAT);
367 case GL_RGBA16I: return TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT16);
368 case GL_RGBA16UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT16);
369 case GL_RGBA8: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT8);
370 case GL_RGBA8I: return TextureFormat(TextureFormat::RGBA, TextureFormat::SIGNED_INT8);
371 case GL_RGBA8UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT8);
372 case GL_SRGB8_ALPHA8: return TextureFormat(TextureFormat::sRGBA, TextureFormat::UNORM_INT8);
373 case GL_RGB10_A2: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNORM_INT_1010102_REV);
374 case GL_RGB10_A2UI: return TextureFormat(TextureFormat::RGBA, TextureFormat::UNSIGNED_INT_1010102_REV);
375 case GL_RGBA8_SNORM: return TextureFormat(TextureFormat::RGBA, TextureFormat::SNORM_INT8);
377 case GL_RGB8: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_INT8);
378 case GL_R11F_G11F_B10F: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT_11F_11F_10F_REV);
379 case GL_RGB32F: return TextureFormat(TextureFormat::RGB, TextureFormat::FLOAT);
380 case GL_RGB32I: return TextureFormat(TextureFormat::RGB, TextureFormat::SIGNED_INT32);
381 case GL_RGB32UI: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT32);
382 case GL_RGB16: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_INT16);
383 case GL_RGB16_SNORM: return TextureFormat(TextureFormat::RGB, TextureFormat::SNORM_INT16);
384 case GL_RGB16F: return TextureFormat(TextureFormat::RGB, TextureFormat::HALF_FLOAT);
385 case GL_RGB16I: return TextureFormat(TextureFormat::RGB, TextureFormat::SIGNED_INT16);
386 case GL_RGB16UI: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT16);
387 case GL_RGB8_SNORM: return TextureFormat(TextureFormat::RGB, TextureFormat::SNORM_INT8);
388 case GL_RGB8I: return TextureFormat(TextureFormat::RGB, TextureFormat::SIGNED_INT8);
389 case GL_RGB8UI: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT8);
390 case GL_SRGB8: return TextureFormat(TextureFormat::sRGB, TextureFormat::UNORM_INT8);
391 case GL_RGB9_E5: return TextureFormat(TextureFormat::RGB, TextureFormat::UNSIGNED_INT_999_E5_REV);
392 case GL_RGB10: return TextureFormat(TextureFormat::RGB, TextureFormat::UNORM_INT_1010102_REV);
394 case GL_RG32F: return TextureFormat(TextureFormat::RG, TextureFormat::FLOAT);
395 case GL_RG32I: return TextureFormat(TextureFormat::RG, TextureFormat::SIGNED_INT32);
396 case GL_RG32UI: return TextureFormat(TextureFormat::RG, TextureFormat::UNSIGNED_INT32);
397 case GL_RG16: return TextureFormat(TextureFormat::RG, TextureFormat::UNORM_INT16);
398 case GL_RG16_SNORM: return TextureFormat(TextureFormat::RG, TextureFormat::SNORM_INT16);
399 case GL_RG16F: return TextureFormat(TextureFormat::RG, TextureFormat::HALF_FLOAT);
400 case GL_RG16I: return TextureFormat(TextureFormat::RG, TextureFormat::SIGNED_INT16);
401 case GL_RG16UI: return TextureFormat(TextureFormat::RG, TextureFormat::UNSIGNED_INT16);
402 case GL_RG8: return TextureFormat(TextureFormat::RG, TextureFormat::UNORM_INT8);
403 case GL_RG8I: return TextureFormat(TextureFormat::RG, TextureFormat::SIGNED_INT8);
404 case GL_RG8UI: return TextureFormat(TextureFormat::RG, TextureFormat::UNSIGNED_INT8);
405 case GL_RG8_SNORM: return TextureFormat(TextureFormat::RG, TextureFormat::SNORM_INT8);
407 case GL_R32F: return TextureFormat(TextureFormat::R, TextureFormat::FLOAT);
408 case GL_R32I: return TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT32);
409 case GL_R32UI: return TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT32);
410 case GL_R16: return TextureFormat(TextureFormat::R, TextureFormat::UNORM_INT16);
411 case GL_R16_SNORM: return TextureFormat(TextureFormat::R, TextureFormat::SNORM_INT16);
412 case GL_R16F: return TextureFormat(TextureFormat::R, TextureFormat::HALF_FLOAT);
413 case GL_R16I: return TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT16);
414 case GL_R16UI: return TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT16);
415 case GL_R8: return TextureFormat(TextureFormat::R, TextureFormat::UNORM_INT8);
416 case GL_R8I: return TextureFormat(TextureFormat::R, TextureFormat::SIGNED_INT8);
417 case GL_R8UI: return TextureFormat(TextureFormat::R, TextureFormat::UNSIGNED_INT8);
418 case GL_R8_SNORM: return TextureFormat(TextureFormat::R, TextureFormat::SNORM_INT8);
420 case GL_DEPTH_COMPONENT32F: return TextureFormat(TextureFormat::D, TextureFormat::FLOAT);
421 case GL_DEPTH_COMPONENT24: return TextureFormat(TextureFormat::D, TextureFormat::UNSIGNED_INT_24_8);
422 case GL_DEPTH_COMPONENT32: return TextureFormat(TextureFormat::D, TextureFormat::UNSIGNED_INT32);
423 case GL_DEPTH32F_STENCIL8: return TextureFormat(TextureFormat::DS, TextureFormat::FLOAT_UNSIGNED_INT_24_8_REV);
424 case GL_DEPTH24_STENCIL8: return TextureFormat(TextureFormat::DS, TextureFormat::UNSIGNED_INT_24_8);
707 DataType getSampler1DType (tcu::TextureFormat format)
709 using tcu::TextureFormat;
711 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
714 if (format.order == TextureFormat::S)
743 DataType getSampler2DType (tcu::TextureFormat format)
745 using tcu::TextureFormat;
747 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
750 if (format.order == TextureFormat::S)
779 DataType getSamplerCubeType (tcu::TextureFormat format)
781 using tcu::TextureFormat;
783 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
786 if (format.order == TextureFormat::S)
815 DataType getSampler2DArrayType (tcu::TextureFormat format)
817 using tcu::TextureFormat;
819 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
822 if (format.order == TextureFormat::S)
851 DataType getSampler3DType (tcu::TextureFormat format)
853 using tcu::TextureFormat;
855 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
858 if (format.order == TextureFormat::S)
887 DataType getSamplerCubeArrayType (tcu::TextureFormat format)
889 using tcu::TextureFormat;
891 if (format.order == TextureFormat::D || format.order == TextureFormat::DS)
894 if (format.order == TextureFormat::S)