#include "util/format/u_format.h"
#include "util/format/u_format_bptc.h"
+#include "u_format_pack.h"
#include "util/format_srgb.h"
#include "util/u_math.h"
decompress_rgba_unorm(width, height,
src_row, src_stride,
temp_block, width * 4 * sizeof(uint8_t));
- util_format_read_4(PIPE_FORMAT_R8G8B8A8_UNORM,
+ util_format_r8g8b8a8_unorm_unpack_rgba_float(
dst_row, dst_stride,
temp_block, width * 4 * sizeof(uint8_t),
- 0, 0, width, height);
+ width, height);
free((void *) temp_block);
}
{
uint8_t *temp_block;
temp_block = malloc(width * height * 4 * sizeof(uint8_t));
- util_format_read_4ub(PIPE_FORMAT_R32G32B32A32_FLOAT,
+ util_format_r32g32b32a32_float_unpack_rgba_8unorm(
temp_block, width * 4 * sizeof(uint8_t),
- src_row, src_stride,
- 0, 0, width, height);
+ (uint8_t *)src_row, src_stride,
+ width, height);
compress_rgba_unorm(width, height,
temp_block, width * 4 * sizeof(uint8_t),
dst_row, dst_stride);
decompress_rgba_unorm(width, height,
src_row, src_stride,
temp_block, width * 4 * sizeof(uint8_t));
- util_format_read_4(PIPE_FORMAT_R8G8B8A8_SRGB,
- dst_row, dst_stride,
- temp_block, width * 4 * sizeof(uint8_t),
- 0, 0, width, height);
+ util_format_r8g8b8a8_srgb_unpack_rgba_float(dst_row, dst_stride,
+ temp_block, width * 4 * sizeof(uint8_t),
+ width, height);
+
free((void *) temp_block);
}
fetch_rgba_unorm_from_block(src + ((width * sizeof(uint8_t)) * (height / 4) + (width / 4)) * 16,
temp_block, (width % 4) + (height % 4) * 4);
- util_format_read_4(PIPE_FORMAT_R8G8B8A8_SRGB,
- dst, 4 * sizeof(float),
- temp_block, width * 4 * sizeof(uint8_t),
- 0, 0, 1, 1);
+ util_format_r8g8b8a8_srgb_fetch_rgba(dst, temp_block, 0, 0);
}
void
src_row, src_stride,
temp_block, width * 4 * sizeof(float),
true);
- util_format_read_4ub(PIPE_FORMAT_R32G32B32A32_FLOAT,
+ util_format_r32g32b32a32_float_unpack_rgba_8unorm(
dst_row, dst_stride,
- temp_block, width * 4 * sizeof(float),
- 0, 0, width, height);
+ (const uint8_t *)temp_block, width * 4 * sizeof(float),
+ width, height);
free((void *) temp_block);
}
src_row, src_stride,
temp_block, width * 4 * sizeof(float),
false);
- util_format_read_4ub(PIPE_FORMAT_R32G32B32A32_FLOAT,
+ util_format_r32g32b32a32_float_unpack_rgba_8unorm(
dst_row, dst_stride,
- temp_block, width * 4 * sizeof(float),
- 0, 0, width, height);
+ (const uint8_t *)temp_block, width * 4 * sizeof(float),
+ width, height);
free((void *) temp_block);
}