Commit 856ebf87 by Chris Forbes

Add support for OpVectorTimesScalar

This gets us the final few cases in the glsl multiplies group. Test: dEQP-VK.glsl.operator.binary_operator.mul.* Bug: b/126873455 Change-Id: Id9ec4ad1754a7e63c8d7e0aa0a0b0b156a03b024 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26651 Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent db17077a
......@@ -337,6 +337,7 @@ namespace sw
case spv::OpIsNan:
case spv::OpAny:
case spv::OpAll:
case spv::OpVectorTimesScalar:
// Instructions that yield an intermediate value
{
TypeID typeId = insn.word(1);
......@@ -1039,6 +1040,10 @@ namespace sw
EmitVectorShuffle(insn, routine);
break;
case spv::OpVectorTimesScalar:
EmitVectorTimesScalar(insn, routine);
break;
case spv::OpNot:
case spv::OpSNegate:
case spv::OpFNegate:
......@@ -1443,6 +1448,19 @@ namespace sw
}
}
void SpirvShader::EmitVectorTimesScalar(InsnIterator insn, SpirvRoutine *routine) const
{
auto &type = getType(insn.word(1));
auto &dst = routine->createIntermediate(insn.word(2), type.sizeInComponents);
auto srcLHS = GenericValue(this, routine, insn.word(3));
auto srcRHS = GenericValue(this, routine, insn.word(4));
for (auto i = 0u; i < type.sizeInComponents; i++)
{
dst.emplace(i, srcLHS[i] * srcRHS[0]);
}
}
void SpirvShader::EmitUnaryOp(InsnIterator insn, SpirvRoutine *routine) const
{
auto &type = getType(insn.word(1));
......
......@@ -444,6 +444,7 @@ namespace sw
void EmitCompositeInsert(InsnIterator insn, SpirvRoutine *routine) const;
void EmitCompositeExtract(InsnIterator insn, SpirvRoutine *routine) const;
void EmitVectorShuffle(InsnIterator insn, SpirvRoutine *routine) const;
void EmitVectorTimesScalar(InsnIterator insn, SpirvRoutine *routine) const;
void EmitUnaryOp(InsnIterator insn, SpirvRoutine *routine) const;
void EmitBinaryOp(InsnIterator insn, SpirvRoutine *routine) const;
void EmitDot(InsnIterator insn, SpirvRoutine *routine) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment