Lines Matching defs:format
89 GLenum format, GLenum type,
94 GLenum dstBaseFormat = _mesa_unpack_format_to_base_format(format);
96 if (format == GL_DEPTH_COMPONENT ||
97 format == GL_DEPTH_STENCIL ||
98 format == GL_STENCIL_INDEX) {
105 if (_mesa_is_enum_format_integer(format)) {
135 /* If the format is unsigned normalized, we can ignore clamping
154 * NOTE: This doesn't take swizzling and format conversions between
158 _mesa_readpixels_needs_slow_path(const struct gl_context *ctx, GLenum format,
162 _mesa_get_read_renderbuffer_for_format(ctx, format);
163 GLenum dstBaseFormat = _mesa_unpack_format_to_base_format(format);
167 /* There are different rules depending on the base format. */
168 switch (format) {
190 return _mesa_get_readpixels_transfer_ops(ctx, rb->Format, format, type,
198 readpixels_can_use_memcpy(const struct gl_context *ctx, GLenum format, GLenum type,
202 _mesa_get_read_renderbuffer_for_format(ctx, format);
206 if (_mesa_readpixels_needs_slow_path(ctx, format, type, GL_FALSE)) {
210 /* The base internal format and the base Mesa format must match. */
215 /* The Mesa format must match the input format and type. */
216 if (!_mesa_format_matches_format_and_type(rb->Format, format, type,
229 GLenum format, GLenum type,
234 _mesa_get_read_renderbuffer_for_format(ctx, format);
239 if (!readpixels_can_use_memcpy(ctx, format, type, packing)) {
243 dstStride = _mesa_image_row_stride(packing, width, format, type);
245 format, type, 0, 0);
322 * Read pixels for format=GL_DEPTH_COMPONENT.
386 * Read pixels for format=GL_STENCIL_INDEX.
443 GLenum format, GLenum type, GLvoid *pixels,
458 GLenum dstBaseFormat = _mesa_unpack_format_to_base_format(format);
463 transferOps = _mesa_get_readpixels_transfer_ops(ctx, rb->Format, format,
465 /* Describe the dst format */
466 dst_is_integer = _mesa_is_enum_format_integer(format);
467 dst_stride = _mesa_image_row_stride(packing, width, format, type);
468 dst_format = _mesa_format_from_format_and_type(format, type);
472 format, type, 0, 0);
509 * first so we can call _mesa_apply_rgba_transfer_ops. If the dst format is
540 /* If we are lucky and the dst format matches the RGBA format we need to
570 /* If we were lucky and our RGBA conversion matches the dst format, then
589 * If the dst format is Luminance, we need to do the conversion by computing
604 if (format == GL_LUMINANCE_ALPHA)
614 luminance, format, transferOps);
619 luminance_format = _mesa_format_from_format_and_type(format, GL_FLOAT);
626 dst, format, type);
634 _mesa_swap_bytes_2d_image(format, type, packing,
874 GLenum format, GLenum type,
885 if (readpixels_memcpy(ctx, x, y, width, height, format, type,
892 switch (format) {
907 read_rgba_pixels(ctx, x, y, width, height, format, type, pixels,
917 read_pixels_es3_error_check(struct gl_context *ctx, GLenum format, GLenum type,
931 switch (format) {
1038 read_pixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
1052 _mesa_enum_to_string(format),
1073 rb = _mesa_get_read_renderbuffer_for_format(ctx, format);
1082 * combinations of format and type that can be used.
1091 _mesa_is_color_format(format) &&
1092 _mesa_get_color_read_format(ctx, NULL, "glReadPixels") == format &&
1096 err = _mesa_es_error_check_format_and_type(ctx, format, type, 2);
1103 err = read_pixels_es3_error_check(ctx, format, type, rb);
1107 _mesa_error(ctx, err, "glReadPixels(invalid format %s and/or type %s)",
1108 _mesa_enum_to_string(format),
1114 err = _mesa_error_check_format_and_type(ctx, format, type);
1116 _mesa_error(ctx, err, "glReadPixels(invalid format %s and/or type %s)",
1117 _mesa_enum_to_string(format),
1128 if (!_mesa_source_buffer_exists(ctx, format)) {
1133 /* Check that the destination format and source buffer are both
1136 if (ctx->Extensions.EXT_texture_integer && _mesa_is_color_format(format)) {
1139 const GLboolean dstInteger = _mesa_is_enum_format_integer(format);
1142 "glReadPixels(integer / non-integer format mismatch");
1155 format, type, bufSize, pixels)) {
1179 format, type, &clippedPacking, pixels);
1184 GLenum format, GLenum type, GLsizei bufSize,
1187 read_pixels(x, y, width, height, format, type, bufSize, pixels, true);
1192 GLenum format, GLenum type, GLsizei bufSize,
1195 read_pixels(x, y, width, height, format, type, bufSize, pixels, false);
1200 GLenum format, GLenum type, GLvoid *pixels)
1202 _mesa_ReadnPixelsARB_no_error(x, y, width, height, format, type, INT_MAX,
1208 GLenum format, GLenum type, GLvoid *pixels)
1210 _mesa_ReadnPixelsARB(x, y, width, height, format, type, INT_MAX, pixels);