mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
ir: Perform degamma in shader when sampler sets force_degamma (#3420)
* ir: Perform degamma in shader when sampler sets force_degamma * specialization: Add srgb if image is sampled Might fix cases where sampler force_degamma is used with srgb image
This commit is contained in:
@@ -312,6 +312,11 @@ constexpr NumberClass GetNumberClass(const NumberFormat nfmt) {
|
||||
}
|
||||
}
|
||||
|
||||
constexpr bool IsRgb(CompSwizzle swizzle) {
|
||||
return swizzle == CompSwizzle::Red || swizzle == CompSwizzle::Green ||
|
||||
swizzle == CompSwizzle::Blue;
|
||||
}
|
||||
|
||||
constexpr bool IsInteger(const NumberFormat nfmt) {
|
||||
return nfmt == NumberFormat::Sint || nfmt == NumberFormat::Uint;
|
||||
}
|
||||
@@ -320,6 +325,10 @@ constexpr bool IsBlockCoded(DataFormat format) {
|
||||
return format >= DataFormat::FormatBc1 && format <= DataFormat::FormatBc7;
|
||||
}
|
||||
|
||||
constexpr bool IsFmask(DataFormat format) {
|
||||
return format >= DataFormat::FormatFmask8_1 && format <= DataFormat::FormatFmask64_8;
|
||||
}
|
||||
|
||||
std::string_view NameOf(DataFormat fmt);
|
||||
std::string_view NameOf(NumberFormat fmt);
|
||||
|
||||
|
||||
@@ -293,11 +293,6 @@ struct Image {
|
||||
return (((banks - 1) << 4) & base_address) >> 4;
|
||||
}
|
||||
|
||||
bool IsFmask() const noexcept {
|
||||
return GetDataFmt() >= DataFormat::FormatFmask8_1 &&
|
||||
GetDataFmt() <= DataFormat::FormatFmask64_8;
|
||||
}
|
||||
|
||||
ImageType GetBaseType() const noexcept {
|
||||
const auto base_type = GetType();
|
||||
if (base_type == ImageType::Color1DArray) {
|
||||
|
||||
Reference in New Issue
Block a user