1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 01:24:11 +01:00

[dxbc] Fix EvalSnapped offset interpretation

This commit is contained in:
Philip Rebohle 2024-10-27 12:52:15 +01:00
parent 640758afcf
commit 4709d429ed
2 changed files with 15 additions and 3 deletions

View File

@ -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,

View File

@ -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, {