util: Move fetch_rgba to a separate function table.

Only llvmpipe and translate_generic use it, and only in fallbacks, so if
you're not building that then let's not bloat our binaries with it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6305>
This commit is contained in:
Eric Anholt
2020-08-13 09:37:32 -07:00
committed by Marge Bot
parent 9cc84369b7
commit 5b8d67cb64
7 changed files with 61 additions and 34 deletions
+8 -4
View File
@@ -204,8 +204,8 @@ static boolean
test_format_fetch_rgba(const struct util_format_description *format_desc,
const struct util_format_test_case *test)
{
const struct util_format_unpack_description *unpack =
util_format_unpack_description(format_desc->format);
util_format_fetch_rgba_func_ptr fetch_rgba =
util_format_fetch_rgba_func(format_desc->format);
float unpacked[UTIL_FORMAT_MAX_UNPACKED_HEIGHT][UTIL_FORMAT_MAX_UNPACKED_WIDTH][4] = { { { 0 } } };
unsigned i, j, k;
boolean success;
@@ -213,7 +213,7 @@ test_format_fetch_rgba(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) {
unpack->fetch_rgba(unpacked[i][j], test->packed, j, i);
fetch_rgba(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;
@@ -818,7 +818,11 @@ test_all(void)
success = FALSE; \
} \
TEST_ONE_UNPACK_FUNC(fetch_rgba);
if (util_format_fetch_rgba_func(format)) {
if (!test_one_func(format_desc, test_format_fetch_rgba, "fetch_rgba"))
success = FALSE;
}
TEST_ONE_PACK_FUNC(pack_rgba_float);
TEST_ONE_UNPACK_FUNC(unpack_rgba);
TEST_ONE_PACK_FUNC(pack_rgba_8unorm);