Lines Matching refs:instr
84 nir_tex_instr *instr, in handle_tex_src() argument
97 switch (instr->src[src_idx].src_type) { in handle_tex_src()
100 s = ntq_get_src(c, instr->src[src_idx].src, 0); in handle_tex_src()
108 ntq_get_src(c, instr->src[src_idx].src, 1); in handle_tex_src()
115 ntq_get_src(c, instr->src[src_idx].src, 2); in handle_tex_src()
120 if (instr->is_array) { in handle_tex_src()
122 ntq_get_src(c, instr->src[src_idx].src, in handle_tex_src()
123 instr->coord_components - 1); in handle_tex_src()
130 struct qreg src = ntq_get_src(c, instr->src[src_idx].src, 0); in handle_tex_src()
136 struct qreg src = ntq_get_src(c, instr->src[src_idx].src, 0); in handle_tex_src()
145 if (instr->op != nir_texop_txf && in handle_tex_src()
146 instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE) { in handle_tex_src()
154 struct qreg src = ntq_get_src(c, instr->src[src_idx].src, 0); in handle_tex_src()
160 bool is_const_offset = nir_src_is_const(instr->src[src_idx].src); in handle_tex_src()
164 nir_src_comp_as_int(instr->src[src_idx].src, 0); in handle_tex_src()
167 nir_src_comp_as_int(instr->src[src_idx].src, 1); in handle_tex_src()
170 nir_src_comp_as_int(instr->src[src_idx].src, 2); in handle_tex_src()
174 ntq_get_src(c, instr->src[src_idx].src, 0); in handle_tex_src()
176 ntq_get_src(c, instr->src[src_idx].src, 1); in handle_tex_src()
201 nir_tex_instr *instr, in vir_tex_handle_srcs() argument
206 unsigned non_array_components = instr->op != nir_texop_lod ? in vir_tex_handle_srcs()
207 instr->coord_components - instr->is_array : in vir_tex_handle_srcs()
208 instr->coord_components; in vir_tex_handle_srcs()
210 for (unsigned i = 0; i < instr->num_srcs; i++) { in vir_tex_handle_srcs()
211 handle_tex_src(c, instr, i, non_array_components, in vir_tex_handle_srcs()
217 get_required_tex_tmu_writes(struct v3d_compile *c, nir_tex_instr *instr) in get_required_tex_tmu_writes() argument
220 vir_tex_handle_srcs(c, instr, NULL, NULL, &tmu_writes); in get_required_tex_tmu_writes()
225 v3d40_vir_emit_tex(struct v3d_compile *c, nir_tex_instr *instr) in v3d40_vir_emit_tex() argument
227 assert(instr->op != nir_texop_lod || c->devinfo->ver >= 42); in v3d40_vir_emit_tex()
229 unsigned texture_idx = instr->texture_index; in v3d40_vir_emit_tex()
230 unsigned sampler_idx = instr->sampler_index; in v3d40_vir_emit_tex()
239 instr->dest.is_ssa ? in v3d40_vir_emit_tex()
240 nir_ssa_def_components_read(&instr->dest.ssa) : in v3d40_vir_emit_tex()
241 (1 << instr->dest.reg.reg->num_components) - 1; in v3d40_vir_emit_tex()
246 .gather_mode = instr->op == nir_texop_tg4, in v3d40_vir_emit_tex()
247 .gather_component = instr->component, in v3d40_vir_emit_tex()
248 .coefficient_mode = instr->op == nir_texop_txd, in v3d40_vir_emit_tex()
249 .disable_autolod = instr->op == nir_texop_tg4 in v3d40_vir_emit_tex()
252 const unsigned tmu_writes = get_required_tex_tmu_writes(c, instr); in v3d40_vir_emit_tex()
270 vir_tex_handle_srcs(c, instr, &p2_unpacked, &s, NULL); in v3d40_vir_emit_tex()
286 if (instr->op == nir_texop_lod) in v3d40_vir_emit_tex()
303 !instr->is_shadow; in v3d40_vir_emit_tex()
307 (instr->op == nir_texop_lod || in v3d40_vir_emit_tex()
312 bool non_default_p1_config = nir_tex_instr_need_sampler(instr) || in v3d40_vir_emit_tex()
319 .unnormalized_coordinates = (instr->sampler_dim == in v3d40_vir_emit_tex()
337 if (nir_tex_instr_need_sampler(instr)) { in v3d40_vir_emit_tex()
371 if (instr->op == nir_texop_txf) { in v3d40_vir_emit_tex()
372 assert(instr->sampler_dim != GLSL_SAMPLER_DIM_CUBE); in v3d40_vir_emit_tex()
374 } else if (instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE) { in v3d40_vir_emit_tex()
376 } else if (instr->op == nir_texop_txl) { in v3d40_vir_emit_tex()
382 ntq_add_pending_tmu_flush(c, &instr->dest, in v3d40_vir_emit_tex()
387 v3d40_image_load_store_tmu_op(nir_intrinsic_instr *instr) in v3d40_image_load_store_tmu_op() argument
389 switch (instr->intrinsic) { in v3d40_image_load_store_tmu_op()
394 return v3d_get_op_for_atomic_add(instr, 3); in v3d40_image_load_store_tmu_op()
432 nir_intrinsic_instr *instr, in vir_image_emit_register_writes() argument
440 switch (nir_intrinsic_image_dim(instr)) { in vir_image_emit_register_writes()
449 struct qreg src = ntq_get_src(c, instr->src[1], 1); in vir_image_emit_register_writes()
454 struct qreg src_1_1 = ntq_get_src(c, instr->src[1], 1); in vir_image_emit_register_writes()
455 struct qreg src_1_2 = ntq_get_src(c, instr->src[1], 2); in vir_image_emit_register_writes()
467 if (nir_intrinsic_image_dim(instr) == GLSL_SAMPLER_DIM_CUBE || in vir_image_emit_register_writes()
468 nir_intrinsic_image_array(instr)) { in vir_image_emit_register_writes()
469 struct qreg src = ntq_get_src(c, instr->src[1], is_1d ? 1 : 2); in vir_image_emit_register_writes()
474 if (instr->intrinsic != nir_intrinsic_image_load && in vir_image_emit_register_writes()
476 for (int i = 0; i < nir_intrinsic_src_components(instr, 3); i++) { in vir_image_emit_register_writes()
477 struct qreg src_3_i = ntq_get_src(c, instr->src[3], i); in vir_image_emit_register_writes()
483 if (instr->intrinsic == nir_intrinsic_image_atomic_comp_swap) { in vir_image_emit_register_writes()
484 struct qreg src_4_0 = ntq_get_src(c, instr->src[4], 0); in vir_image_emit_register_writes()
490 struct qreg src_1_0 = ntq_get_src(c, instr->src[1], 0); in vir_image_emit_register_writes()
492 instr->intrinsic != nir_intrinsic_image_load) { in vir_image_emit_register_writes()
500 instr->intrinsic != nir_intrinsic_image_load) { in vir_image_emit_register_writes()
509 nir_intrinsic_instr *instr, in get_required_image_tmu_writes() argument
513 vir_image_emit_register_writes(c, instr, atomic_add_replaced, in get_required_image_tmu_writes()
520 nir_intrinsic_instr *instr) in v3d40_vir_emit_image_load_store() argument
522 unsigned format = nir_intrinsic_format(instr); in v3d40_vir_emit_image_load_store()
523 unsigned unit = nir_src_as_uint(instr->src[0]); in v3d40_vir_emit_image_load_store()
538 uint32_t instr_return_channels = nir_intrinsic_dest_components(instr); in v3d40_vir_emit_image_load_store()
545 p2_unpacked.op = v3d40_image_load_store_tmu_op(instr); in v3d40_vir_emit_image_load_store()
552 (instr->intrinsic == nir_intrinsic_image_atomic_add && in v3d40_vir_emit_image_load_store()
577 if (instr->intrinsic != nir_intrinsic_image_load) in v3d40_vir_emit_image_load_store()
582 get_required_image_tmu_writes(c, instr, atomic_add_replaced); in v3d40_vir_emit_image_load_store()
602 vir_image_emit_register_writes(c, instr, atomic_add_replaced, NULL); in v3d40_vir_emit_image_load_store()
604 ntq_add_pending_tmu_flush(c, &instr->dest, in v3d40_vir_emit_image_load_store()