1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 10:54:16 +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,8 +3364,20 @@ namespace dxvk {
} break; } break;
case DxbcOpcode::EvalSnapped: { 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)); 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( result.id = m_module.opInterpolateAtOffset(
getVectorTypeId(result.type), getVectorTypeId(result.type),

View File

@ -1035,7 +1035,7 @@ namespace dxvk {
{ 3, DxbcInstClass::Interpolate, { { 3, DxbcInstClass::Interpolate, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 }, { DxbcOperandKind::DstReg, DxbcScalarType::Float32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float32 }, { DxbcOperandKind::SrcReg, DxbcScalarType::Float32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float32 }, { DxbcOperandKind::SrcReg, DxbcScalarType::Sint32 },
} }, } },
/* EvalSampleIndex */ /* EvalSampleIndex */
{ 3, DxbcInstClass::Interpolate, { { 3, DxbcInstClass::Interpolate, {