Temporary workarounds for Amplitude 2016

This commit is contained in:
xezrunner 2024-08-20 22:55:15 +02:00
parent 42c4d8353a
commit ece821820d
2 changed files with 15 additions and 3 deletions

View File

@ -425,6 +425,14 @@ spv::ImageFormat GetFormat(const AmdGpu::Image& image) {
image.GetNumberFmt() == AmdGpu::NumberFormat::Unorm) {
return spv::ImageFormat::Rgba8;
}
if (image.GetDataFmt() == AmdGpu::DataFormat::Format8_8_8_8 &&
image.GetNumberFmt() == AmdGpu::NumberFormat::Srgb) {
// TEMP: for Amplitude 2016
// The game requests a Format8_8_8_8 SRGB image format.
// Interpreting it as R16Snorm makes the game draw with no major color deviations.
// What should the SRGB format be?
return spv::ImageFormat::R16Snorm;
}
if (image.GetDataFmt() == AmdGpu::DataFormat::Format8_8_8_8 &&
image.GetNumberFmt() == AmdGpu::NumberFormat::Uint) {
return spv::ImageFormat::Rgba8ui;

View File

@ -162,18 +162,22 @@ void Translator::S_BARRIER() {
ir.Barrier();
}
// TEMP: for Amplitude 2016
// These are "warp instructions" and are stubbed to work outside of compute shaders.
// The game makes use of them and works fine when the assertions are removed.
void Translator::V_READFIRSTLANE_B32(const GcnInst& inst) {
ASSERT(info.stage != Stage::Compute);
//ASSERT(info.stage != Stage::Compute);
SetDst(inst.dst[0], GetSrc(inst.src[0]));
}
void Translator::V_READLANE_B32(const GcnInst& inst) {
ASSERT(info.stage != Stage::Compute);
//ASSERT(info.stage != Stage::Compute);
SetDst(inst.dst[0], GetSrc(inst.src[0]));
}
void Translator::V_WRITELANE_B32(const GcnInst& inst) {
ASSERT(info.stage != Stage::Compute);
//ASSERT(info.stage != Stage::Compute);
SetDst(inst.dst[0], GetSrc(inst.src[0]));
}