Commit d3808b1b authored by Jose Fonseca's avatar Jose Fonseca
Browse files

util: Add dedicated depth-stencil packing/unpacking functions.

Depth-stencil manually written given that each one is very close to
be a special case.

u_format_zs.c's still untested.
parent efae8f33
......@@ -133,8 +133,8 @@ print_unpacked_8unorm(const struct util_format_description *format_desc,
static boolean
test_format_fetch_float(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
test_format_fetch_rgba_float(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
{
float unpacked[UTIL_FORMAT_MAX_UNPACKED_HEIGHT][UTIL_FORMAT_MAX_UNPACKED_WIDTH][4] = { { { 0 } } };
unsigned i, j, k;
......@@ -143,7 +143,7 @@ test_format_fetch_float(const struct util_format_description *format_desc,
success = TRUE;
for (i = 0; i < format_desc->block.height; ++i) {
for (j = 0; j < format_desc->block.width; ++j) {
format_desc->fetch_float(unpacked[i][j], test->packed, j, i);
format_desc->fetch_rgba_float(unpacked[i][j], test->packed, j, i);
for (k = 0; k < 4; ++k) {
if (!compare_float(test->unpacked[i][j][k], unpacked[i][j][k])) {
success = FALSE;
......@@ -162,14 +162,14 @@ test_format_fetch_float(const struct util_format_description *format_desc,
static boolean
test_format_unpack_float(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
test_format_unpack_rgba_float(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
{
float unpacked[UTIL_FORMAT_MAX_UNPACKED_HEIGHT][UTIL_FORMAT_MAX_UNPACKED_WIDTH][4] = { { { 0 } } };
unsigned i, j, k;
boolean success;
format_desc->unpack_float(&unpacked[0][0][0], sizeof unpacked[0],
format_desc->unpack_rgba_float(&unpacked[0][0][0], sizeof unpacked[0],
test->packed, 0,
format_desc->block.width, format_desc->block.height);
......@@ -195,8 +195,8 @@ test_format_unpack_float(const struct util_format_description *format_desc,
static boolean
test_format_pack_float(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
test_format_pack_rgba_float(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
{
float unpacked[UTIL_FORMAT_MAX_UNPACKED_HEIGHT][UTIL_FORMAT_MAX_UNPACKED_WIDTH][4];
uint8_t packed[UTIL_FORMAT_MAX_PACKED_BYTES];
......@@ -221,7 +221,7 @@ test_format_pack_float(const struct util_format_description *format_desc,
}
}
format_desc->pack_float(packed, 0,
format_desc->pack_rgba_float(packed, 0,
&unpacked[0][0][0], sizeof unpacked[0],
format_desc->block.width, format_desc->block.height);
......@@ -264,15 +264,15 @@ convert_float_to_8unorm(uint8_t *dst, const double *src)
static boolean
test_format_unpack_8unorm(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
test_format_unpack_rgba_8unorm(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
{
uint8_t unpacked[UTIL_FORMAT_MAX_UNPACKED_HEIGHT][UTIL_FORMAT_MAX_UNPACKED_WIDTH][4] = { { { 0 } } };
uint8_t expected[UTIL_FORMAT_MAX_UNPACKED_HEIGHT][UTIL_FORMAT_MAX_UNPACKED_WIDTH][4] = { { { 0 } } };
unsigned i, j, k;
boolean success;
format_desc->unpack_8unorm(&unpacked[0][0][0], sizeof unpacked[0],
format_desc->unpack_rgba_8unorm(&unpacked[0][0][0], sizeof unpacked[0],
test->packed, 0,
format_desc->block.width, format_desc->block.height);
......@@ -299,8 +299,8 @@ test_format_unpack_8unorm(const struct util_format_description *format_desc,
static boolean
test_format_pack_8unorm(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
test_format_pack_rgba_8unorm(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
{
uint8_t unpacked[UTIL_FORMAT_MAX_UNPACKED_HEIGHT][UTIL_FORMAT_MAX_UNPACKED_WIDTH][4];
uint8_t packed[UTIL_FORMAT_MAX_PACKED_BYTES];
......@@ -325,7 +325,7 @@ test_format_pack_8unorm(const struct util_format_description *format_desc,
memset(packed, 0, sizeof packed);
format_desc->pack_8unorm(packed, 0,
format_desc->pack_rgba_8unorm(packed, 0,
&unpacked[0][0][0], sizeof unpacked[0],
format_desc->block.width, format_desc->block.height);
......@@ -389,19 +389,19 @@ test_all(void)
{
bool success = TRUE;
if (!test_one(&test_format_fetch_float, "fetch_float"))
if (!test_one(&test_format_fetch_rgba_float, "fetch_rgba_float"))
success = FALSE;
if (!test_one(&test_format_pack_float, "pack_float"))
if (!test_one(&test_format_pack_rgba_float, "pack_rgba_float"))
success = FALSE;
if (!test_one(&test_format_unpack_float, "unpack_float"))
if (!test_one(&test_format_unpack_rgba_float, "unpack_rgba_float"))
success = FALSE;
if (!test_one(&test_format_pack_8unorm, "pack_8unorm"))
if (!test_one(&test_format_pack_rgba_8unorm, "pack_rgba_8unorm"))
success = FALSE;
if (!test_one(&test_format_unpack_8unorm, "unpack_8unorm"))
if (!test_one(&test_format_unpack_rgba_8unorm, "unpack_rgba_8unorm"))
success = FALSE;
return success;
......
......@@ -112,6 +112,7 @@ C_SOURCES = \
util/u_format_table.c \
util/u_format_tests.c \
util/u_format_yuv.c \
util/u_format_zs.c \
util/u_gen_mipmap.c \
util/u_half.c \
util/u_handle_table.c \
......
......@@ -161,6 +161,7 @@ source = [
'util/u_format_table.c',
'util/u_format_tests.c',
'util/u_format_yuv.c',
'util/u_format_zs.c',
'util/u_gen_mipmap.c',
'util/u_half.c',
'util/u_handle_table.c',
......
......@@ -307,7 +307,7 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
}
else {
/*
* Fallback to calling util_format_description::fetch_float for each
* Fallback to calling util_format_description::fetch_rgba_float for each
* pixel.
*
* This is definitely not the most efficient way of fetching pixels, as
......@@ -324,10 +324,10 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
assert(type.floating);
util_snprintf(name, sizeof name, "util_format_%s_fetch_float", format_desc->short_name);
util_snprintf(name, sizeof name, "util_format_%s_fetch_rgba_float", format_desc->short_name);
/*
* Declare and bind format_desc->fetch_float().
* Declare and bind format_desc->fetch_rgba_float().
*/
function = LLVMGetNamedFunction(module, name);
......@@ -348,7 +348,7 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
assert(LLVMIsDeclaration(function));
LLVMAddGlobalMapping(lp_build_engine, function, format_desc->fetch_float);
LLVMAddGlobalMapping(lp_build_engine, function, format_desc->fetch_rgba_float);
}
for (chan = 0; chan < 4; ++chan) {
......@@ -361,7 +361,7 @@ lp_build_fetch_rgba_soa(LLVMBuilderRef builder,
"");
/*
* Invoke format_desc->fetch_float() for each pixel and insert the result
* Invoke format_desc->fetch_rgba_float() for each pixel and insert the result
* in the SoA vectors.
*/
......
......@@ -56,7 +56,7 @@ util_format_read_4f(enum pipe_format format,
src_row = (const uint8_t *)src + y*src_stride + x*(format_desc->block.bits/8);
dst_row = dst;
format_desc->unpack_float(dst_row, dst_stride, src_row, src_stride, w, h);
format_desc->unpack_rgba_float(dst_row, dst_stride, src_row, src_stride, w, h);
}
......@@ -78,7 +78,7 @@ util_format_write_4f(enum pipe_format format,
dst_row = (uint8_t *)dst + y*dst_stride + x*(format_desc->block.bits/8);
src_row = src;
format_desc->pack_float(dst_row, dst_stride, src_row, src_stride, w, h);
format_desc->pack_rgba_float(dst_row, dst_stride, src_row, src_stride, w, h);
}
......@@ -97,7 +97,7 @@ util_format_read_4ub(enum pipe_format format, uint8_t *dst, unsigned dst_stride,
src_row = (const uint8_t *)src + y*src_stride + x*(format_desc->block.bits/8);
dst_row = dst;
format_desc->unpack_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
format_desc->unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
}
......@@ -116,7 +116,7 @@ util_format_write_4ub(enum pipe_format format, const uint8_t *src, unsigned src_
dst_row = (uint8_t *)dst + y*dst_stride + x*(format_desc->block.bits/8);
src_row = src;
format_desc->pack_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
format_desc->pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, w, h);
}
......@@ -242,8 +242,8 @@ util_format_translate(enum pipe_format dst_format,
return;
while (height >= y_step) {
src_format_desc->unpack_8unorm(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
dst_format_desc->pack_8unorm(dst_row, dst_stride, tmp_row, tmp_stride, width, y_step);
src_format_desc->unpack_rgba_8unorm(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
dst_format_desc->pack_rgba_8unorm(dst_row, dst_stride, tmp_row, tmp_stride, width, y_step);
dst_row += dst_step;
src_row += src_step;
......@@ -251,8 +251,8 @@ util_format_translate(enum pipe_format dst_format,
}
if (height) {
src_format_desc->unpack_8unorm(tmp_row, tmp_stride, src_row, src_stride, width, height);
dst_format_desc->pack_8unorm(dst_row, dst_stride, tmp_row, tmp_stride, width, height);
src_format_desc->unpack_rgba_8unorm(tmp_row, tmp_stride, src_row, src_stride, width, height);
dst_format_desc->pack_rgba_8unorm(dst_row, dst_stride, tmp_row, tmp_stride, width, height);
}
FREE(tmp_row);
......@@ -267,8 +267,8 @@ util_format_translate(enum pipe_format dst_format,
return;
while (height >= y_step) {
src_format_desc->unpack_float(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
dst_format_desc->pack_float(dst_row, dst_stride, tmp_row, tmp_stride, width, y_step);
src_format_desc->unpack_rgba_float(tmp_row, tmp_stride, src_row, src_stride, width, y_step);
dst_format_desc->pack_rgba_float(dst_row, dst_stride, tmp_row, tmp_stride, width, y_step);
dst_row += dst_step;
src_row += src_step;
......@@ -276,8 +276,8 @@ util_format_translate(enum pipe_format dst_format,
}
if (height) {
src_format_desc->unpack_float(tmp_row, tmp_stride, src_row, src_stride, width, height);
dst_format_desc->pack_float(dst_row, dst_stride, tmp_row, tmp_stride, width, height);
src_format_desc->unpack_rgba_float(tmp_row, tmp_stride, src_row, src_stride, width, height);
dst_format_desc->pack_rgba_float(dst_row, dst_stride, tmp_row, tmp_stride, width, height);
}
FREE(tmp_row);
......
......@@ -192,43 +192,114 @@ struct util_format_description
/**
* Unpack pixel blocks to R8G8B8A8_UNORM.
*
* Only defined for non-depth-stencil formats.
*/
void
(*unpack_8unorm)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
(*unpack_rgba_8unorm)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixel blocks from R8G8B8A8_UNORM.
*
* Only defined for non-depth-stencil formats.
*/
void
(*pack_8unorm)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
(*pack_rgba_8unorm)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Unpack pixel blocks to R32G32B32A32_FLOAT.
*
* Only defined for non-depth-stencil formats.
*/
void
(*unpack_float)(float *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
(*unpack_rgba_float)(float *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixel blocks from R32G32B32A32_FLOAT.
*
* Only defined for non-depth-stencil formats.
*/
void
(*pack_float)(uint8_t *dst, unsigned dst_stride,
const float *src, unsigned src_stride,
unsigned width, unsigned height);
(*pack_rgba_float)(uint8_t *dst, unsigned dst_stride,
const float *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Fetch a single pixel (i, j) from a block.
*
* Only defined for non-depth-stencil formats.
*/
void
(*fetch_rgba_float)(float *dst,
const uint8_t *src,
unsigned i, unsigned j);
/**
* Unpack pixels to Z32_UNORM.
*
* Only defined for depth formats.
*/
void
(*unpack_z_32unorm)(uint32_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixels from Z32_FLOAT.
*
* Only defined for depth formats.
*/
void
(*pack_z_32unorm)(uint8_t *dst, unsigned dst_stride,
const uint32_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Unpack pixels to Z32_FLOAT.
*
* Only defined for depth formats.
*/
void
(*unpack_z_float)(float *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixels from Z32_FLOAT.
*
* Only defined for depth formats.
*/
void
(*pack_z_float)(uint8_t *dst, unsigned dst_stride,
const float *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Unpack pixels to S8_USCALED.
*
* Only defined for stencil formats.
*/
void
(*unpack_s_32unorm)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
/**
* Pack pixels from S8_USCALED.
*
* Only defined for stencil formats.
*/
void
(*fetch_float)(float *dst,
const uint8_t *src,
unsigned i, unsigned j);
(*pack_s_8uscaled)(uint8_t *dst, unsigned dst_stride,
const uint8_t *src, unsigned src_stride,
unsigned width, unsigned height);
};
......
......@@ -31,7 +31,7 @@
void
util_format_r9g9b9e5_float_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -39,7 +39,7 @@ util_format_r9g9b9e5_float_unpack_float(float *dst_row, unsigned dst_stride,
}
void
util_format_r9g9b9e5_float_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -47,7 +47,7 @@ util_format_r9g9b9e5_float_pack_float(uint8_t *dst_row, unsigned dst_stride,
}
void
util_format_r9g9b9e5_float_fetch_float(float *dst, const uint8_t *src,
util_format_r9g9b9e5_float_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j)
{
......@@ -55,7 +55,7 @@ util_format_r9g9b9e5_float_fetch_float(float *dst, const uint8_t *src,
void
util_format_r9g9b9e5_float_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -64,7 +64,7 @@ util_format_r9g9b9e5_float_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r9g9b9e5_float_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -73,7 +73,7 @@ util_format_r9g9b9e5_float_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r1_unorm_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r1_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -82,7 +82,7 @@ util_format_r1_unorm_unpack_float(float *dst_row, unsigned dst_stride,
void
util_format_r1_unorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -91,7 +91,7 @@ util_format_r1_unorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r1_unorm_fetch_float(float *dst, const uint8_t *src,
util_format_r1_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j)
{
......@@ -99,7 +99,7 @@ util_format_r1_unorm_fetch_float(float *dst, const uint8_t *src,
void
util_format_r1_unorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -108,7 +108,7 @@ util_format_r1_unorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r1_unorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -123,7 +123,7 @@ util_format_r1_unorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -156,7 +156,7 @@ util_format_r8g8bx_snorm_unpack_float(float *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -188,7 +188,7 @@ util_format_r8g8bx_snorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -217,7 +217,7 @@ util_format_r8g8bx_snorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height)
{
......@@ -247,7 +247,7 @@ util_format_r8g8bx_snorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
void
util_format_r8g8bx_snorm_fetch_float(float *dst, const uint8_t *src,
util_format_r8g8bx_snorm_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j)
{
uint16_t value = *(const uint16_t *)src;
......
......@@ -34,74 +34,74 @@
void
util_format_r9g9b9e5_float_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r9g9b9e5_float_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r9g9b9e5_float_fetch_float(float *dst, const uint8_t *src,
util_format_r9g9b9e5_float_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j);
void
util_format_r9g9b9e5_float_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r9g9b9e5_float_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r9g9b9e5_float_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r1_unorm_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r1_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r1_unorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r1_unorm_fetch_float(float *dst, const uint8_t *src,
util_format_r1_unorm_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j);
void
util_format_r1_unorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r1_unorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r1_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r8g8bx_snorm_unpack_float(float *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r8g8bx_snorm_pack_float(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride,
const float *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r8g8bx_snorm_fetch_float(float *dst, const uint8_t *src,
util_format_r8g8bx_snorm_fetch_rgba_float(float *dst, const uint8_t *src,
unsigned i, unsigned j);
void
util_format_r8g8bx_snorm_unpack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
void
util_format_r8g8bx_snorm_pack_8unorm(uint8_t *dst_row, unsigned dst_stride,
util_format_r8g8bx_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride,
const uint8_t *src_row, unsigned src_stride,
unsigned width, unsigned height);
......
......@@ -46,12 +46,21 @@ from u_format_parse import *