#include "main/enums.h"
#include "main/fbobject.h"
#include "main/formats.h"
+#include "main/format_utils.h"
+#include "main/glformats.h"
#include "main/image.h"
#include "main/imports.h"
#include "main/macros.h"
/* format translation via floats */
GLuint row, slice;
GLfloat *rgba;
+ uint32_t dstMesaFormat;
+ int dstStride, srcStride;
assert(util_format_is_compressed(src->format));
if (ST_DEBUG & DEBUG_FALLBACK)
debug_printf("%s: fallback format translation\n", __FUNCTION__);
+ dstMesaFormat = _mesa_format_from_format_and_type(format, type);
+ dstStride = _mesa_image_row_stride(&ctx->Pack, width, format, type);
+ srcStride = 4 * width * sizeof(GLfloat);
for (slice = 0; slice < depth; slice++) {
if (gl_target == GL_TEXTURE_1D_ARRAY) {
/* 1D array textures.
pipe_get_tile_rgba_format(tex_xfer, map, 0, 0, width, 1,
dst_format, rgba);
- _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, format,
- type, dest, &ctx->Pack, 0);
+ _mesa_format_convert(dest, dstMesaFormat, dstStride,
+ rgba, RGBA8888_FLOAT, srcStride,
+ width, 1, NULL);
}
else {
for (row = 0; row < height; row++) {
pipe_get_tile_rgba_format(tex_xfer, map, 0, row, width, 1,
dst_format, rgba);
- _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, format,
- type, dest, &ctx->Pack, 0);
+ _mesa_format_convert(dest, dstMesaFormat, dstStride,
+ rgba, RGBA8888_FLOAT, srcStride,
+ width, 1, NULL);
}
}
map += tex_xfer->layer_stride;