[dxso] Emit spirv OpCross if we can.

This commit is contained in:
Georg Lehmann 2022-03-16 14:34:19 +01:00 committed by Joshie
parent 630fee59fc
commit f1efc9dc9f
1 changed files with 5 additions and 1 deletions

View File

@ -1523,12 +1523,16 @@ namespace dxvk {
DxsoRegisterValue DxsoCompiler::emitCross(
DxsoRegisterValue a,
DxsoRegisterValue b) {
uint32_t typeId = getVectorTypeId(a.type);
if (m_moduleInfo.options.d3d9FloatEmulation != D3D9FloatEmulation::Strict)
return {a.type, m_module.opCross(typeId, a.id, b.id)};
const std::array<uint32_t, 4> shiftIndices = { 1, 2, 0, 1 };
DxsoRegisterValue result;
result.type = { DxsoScalarType::Float32, 3 };
uint32_t typeId = getVectorTypeId(result.type);
std::array<DxsoRegisterValue, 2> products;
for (uint32_t i = 0; i < 2; i++) {