mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 08:52:36 +00:00
amdgpu: Add a few more unsupported format remaps.
This commit is contained in:
parent
4702b53b92
commit
03e8e9986f
@ -61,10 +61,16 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline DataFormat RemapDataFormat(const DataFormat format) {
|
inline DataFormat RemapDataFormat(const DataFormat format) {
|
||||||
if (format == DataFormat::Format11_11_10) {
|
switch (format) {
|
||||||
|
case DataFormat::Format11_11_10:
|
||||||
return DataFormat::Format10_11_11;
|
return DataFormat::Format10_11_11;
|
||||||
|
case DataFormat::Format10_10_10_2:
|
||||||
|
return DataFormat::Format2_10_10_10;
|
||||||
|
case DataFormat::Format5_5_5_1:
|
||||||
|
return DataFormat::Format1_5_5_5;
|
||||||
|
default:
|
||||||
|
return format;
|
||||||
}
|
}
|
||||||
return format;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline NumberFormat RemapNumberFormat(const NumberFormat format) {
|
inline NumberFormat RemapNumberFormat(const NumberFormat format) {
|
||||||
@ -72,15 +78,25 @@ inline NumberFormat RemapNumberFormat(const NumberFormat format) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline CompMapping RemapComponents(const DataFormat format, const CompMapping components) {
|
inline CompMapping RemapComponents(const DataFormat format, const CompMapping components) {
|
||||||
if (format == DataFormat::Format11_11_10) {
|
switch (format) {
|
||||||
|
case DataFormat::Format11_11_10:
|
||||||
return {
|
return {
|
||||||
.r = components.b,
|
.r = components.b,
|
||||||
.g = components.g,
|
.g = components.g,
|
||||||
.b = components.r,
|
.b = components.r,
|
||||||
.a = components.a,
|
.a = components.a,
|
||||||
};
|
};
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return components;
|
||||||
}
|
}
|
||||||
return components;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Table 8.5 Buffer Resource Descriptor [Sea Islands Series Instruction Set Architecture]
|
// Table 8.5 Buffer Resource Descriptor [Sea Islands Series Instruction Set Architecture]
|
||||||
|
@ -568,10 +568,8 @@ std::span<const SurfaceFormatInfo> SurfaceFormats() {
|
|||||||
// 10_11_11
|
// 10_11_11
|
||||||
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format10_11_11, AmdGpu::NumberFormat::Float,
|
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format10_11_11, AmdGpu::NumberFormat::Float,
|
||||||
vk::Format::eB10G11R11UfloatPack32),
|
vk::Format::eB10G11R11UfloatPack32),
|
||||||
// 11_11_10
|
// 11_11_10 - Remapped to 10_11_11.
|
||||||
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format11_11_10, AmdGpu::NumberFormat::Float,
|
// 10_10_10_2 - Remapped to 2_10_10_10.
|
||||||
vk::Format::eB10G11R11UfloatPack32),
|
|
||||||
// 10_10_10_2
|
|
||||||
// 2_10_10_10
|
// 2_10_10_10
|
||||||
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format2_10_10_10, AmdGpu::NumberFormat::Unorm,
|
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format2_10_10_10, AmdGpu::NumberFormat::Unorm,
|
||||||
vk::Format::eA2B10G10R10UnormPack32),
|
vk::Format::eA2B10G10R10UnormPack32),
|
||||||
@ -644,7 +642,7 @@ std::span<const SurfaceFormatInfo> SurfaceFormats() {
|
|||||||
// 1_5_5_5
|
// 1_5_5_5
|
||||||
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format1_5_5_5, AmdGpu::NumberFormat::Unorm,
|
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format1_5_5_5, AmdGpu::NumberFormat::Unorm,
|
||||||
vk::Format::eR5G5B5A1UnormPack16),
|
vk::Format::eR5G5B5A1UnormPack16),
|
||||||
// 5_5_5_1
|
// 5_5_5_1 - Remapped to 1_5_5_5.
|
||||||
// 4_4_4_4
|
// 4_4_4_4
|
||||||
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format4_4_4_4, AmdGpu::NumberFormat::Unorm,
|
CreateSurfaceFormatInfo(AmdGpu::DataFormat::Format4_4_4_4, AmdGpu::NumberFormat::Unorm,
|
||||||
vk::Format::eR4G4B4A4UnormPack16),
|
vk::Format::eR4G4B4A4UnormPack16),
|
||||||
|
Loading…
Reference in New Issue
Block a user