Lines Matching defs:format
71 * Returns a corresponding internal floating point format for a given base
72 * format as specifed by OES_texture_float. In case of GL_FLOAT, the internal
73 * format needs to be a 32 bit component and in case of GL_HALF_FLOAT_OES it
76 * For example, given base format GL_RGBA, type GL_FLOAT return GL_RGBA32F_ARB.
80 GLenum format, GLenum type)
85 switch (format) {
104 switch (format) {
125 return format;
129 * Returns a corresponding base format for a given internal floating point
130 * format as specifed by OES_texture_float.
134 GLenum format, GLenum type)
139 switch (format) {
158 switch (format) {
175 return format;
734 make_null_texture(GLint width, GLint height, GLint depth, GLenum format)
736 const GLint components = _mesa_components_in_format(format);
782 * Set the size and format-related fields of a gl_texture_image struct
816 * \param internalFormat internal format.
817 * \param format the actual hardware format (one of MESA_FORMAT_*)
829 mesa_format format,
925 img->TexFormat = format;
936 mesa_format format)
939 internalFormat, format, 0, GL_TRUE);
1273 * \param format the MESA_FORMAT_x for the tex image
1283 mesa_format format, GLuint numSamples,
1301 bytes += _mesa_format_image_size64(format, width, height, depth);
1317 bytes = _mesa_format_image_size64(format, width, height, depth);
1333 * Return true if the format is only valid for glCompressedTexImage.
1336 compressedteximage_only_format(GLenum format)
1338 switch (format) {
1359 * Return true if the format doesn't support online compression.
1362 _mesa_format_no_online_compression(GLenum format)
1364 return _mesa_is_astc_format(format) ||
1365 _mesa_is_etc2_format(format) ||
1366 compressedteximage_only_format(format);
1382 * format are supported. The error parameter returns GL_NO_ERROR if the
1391 mesa_format format = _mesa_glenum_to_compressed_format(intFormat);
1392 enum mesa_format_layout layout = _mesa_get_format_layout(format);
1397 target_can_be_compresed = GL_TRUE; /* true for any compressed format so far */
1443 * two-dimensional images. If internalformat is an ETC2/EAC format,
1668 * Verify that a texture format is valid with a particular target
1670 * In particular, textures with base format of \c GL_DEPTH_COMPONENT or
1676 * \param internalFormat Internal format of the texture image
1690 * "Textures with a base internal format of DEPTH_COMPONENT or
1730 GLenum format)
1740 const GLboolean indexFormat = (format == GL_COLOR_INDEX);
1747 _mesa_is_depth_format(format) ||
1748 _mesa_is_depthstencil_format(format);
1750 colorFormat = _mesa_is_color_format(format);
1759 if (_mesa_is_ycbcr_format(internalFormat) != _mesa_is_ycbcr_format(format))
1766 * Test the combination of format, type and internal format arguments of
1770 * \param format pixel data format given by the user.
1772 * \param internalFormat internal format given by the user.
1780 texture_format_error_check_gles(struct gl_context *ctx, GLenum format,
1783 GLenum err = _mesa_gles_error_check_format_and_type(ctx, format, type,
1787 "%s(format = %s, type = %s, internalformat = %s)",
1788 callerName, _mesa_enum_to_string(format),
1804 * \param internalFormat internal format given by the user.
1805 * \param format pixel data format given by the user.
1827 GLenum format, GLenum type,
1836 * Instead, they cause the width, height, depth, format fields of the
1864 /* Check incoming image format and type */
1865 err = _mesa_error_check_format_and_type(ctx, format, type);
1877 "glTexImage%dD(incompatible format = %s, type = %s)",
1878 dimensions, _mesa_enum_to_string(format),
1892 * combinations of format, internalFormat, and type that can be used.
1899 texture_format_error_check_gles(ctx, format, type,
1906 width, height, depth, format, type,
1911 /* make sure internal format and format basically agree */
1912 if (!texture_formats_agree(internalFormat, format)) {
1914 "glTexImage%dD(incompatible internalFormat = %s, format = %s)",
1916 _mesa_enum_to_string(format));
1927 "glTexImage%dD(format/type YCBCR mismatch)",
1944 "glTexImage%dD(format=GL_YCBCR_MESA and border=%d)",
1968 "glTexImage%dD(no compression for format)", dimensions);
1980 (_mesa_is_enum_format_integer(format) !=
1983 "glTexImage%dD(integer/non-integer format mismatch)",
2116 * if <imageSize> is not consistent with the format, dimensions, and
2119 reason = "imageSize inconsistent with width/height/format";
2151 * \param format pixel data format given by the user.
2169 GLenum format, GLenum type, const GLvoid *pixels,
2201 err = _mesa_error_check_format_and_type(ctx, format, type);
2204 "%s(incompatible format = %s, type = %s)",
2205 callerName, _mesa_enum_to_string(format),
2210 if (!texture_formats_agree(texImage->InternalFormat, format)) {
2212 "%s(incompatible internalFormat = %s, format = %s)",
2215 _mesa_enum_to_string(format));
2224 * combinations of format, internalFormat, and type that can be used.
2229 texture_format_error_check_gles(ctx, format, type,
2236 width, height, depth, format, type,
2250 "%s(no compression for format)", callerName);
2258 _mesa_is_enum_format_integer(format)) {
2260 "%s(integer/non-integer format mismatch)", callerName);
2276 * \param internalFormat internal format given by the user.
2488 * if the texture internalformat is an integer format and the read color
2489 * buffer is not an integer format, or if the internalformat is not an
2490 * integer format and the read color buffer is an integer format."
2515 * format of the current color buffer is not signed integer; if
2516 * unsigned integer RGBA data is required and the format of the
2518 * RGBA data is required and the format of the current color buffer
2535 "glCopyTexImage%dD(no compression for format)", dimensions);
2617 "%s(no compression for format)", caller);
2636 "%s(invalid internal format %s)", caller,
2643 "%s(missing readbuffer, format=%s)", caller,
2651 * CopyTexSubImage* if the texture internalformat is an integer format
2652 * and the read color buffer is not an integer format, or if the
2653 * internalformat is not an integer format and the read color buffer
2654 * is an integer format."
2668 * framebuffer/destination texture base internal format combinations),
2731 * in size or format since that effects FBO completeness.
2768 /** Debug helper: override the user-requested internal format */
2814 * Choose the actual hardware format for a texture image.
2815 * Try to use the same format as the previous image level when possible.
2816 * Otherwise, ask the driver for the best format.
2817 * It's important to try to choose a consistant format for all levels
2825 GLenum internalFormat, GLenum format, GLenum type)
2829 /* see if we've already chosen a format for the previous level */
2833 /* See if the prev level is defined and has an internal format which
2834 * matches the new internal format.
2839 /* use the same format */
2846 format, type);
2964 * \param format the user's image format (only used if !compressed)
2973 GLint border, GLenum format, GLenum type,
2999 _mesa_enum_to_string(format),
3026 format, type, width, height, depth, border,
3057 * texture format since we'll never transcode the user's compressed
3064 * internal floating point format for the given base format.
3066 if (_mesa_is_gles(ctx) && format == internalFormat) {
3073 internalFormat = adjust_for_oes_float_texture(ctx, format, type);
3077 internalFormat, format, type);
3123 "%s%uD(image too large: %d x %d x %d, %s format)",
3165 st_TexImage(ctx, dims, texImage, format,
3189 GLint border, GLenum format, GLenum type,
3193 depth, border, format, type, imageSize, pixels, false);
3201 GLint border, GLenum format, GLenum type,
3205 depth, border, format, type, imageSize, pixels, true);
3214 GLsizei width, GLint border, GLenum format,
3219 border, format, type, 0, pixels);
3225 GLenum format, GLenum type, const GLvoid *pixels )
3235 width, 1, 1, border, format, type, 0, pixels, false);
3241 GLenum format, GLenum type, const GLvoid *pixels )
3253 border, format, type, 0, pixels, false);
3259 GLenum format, GLenum type,
3264 border, format, type, 0, pixels);
3271 GLenum format, GLenum type, const GLvoid *pixels )
3281 width, height, 1, border, format, type, 0, pixels, false);
3288 GLenum format, GLenum type, const GLvoid *pixels )
3300 border, format, type, 0, pixels, false);
3310 GLint border, GLenum format, GLenum type,
3315 width, height, depth, border, format, type, 0, pixels);
3322 GLenum format, GLenum type, const GLvoid *pixels )
3332 width, height, depth, border, format, type, 0, pixels, false);
3339 GLsizei depth, GLint border, GLenum format, GLenum type,
3352 width, height, depth, border, format, type, 0, pixels, false);
3358 GLsizei width, GLint border, GLenum format,
3363 1, border, format, type, 0, pixels);
3370 GLenum format, GLenum type, const GLvoid *pixels)
3374 height, 1, border, format, type, 0, pixels);
3381 GLint border, GLenum format, GLenum type,
3386 width, height, depth, border, format, type, 0, pixels);
3541 GLenum format, GLenum type, const GLvoid *pixels)
3567 format, type, pixels, &ctx->Unpack);
3572 * the texel data, not the texture format, size, etc.
3587 GLenum format, GLenum type, const GLvoid *pixels,
3606 width, height, depth, format, type,
3619 _mesa_enum_to_string(format),
3624 format, type, pixels);
3632 GLenum format, GLenum type, const GLvoid *pixels)
3642 format, type, pixels);
3655 GLenum format, GLenum type, const GLvoid *pixels,
3667 _mesa_enum_to_string(format),
3693 width, height, depth, format, type,
3714 * // wrong format, or given the wrong size, etc.
3727 * with the same internal format."
3730 * level here so that the image data has a consistent format and size.
3740 format, type);
3748 width, height, 1, format,
3759 width, height, depth, format,
3770 GLenum format, GLenum type, const GLvoid *pixels,
3774 zoffset, width, height, depth, format, type, pixels,
3784 GLenum format, GLenum type, const GLvoid *pixels,
3788 zoffset, width, height, depth, format, type, pixels,
3796 GLenum format, GLenum type,
3803 format, type, pixels);
3810 GLenum format, GLenum type,
3817 format, type, pixels, "glTexSubImage1D");
3825 GLenum format, GLenum type,
3832 format, type, pixels);
3840 GLenum format, GLenum type,
3847 format, type, pixels, "glTexSubImage2D");
3855 GLenum format, GLenum type,
3862 format, type, pixels);
3870 GLenum format, GLenum type,
3877 format, type, pixels, "glTexSubImage3D");
3883 GLsizei width, GLenum format, GLenum type,
3888 1, 1, format, type, pixels, "glTextureSubImage1D",
3896 GLenum format, GLenum type,
3901 1, format, type, pixels, "glTextureSubImage1DEXT",
3909 GLenum format, GLenum type,
3924 format, type, pixels);
3931 GLenum format, GLenum type,
3936 1, format, type, pixels, "glTextureSubImage1D",
3944 GLenum format, GLenum type,
3949 width, height, 1, format, type, pixels,
3957 GLsizei height, GLenum format, GLenum type,
3962 width, height, 1, format, type, pixels,
3970 GLsizei height, GLenum format, GLenum type,
3985 format, type, pixels);
3993 GLenum format, GLenum type,
3998 width, height, 1, format, type, pixels,
4006 GLsizei height, GLsizei depth, GLenum format,
4011 zoffset, width, height, depth, format, type,
4020 GLenum format, GLenum type, const GLvoid *pixels)
4024 zoffset, width, height, depth, format, type,
4033 GLenum format, GLenum type, const GLvoid *pixels)
4047 format, type, pixels);
4055 GLenum format, GLenum type,
4060 width, height, depth, format, type, pixels,
4139 * Check if the given texture format and size arguments match those
4205 * the texel data, not the texture format, size, etc.
4346 /* Conversion from GL_RGB10_A2 source buffer format is not allowed in
4352 " and writing to unsized internal format)", dims);
4357 * "If internalformat is sized, the internal format of the new texel
4359 * effective internal format. If the component sizes of internalformat
4361 * buffer’s effective internal format, described below, an
4363 * the internal format of the new texel array is the effective internal
4364 * format of the source buffer, and this is also the new texel array’s
4365 * effective internal format.
4370 " internal format)", dims);
4978 GLenum format, GLenum type,
4999 err = _mesa_error_check_format_and_type(ctx, format, type);
5002 "%s(incompatible format = %s, type = %s)",
5004 _mesa_enum_to_string(format),
5009 /* make sure internal format and format basically agree */
5010 if (!texture_formats_agree(internalFormat, format)) {
5012 "%s(incompatible internalFormat = %s, format = %s)",
5015 _mesa_enum_to_string(format));
5022 _mesa_is_enum_format_integer(format)) {
5024 "%s(integer/non-integer format mismatch)",
5037 format, type,
5040 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(invalid format)", function);
5116 GLenum format, GLenum type, const void *data)
5162 format, type, data, clearValue[0])) {
5174 format, type, data, clearValue[i]))
5193 GLenum format, GLenum type, const void *data )
5212 if (!check_clear_tex_image(ctx, "glClearTexImage", texImages[i], format,
5252 mesa_format format;
5298 * CompressedTex*SubImage3D if the internal format of the texture
5323 * <format> is one of the formats in table 8.19 and <target> is not
5327 * <format> is TEXTURE_CUBE_MAP_ARRAY and the "Cube Map Array" column of
5328 * table 8.19 is *not* checked, or if <format> is TEXTURE_3D and the "3D
5335 format = _mesa_glenum_to_compressed_format(intFormat);
5336 layout = _mesa_get_format_layout(format);
5339 /* valid format */
5347 /* invalid format */
5349 "%s(invalid target %s for format %s)", caller,
5386 GLenum format, GLsizei imageSize,
5393 _mesa_generic_compressed_format_to_uncompressed_format(format) !=
5394 format;
5398 * "An INVALID_OPERATION error is generated if format does not match the
5399 * internal format of the texture image being modified, since these commands do
5400 * not provide for image format conversion."
5404 * "An INVALID_ENUM error is generated if format is one of the generic
5407 /* this will catch any invalid compressed format token */
5408 if (!_mesa_is_compressed_format(ctx, format)) {
5411 _mesa_error(ctx, error, "%s(format)", callerName);
5432 expectedSize = compressed_tex_size(width, height, depth, format);
5445 if ((GLint) format != texImage->InternalFormat) {
5446 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format=%s)",
5447 callerName, _mesa_enum_to_string(format));
5451 if (compressedteximage_only_format(format)) {
5452 _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format=%s cannot be updated)",
5453 callerName, _mesa_enum_to_string(format));
5668 GLsizei height, GLsizei depth, GLenum format,
5679 format, imageSize, data);
5684 * the texel data, not the texture format, size, etc.
5710 GLsizei depth, GLenum format, GLsizei imageSize,
5753 compressed_subtexture_target_check(ctx, target, dim, format,
5770 height, depth, format,
5799 0, width, height, 1, format,
5802 /* Compressed images don't have a client format */
5816 depth, format, imageSize, data);
5824 GLenum format, GLsizei imageSize,
5829 1, 1, format, imageSize, data,
5837 GLsizei width, GLenum format,
5842 1, 1, format, imageSize, data,
5851 GLenum format, GLsizei imageSize,
5856 width, 1, 1, format, imageSize, data,
5864 GLsizei width, GLenum format,
5869 width, 1, 1, format, imageSize, data,
5878 GLsizei width, GLenum format,
5882 0, width, 1, 1, format, imageSize,
5892 GLsizei width, GLenum format,
5896 xoffset, 0, 0, width, 1, 1, format, imageSize,
5907 GLenum format, GLsizei imageSize,
5912 width, height, 1, format, imageSize, data,
5921 GLenum format, GLsizei imageSize,
5926 width, height, 1, format, imageSize, data,
5936 GLsizei height, GLenum format,
5940 yoffset, 0, width, height, 1, format,
5950 GLsizei width, GLsizei height, GLenum format,
5954 xoffset, yoffset, 0, width, height, 1, format,
5965 GLenum format, GLsizei imageSize,
5969 width, height, 1, format, imageSize, data,
5979 GLenum format, GLsizei imageSize,
5983 width, height, 1, format, imageSize, data,
5993 GLenum format, GLsizei imageSize,
5997 zoffset, width, height, depth, format,
6006 GLsizei height, GLsizei depth, GLenum format,
6010 zoffset, width, height, depth, format,
6021 GLenum format, GLsizei imageSize,
6025 zoffset, width, height, depth, format,
6035 GLenum format, GLsizei imageSize,
6039 zoffset, width, height, depth, format,
6051 GLsizei depth, GLenum format,
6055 zoffset, width, height, depth, format,
6066 GLsizei depth, GLenum format,
6071 format, imageSize, data,
6261 mesa_format format = _mesa_get_texbuffer_format(ctx, internalFormat);
6264 if (format == MESA_FORMAT_NONE)
6267 datatype = _mesa_get_format_datatype(format);
6275 * As a result, GL_HALF_FLOAT internal format depends on both
6283 GLenum base_format = _mesa_get_format_base_format(format);
6289 GLenum base_format = _mesa_get_format_base_format(format);
6293 return format;
6311 mesa_format format;
6337 format = _mesa_validate_texbuffer_format(ctx, internalFormat);
6338 if (format == MESA_FORMAT_NONE) {
6351 texObj->_BufferObjectFormat = format;
6357 if (old_format != format) {
6704 * except for a base format of GL_STENCIL_INDEX, unless supported.
6779 "%s(internalformat=%s not legal for immutable-format)",