mesa: Remove a ton of format code from _mesa_format_and_type_matches().

This function was difficult to implement for new formats due to the
combination of endianness and swapbytes support.  Since it's mostly
used for fast paths, bugs in it were often missed during testing.

Just reimplement it on top of the recent
_mesa_format_from_format_and_type() which can give us a canonical
MESA_FORMAT for a format and type enum (while respecting endianness).

Fixes:
- R4G4B4A4_UNORM, B4G4R4_UINT, R4G4B4A4_UINT incorrectly matched with
  swapBytes (you can't just reverse the channels if the channels
  aren't bytes)
- A4R4G4B4_UNORM and A4R4G4B4_UINT missing BGRA/4444_REV matches
- failing to RGB/BGR unorm8 array formats on BE
- 2101010 formats incorrectly matching with swapBytes set.
- UINT/SINT byte formats failed to match with swapBytes set.
- YCBCR (packed afaik) was looking at endianness when it shouldn't.

XXX: Note that previously MESA_FORMAT_I_* would match GL_RED/type,
while now it doesn't (since RED/type goes through the array format
path and turns into MESA_FORMAT_R*).

This deletes the part of tests/mesa_formats.cpp that called
_mesa_format_matches_format_and_type() to make sure it didn't
assertion fail, as it now would assertion fail due to the fact that we
were passing an invalid format (GL_RG) for most types.
17 jobs for !1720 with format-and-type in 13 minutes and 37 seconds (queued for 1 second)
detached
Status Job ID Name Coverage
  Containers Build
passed #519485
debian

00:00:23

 
  Build+Test
passed #519494
meson-arm64

00:03:30

passed #519493
meson-armhf

00:03:13

passed #519487
meson-clang

00:07:37

passed #519491
meson-clover

00:08:10

passed #519495
meson-i386

00:03:01

passed #519490
meson-main

00:09:30

passed #519486
meson-swr-glvnd

00:05:36

passed #519492
meson-vulkan

00:02:53

passed #519497
scons-llvm

00:05:10

passed #519496
scons-nollvm

00:04:44

passed #519488
scons-swr

00:06:59

passed #519489
scons-win64

00:06:30

 
  Test
passed #519498
test-llvmpipe-gles2 1/4

00:03:09

passed #519499
test-llvmpipe-gles2 2/4

00:03:41

passed #519500
test-llvmpipe-gles2 3/4

00:03:08

passed #519501
test-llvmpipe-gles2 4/4

00:03:17