1
0
Fork 0
forked from suyu/suyu

Merge pull request #3686 from lioncash/table

texture_cache/format_lookup_table: Fix incorrect green, blue, and alpha indices
This commit is contained in:
bunnei 2020-04-19 15:33:33 -04:00 committed by GitHub
commit 2ea7a70da0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -196,9 +196,9 @@ std::size_t FormatLookupTable::CalculateIndex(TextureFormat format, bool is_srgb
ComponentType alpha_component) noexcept { ComponentType alpha_component) noexcept {
const auto format_index = static_cast<std::size_t>(format); const auto format_index = static_cast<std::size_t>(format);
const auto red_index = static_cast<std::size_t>(red_component); const auto red_index = static_cast<std::size_t>(red_component);
const auto green_index = static_cast<std::size_t>(red_component); const auto green_index = static_cast<std::size_t>(green_component);
const auto blue_index = static_cast<std::size_t>(red_component); const auto blue_index = static_cast<std::size_t>(blue_component);
const auto alpha_index = static_cast<std::size_t>(red_component); const auto alpha_index = static_cast<std::size_t>(alpha_component);
const std::size_t srgb_index = is_srgb ? 1 : 0; const std::size_t srgb_index = is_srgb ? 1 : 0;
return format_index * PerFormat + return format_index * PerFormat +