Add OpConstantSampler

This commit is contained in:
ReinUsesLisp 2018-08-28 04:41:42 -03:00
parent 014c6ab586
commit 42c456f24f
5 changed files with 28 additions and 9 deletions

View file

@ -30,4 +30,15 @@ Ref Module::ConstantComposite(Ref result_type, const std::vector<Ref>& constitue
return AddDeclaration(op);
}
Ref Module::ConstantSampler(Ref result_type, spv::SamplerAddressingMode addressing_mode,
bool normalized, spv::SamplerFilterMode filter_mode) {
AddCapability(spv::Capability::LiteralSampler);
AddCapability(spv::Capability::Kernel);
Op* op{new Op(spv::Op::OpConstantSampler, bound, result_type)};
AddEnum(op, addressing_mode);
op->Add(normalized ? 1 : 0);
AddEnum(op, filter_mode);
return AddDeclaration(op);
}
} // namespace Sirit