Skip to content

Commit

Permalink
rsx: Verify that channel remap is initialized before applying swizzles
Browse files Browse the repository at this point in the history
  • Loading branch information
kd-11 committed Oct 3, 2024
1 parent e9a45a6 commit e9bc992
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rpcs3/Emu/RSX/color_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit e9bc992

Please sign in to comment.