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

[dxbc] Implement DtoI, DtoU, ItoD and UtoD

This commit is contained in:
Philip Rebohle 2018-08-15 20:10:45 +02:00
parent 86fbba06be
commit e113392bb9
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -2633,8 +2633,38 @@ namespace dxvk {
DxbcRegisterValue result;
result.type.ctype = ins.dst[0].dataType;
result.type.ccount = val.type.ccount;
switch (ins.op) {
case DxbcOpcode::DtoF:
case DxbcOpcode::FtoD:
result.id = m_module.opFConvert(
getVectorTypeId(result.type), val.id);
break;
case DxbcOpcode::DtoI:
result.id = m_module.opConvertFtoS(
getVectorTypeId(result.type), val.id);
break;
case DxbcOpcode::DtoU:
result.id = m_module.opConvertFtoU(
getVectorTypeId(result.type), val.id);
break;
case DxbcOpcode::ItoD:
result.id = m_module.opConvertStoF(
getVectorTypeId(result.type), val.id);
break;
case DxbcOpcode::UtoD:
result.id = m_module.opConvertUtoF(
getVectorTypeId(result.type), val.id);
break;
default:
Logger::warn(str::format("DxbcCompiler: Unhandled instruction: ", ins.op));
return;
}
emitRegisterStore(ins.dst[0], result);
}