shader_recompiler: Implement LowerInt16ToInt32

AMD drivers 22.3.2 and later expose a bug in yuzu, where the application
would submit 16-bit integer instructions to GPUs that don't support
16-bit integers, namely GCN 4 devices.

Replace any 16-bit instructions with 32-bit ones so newer AMD drivers
will work with VK_KHR_workgroup_memory_explicit_layout.
This commit is contained in:
lat9nq
2022-05-19 15:50:48 -04:00
parent b57df1dcb9
commit 74e7f07bef
6 changed files with 79 additions and 0 deletions

View File

@@ -209,6 +209,9 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo
if (!host_info.support_int64) {
Optimization::LowerInt64ToInt32(program);
}
if (!host_info.support_int16) {
Optimization::LowerInt16ToInt32(program);
}
Optimization::SsaRewritePass(program);
Optimization::ConstantPropagationPass(program);