rsx: Verify that channel remap is initialized before applying swizzles

This commit is contained in:
kd-11 2024-10-03 14:06:26 +03:00 committed by kd-11
parent e9a45a6d06
commit e9bc99253d

View file

@ -8,13 +8,15 @@ namespace rsx
{
struct texture_channel_remap_t
{
u32 encoded;
u32 encoded = 0xDEAD;
std::array<u8, 4> control_map;
std::array<u8, 4> channel_map;
template <typename T>
std::array<T, 4> remap(const std::array<T, 4>& components, T select_zero, T select_one) const
{
ensure(encoded != 0xDEAD, "Channel remap was not initialized");
std::array<T, 4> remapped{};
for (u8 channel = 0; channel < 4; ++channel)
{