diff --git a/src/SharpEmu.ShaderCompiler.Vulkan/Gen5SpirvTranslator.Alu.cs b/src/SharpEmu.ShaderCompiler.Vulkan/Gen5SpirvTranslator.Alu.cs index 6c692696..82ec4cd3 100644 --- a/src/SharpEmu.ShaderCompiler.Vulkan/Gen5SpirvTranslator.Alu.cs +++ b/src/SharpEmu.ShaderCompiler.Vulkan/Gen5SpirvTranslator.Alu.cs @@ -903,6 +903,22 @@ public static partial class Gen5SpirvTranslator width); break; } + case "VBfeI32": + { + // Same extract as VBfeU32 but sign-extended from the top bit + // of the extracted field, so the result type must be signed + // and bitcast back for storage. + var width = BitwiseAnd(GetRawSource(instruction, 2), UInt(31)); + result = Bitcast( + _uintType, + _module.AddInstruction( + SpirvOp.BitFieldSExtract, + _intType, + Bitcast(_intType, GetRawSource(instruction, 0)), + BitwiseAnd(GetRawSource(instruction, 1), UInt(31)), + width)); + break; + } case "VBfiB32": { var mask = GetRawSource(instruction, 0); diff --git a/src/SharpEmu.ShaderCompiler/Gen5ShaderTranslator.cs b/src/SharpEmu.ShaderCompiler/Gen5ShaderTranslator.cs index f81a0dbe..4e1478a4 100644 --- a/src/SharpEmu.ShaderCompiler/Gen5ShaderTranslator.cs +++ b/src/SharpEmu.ShaderCompiler/Gen5ShaderTranslator.cs @@ -1157,6 +1157,7 @@ public static class Gen5ShaderTranslator 0x15D => "VSadU32", 0x15E => "VCvtPkU8F32", 0x148 => "VBfeU32", + 0x149 => "VBfeI32", 0x169 => "VMulLoU32", 0x16A => "VMulHiU32", 0x16B => "VMulLoI32", @@ -1170,6 +1171,7 @@ public static class Gen5ShaderTranslator 0x366 => "VMbcntHiU32B32", 0x368 => "VCvtPknormI16F32", 0x369 => "VCvtPknormU16F32", + 0x36A => "VCvtPkU16U32", 0x373 => "VMadU32U16", 0x346 => "VLshlAddU32", 0x347 => "VAddLshlU32",