}
static void
+lower_y_vu_external(nir_builder *b, nir_tex_instr *tex,
+ const nir_lower_tex_options *options,
+ unsigned texture_index)
+{
+ b->cursor = nir_after_instr(&tex->instr);
+
+ nir_ssa_def *y = sample_plane(b, tex, 0, options);
+ nir_ssa_def *vu = sample_plane(b, tex, 1, options);
+
+ convert_yuv_to_rgb(b, tex,
+ nir_channel(b, y, 0),
+ nir_channel(b, vu, 1),
+ nir_channel(b, vu, 0),
+ nir_imm_float(b, 1.0f),
+ options,
+ texture_index);
+}
+
+static void
lower_y_u_v_external(nir_builder *b, nir_tex_instr *tex,
const nir_lower_tex_options *options,
unsigned texture_index)
}
static void
+lower_yx_xvxu_external(nir_builder *b, nir_tex_instr *tex,
+ const nir_lower_tex_options *options,
+ unsigned texture_index)
+{
+ b->cursor = nir_after_instr(&tex->instr);
+
+ nir_ssa_def *y = sample_plane(b, tex, 0, options);
+ nir_ssa_def *xvxu = sample_plane(b, tex, 1, options);
+
+ convert_yuv_to_rgb(b, tex,
+ nir_channel(b, y, 0),
+ nir_channel(b, xvxu, 3),
+ nir_channel(b, xvxu, 1),
+ nir_imm_float(b, 1.0f),
+ options,
+ texture_index);
+}
+
+static void
lower_xy_uxvx_external(nir_builder *b, nir_tex_instr *tex,
const nir_lower_tex_options *options,
unsigned texture_index)
}
static void
+lower_xy_vxux_external(nir_builder *b, nir_tex_instr *tex,
+ const nir_lower_tex_options *options,
+ unsigned texture_index)
+{
+ b->cursor = nir_after_instr(&tex->instr);
+
+ nir_ssa_def *y = sample_plane(b, tex, 0, options);
+ nir_ssa_def *vxux = sample_plane(b, tex, 1, options);
+
+ convert_yuv_to_rgb(b, tex,
+ nir_channel(b, y, 1),
+ nir_channel(b, vxux, 2),
+ nir_channel(b, vxux, 0),
+ nir_imm_float(b, 1.0f),
+ options,
+ texture_index);
+}
+
+static void
lower_ayuv_external(nir_builder *b, nir_tex_instr *tex,
const nir_lower_tex_options *options,
unsigned texture_index)
texture_index);
}
+static void
+lower_yv_yu_external(nir_builder *b, nir_tex_instr *tex,
+ const nir_lower_tex_options *options,
+ unsigned texture_index)
+{
+ b->cursor = nir_after_instr(&tex->instr);
+
+ nir_ssa_def *yuv = sample_plane(b, tex, 0, options);
+
+ convert_yuv_to_rgb(b, tex,
+ nir_channel(b, yuv, 2),
+ nir_channel(b, yuv, 1),
+ nir_channel(b, yuv, 0),
+ nir_imm_float(b, 1.0f),
+ options,
+ texture_index);
+}
+
/*
* Converts a nir_texop_txd instruction to nir_texop_txl with the given lod
* computed from the gradients.
progress = true;
}
+ if (texture_mask & options->lower_y_vu_external) {
+ lower_y_vu_external(b, tex, options, texture_index);
+ progress = true;
+ }
+
if (texture_mask & options->lower_y_u_v_external) {
lower_y_u_v_external(b, tex, options, texture_index);
progress = true;
progress = true;
}
+ if (texture_mask & options->lower_yx_xvxu_external) {
+ lower_yx_xvxu_external(b, tex, options, texture_index);
+ progress = true;
+ }
+
if (texture_mask & options->lower_xy_uxvx_external) {
lower_xy_uxvx_external(b, tex, options, texture_index);
progress = true;
}
+ if (texture_mask & options->lower_xy_vxux_external) {
+ lower_xy_vxux_external(b, tex, options, texture_index);
+ progress = true;
+ }
+
if (texture_mask & options->lower_ayuv_external) {
lower_ayuv_external(b, tex, options, texture_index);
progress = true;
progress = true;
}
+ if ((1 << tex->texture_index) & options->lower_yv_yu_external) {
+ lower_yv_yu_external(b, tex, options, texture_index);
+ progress = true;
+ }
+
if ((1 << tex->texture_index) & options->lower_y41x_external) {
lower_y41x_external(b, tex, options, texture_index);
progress = true;