diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp index 47b3438bf..5694978ea 100644 --- a/src/dxbc/dxbc_compiler.cpp +++ b/src/dxbc/dxbc_compiler.cpp @@ -3364,9 +3364,21 @@ namespace dxvk { } break; case DxbcOpcode::EvalSnapped: { - const DxbcRegisterValue offset = emitRegisterLoad( + // The offset is encoded as a 4-bit fixed point value + DxbcRegisterValue offset = emitRegisterLoad( ins.src[1], DxbcRegMask(true, true, false, false)); - + offset.id = m_module.opBitFieldSExtract( + getVectorTypeId(offset.type), offset.id, + m_module.consti32(0), m_module.consti32(4)); + + offset.type.ctype = DxbcScalarType::Float32; + offset.id = m_module.opConvertStoF( + getVectorTypeId(offset.type), offset.id); + + offset.id = m_module.opFMul( + getVectorTypeId(offset.type), offset.id, + m_module.constvec2f32(1.0f / 16.0f, 1.0f / 16.0f)); + result.id = m_module.opInterpolateAtOffset( getVectorTypeId(result.type), m_vRegs.at(registerId).id, diff --git a/src/dxbc/dxbc_defs.cpp b/src/dxbc/dxbc_defs.cpp index d8763ea00..0d193ada9 100644 --- a/src/dxbc/dxbc_defs.cpp +++ b/src/dxbc/dxbc_defs.cpp @@ -1035,7 +1035,7 @@ namespace dxvk { { 3, DxbcInstClass::Interpolate, { { DxbcOperandKind::DstReg, DxbcScalarType::Float32 }, { DxbcOperandKind::SrcReg, DxbcScalarType::Float32 }, - { DxbcOperandKind::SrcReg, DxbcScalarType::Float32 }, + { DxbcOperandKind::SrcReg, DxbcScalarType::Sint32 }, } }, /* EvalSampleIndex */ { 3, DxbcInstClass::Interpolate, {