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

[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

View File

@ -1523,12 +1523,16 @@ namespace dxvk {
DxsoRegisterValue DxsoCompiler::emitCross( DxsoRegisterValue DxsoCompiler::emitCross(
DxsoRegisterValue a, DxsoRegisterValue a,
DxsoRegisterValue b) { 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 }; const std::array<uint32_t, 4> shiftIndices = { 1, 2, 0, 1 };
DxsoRegisterValue result; DxsoRegisterValue result;
result.type = { DxsoScalarType::Float32, 3 }; result.type = { DxsoScalarType::Float32, 3 };
uint32_t typeId = getVectorTypeId(result.type);
std::array<DxsoRegisterValue, 2> products; std::array<DxsoRegisterValue, 2> products;
for (uint32_t i = 0; i < 2; i++) { for (uint32_t i = 0; i < 2; i++) {