Fix amdgpu & other issues (#2000)

This commit is contained in:
liberodark 2025-01-02 14:39:39 +01:00 committed by GitHub
parent c25447097e
commit 596f4cdf0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 27 additions and 24 deletions

View file

@ -889,11 +889,11 @@ struct Liverpool {
return !info.linear_general;
}
[[nodiscard]] DataFormat DataFormat() const {
[[nodiscard]] DataFormat GetDataFmt() const {
return RemapDataFormat(info.format);
}
[[nodiscard]] NumberFormat NumFormat() const {
[[nodiscard]] NumberFormat GetNumberFmt() const {
// There is a small difference between T# and CB number types, account for it.
return RemapNumberFormat(info.number_type == NumberFormat::SnormNz
? NumberFormat::Srgb

View file

@ -79,21 +79,23 @@ inline NumberFormat RemapNumberFormat(const NumberFormat format) {
inline CompMapping RemapComponents(const DataFormat format, const CompMapping components) {
switch (format) {
case DataFormat::Format11_11_10:
return {
.r = components.b,
.g = components.g,
.b = components.r,
.a = components.a,
};
case DataFormat::Format11_11_10: {
CompMapping result;
result.r = components.b;
result.g = components.g;
result.b = components.r;
result.a = components.a;
return result;
}
case DataFormat::Format10_10_10_2:
case DataFormat::Format5_5_5_1:
return {
.r = components.a,
.g = components.b,
.b = components.g,
.a = components.r,
};
case DataFormat::Format5_5_5_1: {
CompMapping result;
result.r = components.a;
result.g = components.b;
result.b = components.g;
result.a = components.r;
return result;
}
default:
return components;
}