renderer_vulkan: Rework format handling

* This is a pretty large commit that aims to solve some issues with the current format system
* The instance now builds at application initialization an array of format traits for each pixel format
  that includes information such as blit/attachment/storage support and fallback formats
* The runtime doesn't ask the instance for formats but receives these traits and can dedice on its own what to build
  For now we do the same as before, we require both blit and attachment support

* Morton swizzling also sees many bug fixes. The previous code was very hacky and didn't work for partial
  texture updates. It was also inconsistent, as it would take a tiled_buffer and write to the middle of linear
* Now the functions have been greatly simplified and adjusted to work better with std::span. This fixes out of bounds
  errors and texture glitches (like the display in Mario Kart 7)
This commit is contained in:
GPUCode
2022-10-01 18:16:57 +03:00
parent eeccdc02fc
commit 891b4bff18
23 changed files with 532 additions and 281 deletions

View File

@ -80,4 +80,12 @@ void ConvertBGRToRGBA(std::span<const std::byte> source, std::span<std::byte> de
*/
void ConvertABGRToRGBA(std::span<const std::byte> source, std::span<std::byte> dest);
void ConvertD32S8ToD24S8(std::span<const std::byte> source, std::span<std::byte> dest);
void ConvertRGBA4ToRGBA8(std::span<const std::byte> source, std::span<std::byte> dest);
void ConvertRGBA8ToRGBA4(std::span<const std::byte> source, std::span<std::byte> dest);
void InterleaveD24S8(std::span<const std::byte> source, std::span<std::byte> dest);
} // namespace Pica::Texture