cat6->pad5 = 0x2;
break;
case OPC_LDIB:
+ case OPC_RESINFO:
cat6->pad1 = 0x1;
cat6->pad3 = 0xc;
cat6->pad5 = 0x2;
case OPC_STIB:
case OPC_LDIB:
case OPC_LDC:
+ case OPC_RESINFO:
return emit_cat6_a6xx(instr, ptr, info);
default:
break;
.emit_intrinsic_atomic_ssbo = emit_intrinsic_atomic_ssbo,
.emit_intrinsic_store_image = emit_intrinsic_store_image,
.emit_intrinsic_atomic_image = emit_intrinsic_atomic_image,
+ .emit_intrinsic_image_size = emit_intrinsic_image_size_tex,
};
return atomic;
}
+static void
+emit_intrinsic_image_size(struct ir3_context *ctx, nir_intrinsic_instr *intr,
+ struct ir3_instruction **dst)
+{
+ struct ir3_block *b = ctx->block;
+ struct ir3_instruction *ibo = ir3_image_to_ibo(ctx, intr->src[0]);
+ struct ir3_instruction *resinfo = ir3_RESINFO(b, ibo, 0);
+ resinfo->cat6.iim_val = 1;
+ resinfo->cat6.d = intr->num_components;
+ resinfo->cat6.type = TYPE_U32;
+ resinfo->cat6.typed = false;
+ resinfo->regs[0]->wrmask = MASK(intr->num_components);
+ ir3_handle_bindless_cat6(resinfo, intr->src[0]);
+
+ ir3_split_dest(b, dst, resinfo, 0, intr->num_components);
+}
+
const struct ir3_context_funcs ir3_a6xx_funcs = {
.emit_intrinsic_load_ssbo = emit_intrinsic_load_ssbo,
.emit_intrinsic_store_ssbo = emit_intrinsic_store_ssbo,
.emit_intrinsic_load_image = emit_intrinsic_load_image,
.emit_intrinsic_store_image = emit_intrinsic_store_image,
.emit_intrinsic_atomic_image = emit_intrinsic_atomic_image,
+ .emit_intrinsic_image_size = emit_intrinsic_image_size,
};
/*
ir3_split_dest(b, dst, sam, 0, 4);
}
-static void
-emit_intrinsic_image_size(struct ir3_context *ctx, nir_intrinsic_instr *intr,
+/* A4xx version of image_size, see ir3_a6xx.c for newer resinfo version. */
+void
+emit_intrinsic_image_size_tex(struct ir3_context *ctx, nir_intrinsic_instr *intr,
struct ir3_instruction **dst)
{
struct ir3_block *b = ctx->block;
break;
case nir_intrinsic_image_size:
case nir_intrinsic_bindless_image_size:
- emit_intrinsic_image_size(ctx, intr, dst);
+ ctx->funcs->emit_intrinsic_image_size(ctx, intr, dst);
break;
case nir_intrinsic_image_atomic_add:
case nir_intrinsic_bindless_image_atomic_add:
struct ir3_instruction **dst);
void (*emit_intrinsic_store_image)(struct ir3_context *ctx, nir_intrinsic_instr *intr);
struct ir3_instruction * (*emit_intrinsic_atomic_image)(struct ir3_context *ctx, nir_intrinsic_instr *intr);
+ void (*emit_intrinsic_image_size)(struct ir3_context *ctx, nir_intrinsic_instr *intr,
+ struct ir3_instruction **dst);
};
extern const struct ir3_context_funcs ir3_a4xx_funcs;
void ir3_split_dest(struct ir3_block *block, struct ir3_instruction **dst,
struct ir3_instruction *src, unsigned base, unsigned n);
void ir3_handle_bindless_cat6(struct ir3_instruction *instr, nir_src rsrc);
+void emit_intrinsic_image_size_tex(struct ir3_context *ctx, nir_intrinsic_instr *intr,
+ struct ir3_instruction **dst);
NORETURN void ir3_context_error(struct ir3_context *ctx, const char *format, ...);
if (instr->opc == OPC_LDLW && n == 0)
return false;
- /* disallow CP into anything but the SSBO slot argument for
- * atomics:
+ /* disallow immediates in anything but the SSBO slot argument for
+ * cat6 instructions:
*/
if (is_atomic(instr->opc) && (n != 0))
return false;
if (instr->opc == OPC_STG && (instr->flags & IR3_INSTR_G) && (n != 2))
return false;
- /* as with atomics, ldib and ldc on a6xx can only have immediate
- * for SSBO slot argument
+ /* as with atomics, these cat6 instrs can only have an immediate
+ * for SSBO/IBO slot argument
*/
- if ((instr->opc == OPC_LDIB || instr->opc == OPC_LDC) && (n != 0))
- return false;
+ switch (instr->opc) {
+ case OPC_LDIB:
+ case OPC_LDC:
+ case OPC_RESINFO:
+ if (n != 0)
+ return false;
+ break;
+ default:
+ break;
+ }
}
break;