mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
rsx: Verify that channel remap is initialized before applying swizzles
This commit is contained in:
parent
e9a45a6d06
commit
e9bc99253d
1 changed files with 3 additions and 1 deletions
|
@ -8,13 +8,15 @@ namespace rsx
|
||||||
{
|
{
|
||||||
struct texture_channel_remap_t
|
struct texture_channel_remap_t
|
||||||
{
|
{
|
||||||
u32 encoded;
|
u32 encoded = 0xDEAD;
|
||||||
std::array<u8, 4> control_map;
|
std::array<u8, 4> control_map;
|
||||||
std::array<u8, 4> channel_map;
|
std::array<u8, 4> channel_map;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::array<T, 4> remap(const std::array<T, 4>& components, T select_zero, T select_one) const
|
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{};
|
std::array<T, 4> remapped{};
|
||||||
for (u8 channel = 0; channel < 4; ++channel)
|
for (u8 channel = 0; channel < 4; ++channel)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue