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:
TheTurtle
2025-08-19 03:41:41 +03:00
committed by GitHub
parent 2d53d1a1e2
commit 0b02364f97
12 changed files with 82 additions and 43 deletions

View File

@@ -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);

View File

@@ -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) {