rasterizer_cache: Separate texture swizzling to utils

This commit is contained in:
emufan4568
2022-09-07 15:32:02 +03:00
committed by GPUCode
parent 2833d94a3b
commit 1a48cf7e7d
7 changed files with 130 additions and 54 deletions

View File

@ -3,7 +3,7 @@
// Refer to the license.txt file included.
#pragma once
#include <span>
#include "common/common_types.h"
#include "common/vector_math.h"
#include "video_core/regs_texturing.h"
@ -55,4 +55,21 @@ Common::Vec4<u8> LookupTexture(const u8* source, unsigned int x, unsigned int y,
Common::Vec4<u8> LookupTexelInTile(const u8* source, unsigned int x, unsigned int y,
const TextureInfo& info, bool disable_alpha);
/**
* Converts pixel data encoded in BGR format to RGBA
*
* @param source Span to the source pixel data
* @param dest Span to the destination pixel data
*/
void ConvertBGRToRGBA(std::span<const std::byte> source, std::span<std::byte> dest);
/**
* Converts pixel data encoded in ABGR format to RGBA
*
* @param source Span to the source pixel data
* @param dest Span to the destination pixel data
*/
void ConvertABGRToRGBA(std::span<const std::byte> source, std::span<std::byte> dest);
} // namespace Pica::Texture