Floors/Frcs/Truncs

This commit is contained in:
Dr. Chat 2016-02-21 18:15:11 -06:00
parent 0680e451bc
commit 5c2b5123ac
1 changed files with 18 additions and 0 deletions

View File

@ -906,6 +906,18 @@ void SpirvShaderTranslator::ProcessScalarAluInstruction(
{sources[0]});
} break;
case AluScalarOpcode::kFloors: {
dest = CreateGlslStd450InstructionCall(
spv::Decoration::DecorationInvariant, float_type_, GLSLstd450::kFloor,
{sources[0]});
} break;
case AluScalarOpcode::kFrcs: {
dest = CreateGlslStd450InstructionCall(
spv::Decoration::DecorationInvariant, float_type_, GLSLstd450::kFract,
{sources[0]});
} break;
case AluScalarOpcode::kKillsEq: {
auto continue_block = &b.makeNewBlock();
auto kill_block = &b.makeNewBlock();
@ -1213,6 +1225,12 @@ void SpirvShaderTranslator::ProcessScalarAluInstruction(
dest = b.createBinOp(spv::Op::OpFSub, float_type_, sources[0], ps_);
} break;
case AluScalarOpcode::kTruncs: {
dest = CreateGlslStd450InstructionCall(
spv::Decoration::DecorationInvariant, float_type_, GLSLstd450::kTrunc,
{sources[0]});
} break;
default:
break;
}