nir_alu_type_get_base_type(tex->dest_type) == nir_type_float);
assert(tex->texture_index == tex->sampler_index);
- SpvId coord = 0, proj = 0, bias = 0, lod = 0, dref = 0, dx = 0, dy = 0;
+ SpvId coord = 0, proj = 0, bias = 0, lod = 0, dref = 0, dx = 0, dy = 0,
+ offset = 0;
unsigned coord_components = 0;
for (unsigned i = 0; i < tex->num_srcs; i++) {
switch (tex->src[i].src_type) {
assert(proj != 0);
break;
+ case nir_tex_src_offset:
+ offset = get_src_int(ctx, &tex->src[i].src);
+ break;
+
case nir_tex_src_bias:
assert(tex->op == nir_texop_txb);
bias = get_src_float(ctx, &tex->src[i].src);
actual_dest_type, load,
coord,
proj != 0,
- lod, bias, dref, dx, dy);
+ lod, bias, dref, dx, dy,
+ offset);
}
spirv_builder_emit_decoration(&ctx->builder, result,
SpvId bias,
SpvId dref,
SpvId dx,
- SpvId dy)
+ SpvId dy,
+ SpvId offset)
{
SpvId result = spirv_builder_new_id(b);
}
SpvImageOperandsMask operand_mask = SpvImageOperandsMaskNone;
- SpvId extra_operands[4];
+ SpvId extra_operands[5];
int num_extra_operands = 0;
if (bias) {
extra_operands[++num_extra_operands] = bias;
extra_operands[++num_extra_operands] = dy;
operand_mask |= SpvImageOperandsGradMask;
}
+ if (offset) {
+ extra_operands[++num_extra_operands] = offset;
+ operand_mask |= SpvImageOperandsOffsetMask;
+ }
/* finalize num_extra_operands / extra_operands */
if (num_extra_operands > 0) {