[SPIR-V] Cube: multiply the major axis by 2

This commit is contained in:
Triang3l 2020-11-01 15:56:51 +03:00
parent c173ecc4ef
commit fd4ba5622a
1 changed files with 8 additions and 0 deletions

View File

@ -711,6 +711,14 @@ spv::Id SpirvShaderTranslator::ProcessVectorAluOperation(
builder_->getBuildPoint()->addInstruction(std::move(phi_op));
}
assert_true(id_vector_temp_.size() == used_result_component_count);
if (used_result_components & 0b0100) {
// Multiply the major axis by 2.
spv::Id& ma2 = id_vector_temp_[xe::bit_count(used_result_components &
((1 << 2) - 1))];
ma2 = builder_->createBinOp(spv::OpFMul, type_float_,
builder_->makeFloatConstant(2.0f), ma2);
builder_->addDecoration(ma2, spv::DecorationNoContraction);
}
if (used_result_component_count == 1) {
// Only one component - not composite.
return id_vector_temp_[0];