image: Remove assumed lod in image samples

This commits breaks the API. Depth image samples assumed a lod operand,
this made using Grad samples clumsy to use.
This commit is contained in:
ReinUsesLisp 2019-12-15 18:23:59 -03:00
parent 88d37bedf0
commit 9f4d057aa2
2 changed files with 14 additions and 21 deletions

View file

@ -31,13 +31,11 @@ static void AddImageOperands(Op* op, std::optional<spv::ImageOperandsMask> image
#define DEFINE_IMAGE_EXP_OP(opcode) \
Id Module::opcode(Id result_type, Id sampled_image, Id coordinate, \
spv::ImageOperandsMask image_operands, Id lod, \
const std::vector<Id>& operands) { \
spv::ImageOperandsMask image_operands, const std::vector<Id>& operands) { \
auto op{std::make_unique<Op>(spv::Op::opcode, bound++, result_type)}; \
op->Add(sampled_image); \
op->Add(coordinate); \
op->Add(static_cast<u32>(image_operands)); \
op->Add(lod); \
op->Add(operands); \
return AddCode(std::move(op)); \
}
@ -56,14 +54,12 @@ static void AddImageOperands(Op* op, std::optional<spv::ImageOperandsMask> image
#define DEFINE_IMAGE_EXTRA_EXP_OP(opcode) \
Id Module::opcode(Id result_type, Id sampled_image, Id coordinate, Id extra, \
spv::ImageOperandsMask image_operands, Id lod, \
const std::vector<Id>& operands) { \
spv::ImageOperandsMask image_operands, const std::vector<Id>& operands) { \
auto op{std::make_unique<Op>(spv::Op::opcode, bound++, result_type)}; \
op->Add(sampled_image); \
op->Add(coordinate); \
op->Add(extra); \
op->Add(static_cast<u32>(image_operands)); \
op->Add(lod); \
op->Add(operands); \
return AddCode(std::move(op)); \
}