nir: Drop "SSA" from NIR language
Everything is SSA now.
sed -e 's/nir_ssa_def/nir_def/g' \
-e 's/nir_ssa_undef/nir_undef/g' \
-e 's/nir_ssa_scalar/nir_scalar/g' \
-e 's/nir_src_rewrite_ssa/nir_src_rewrite/g' \
-e 's/nir_gather_ssa_types/nir_gather_types/g' \
-i $(git grep -l nir | grep -v relnotes)
git mv src/compiler/nir/nir_gather_ssa_types.c \
src/compiler/nir/nir_gather_types.c
ninja -C build/ clang-format
cd src/compiler/nir && find *.c *.h -type f -exec clang-format -i \{} \;
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24585>
This commit is contained in:
+140
-140
@@ -99,12 +99,12 @@ static const float bt2020_full_range_csc_offsets[3] = {
|
||||
static bool
|
||||
project_src(nir_builder *b, nir_tex_instr *tex)
|
||||
{
|
||||
nir_ssa_def *proj = nir_steal_tex_src(tex, nir_tex_src_projector);
|
||||
nir_def *proj = nir_steal_tex_src(tex, nir_tex_src_projector);
|
||||
if (!proj)
|
||||
return false;
|
||||
|
||||
b->cursor = nir_before_instr(&tex->instr);
|
||||
nir_ssa_def *inv_proj = nir_frcp(b, proj);
|
||||
nir_def *inv_proj = nir_frcp(b, proj);
|
||||
|
||||
/* Walk through the sources projecting the arguments. */
|
||||
for (unsigned i = 0; i < tex->num_srcs; i++) {
|
||||
@@ -115,9 +115,9 @@ project_src(nir_builder *b, nir_tex_instr *tex)
|
||||
default:
|
||||
continue;
|
||||
}
|
||||
nir_ssa_def *unprojected =
|
||||
nir_def *unprojected =
|
||||
nir_ssa_for_src(b, tex->src[i].src, nir_tex_instr_src_size(tex, i));
|
||||
nir_ssa_def *projected = nir_fmul(b, unprojected, inv_proj);
|
||||
nir_def *projected = nir_fmul(b, unprojected, inv_proj);
|
||||
|
||||
/* Array indices don't get projected, so make an new vector with the
|
||||
* coordinate's array index untouched.
|
||||
@@ -159,29 +159,29 @@ project_src(nir_builder *b, nir_tex_instr *tex)
|
||||
static bool
|
||||
lower_offset(nir_builder *b, nir_tex_instr *tex)
|
||||
{
|
||||
nir_ssa_def *offset = nir_steal_tex_src(tex, nir_tex_src_offset);
|
||||
nir_def *offset = nir_steal_tex_src(tex, nir_tex_src_offset);
|
||||
if (!offset)
|
||||
return false;
|
||||
|
||||
int coord_index = nir_tex_instr_src_index(tex, nir_tex_src_coord);
|
||||
assert(coord_index >= 0);
|
||||
|
||||
nir_ssa_def *coord = tex->src[coord_index].src.ssa;
|
||||
nir_def *coord = tex->src[coord_index].src.ssa;
|
||||
|
||||
b->cursor = nir_before_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *offset_coord;
|
||||
nir_def *offset_coord;
|
||||
if (nir_tex_instr_src_type(tex, coord_index) == nir_type_float) {
|
||||
if (tex->sampler_dim == GLSL_SAMPLER_DIM_RECT) {
|
||||
offset_coord = nir_fadd(b, coord, nir_i2f32(b, offset));
|
||||
} else {
|
||||
nir_ssa_def *scale = NULL;
|
||||
nir_def *scale = NULL;
|
||||
|
||||
if (b->shader->options->has_texture_scaling) {
|
||||
nir_ssa_def *idx = nir_imm_int(b, tex->texture_index);
|
||||
nir_def *idx = nir_imm_int(b, tex->texture_index);
|
||||
scale = nir_load_texture_scale(b, 32, idx);
|
||||
} else {
|
||||
nir_ssa_def *txs = nir_i2f32(b, nir_get_texture_size(b, tex));
|
||||
nir_def *txs = nir_i2f32(b, nir_get_texture_size(b, tex));
|
||||
scale = nir_frcp(b, txs);
|
||||
}
|
||||
|
||||
@@ -222,12 +222,12 @@ lower_rect(nir_builder *b, nir_tex_instr *tex)
|
||||
*/
|
||||
tex->sampler_dim = GLSL_SAMPLER_DIM_2D;
|
||||
|
||||
nir_ssa_def *txs = nir_i2f32(b, nir_get_texture_size(b, tex));
|
||||
nir_ssa_def *scale = nir_frcp(b, txs);
|
||||
nir_def *txs = nir_i2f32(b, nir_get_texture_size(b, tex));
|
||||
nir_def *scale = nir_frcp(b, txs);
|
||||
int coord_index = nir_tex_instr_src_index(tex, nir_tex_src_coord);
|
||||
|
||||
if (coord_index != -1) {
|
||||
nir_ssa_def *coords =
|
||||
nir_def *coords =
|
||||
nir_ssa_for_src(b, tex->src[coord_index].src, tex->coord_components);
|
||||
nir_instr_rewrite_src(&tex->instr,
|
||||
&tex->src[coord_index].src,
|
||||
@@ -240,12 +240,12 @@ lower_rect_tex_scale(nir_builder *b, nir_tex_instr *tex)
|
||||
{
|
||||
b->cursor = nir_before_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *idx = nir_imm_int(b, tex->texture_index);
|
||||
nir_ssa_def *scale = nir_load_texture_scale(b, 32, idx);
|
||||
nir_def *idx = nir_imm_int(b, tex->texture_index);
|
||||
nir_def *scale = nir_load_texture_scale(b, 32, idx);
|
||||
int coord_index = nir_tex_instr_src_index(tex, nir_tex_src_coord);
|
||||
|
||||
if (coord_index != -1) {
|
||||
nir_ssa_def *coords =
|
||||
nir_def *coords =
|
||||
nir_ssa_for_src(b, tex->src[coord_index].src, tex->coord_components);
|
||||
nir_instr_rewrite_src(&tex->instr,
|
||||
&tex->src[coord_index].src,
|
||||
@@ -254,7 +254,7 @@ lower_rect_tex_scale(nir_builder *b, nir_tex_instr *tex)
|
||||
}
|
||||
|
||||
static void
|
||||
lower_lod(nir_builder *b, nir_tex_instr *tex, nir_ssa_def *lod)
|
||||
lower_lod(nir_builder *b, nir_tex_instr *tex, nir_def *lod)
|
||||
{
|
||||
assert(tex->op == nir_texop_tex || tex->op == nir_texop_txb);
|
||||
assert(nir_tex_instr_src_index(tex, nir_tex_src_lod) < 0);
|
||||
@@ -262,12 +262,12 @@ lower_lod(nir_builder *b, nir_tex_instr *tex, nir_ssa_def *lod)
|
||||
assert(nir_tex_instr_src_index(tex, nir_tex_src_ddy) < 0);
|
||||
|
||||
/* If we have a bias, add it in */
|
||||
nir_ssa_def *bias = nir_steal_tex_src(tex, nir_tex_src_bias);
|
||||
nir_def *bias = nir_steal_tex_src(tex, nir_tex_src_bias);
|
||||
if (bias)
|
||||
lod = nir_fadd(b, lod, bias);
|
||||
|
||||
/* If we have a minimum LOD, clamp LOD accordingly */
|
||||
nir_ssa_def *min_lod = nir_steal_tex_src(tex, nir_tex_src_min_lod);
|
||||
nir_def *min_lod = nir_steal_tex_src(tex, nir_tex_src_min_lod);
|
||||
if (min_lod)
|
||||
lod = nir_fmax(b, lod, min_lod);
|
||||
|
||||
@@ -288,7 +288,7 @@ lower_zero_lod(nir_builder *b, nir_tex_instr *tex)
|
||||
b->cursor = nir_before_instr(&tex->instr);
|
||||
|
||||
if (tex->op == nir_texop_lod) {
|
||||
nir_ssa_def_rewrite_uses(&tex->dest.ssa, nir_imm_int(b, 0));
|
||||
nir_def_rewrite_uses(&tex->dest.ssa, nir_imm_int(b, 0));
|
||||
nir_instr_remove(&tex->instr);
|
||||
return;
|
||||
}
|
||||
@@ -296,7 +296,7 @@ lower_zero_lod(nir_builder *b, nir_tex_instr *tex)
|
||||
lower_lod(b, tex, nir_imm_int(b, 0));
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
static nir_def *
|
||||
sample_plane(nir_builder *b, nir_tex_instr *tex, int plane,
|
||||
const nir_lower_tex_options *options)
|
||||
{
|
||||
@@ -336,8 +336,8 @@ sample_plane(nir_builder *b, nir_tex_instr *tex, int plane,
|
||||
|
||||
static void
|
||||
convert_yuv_to_rgb(nir_builder *b, nir_tex_instr *tex,
|
||||
nir_ssa_def *y, nir_ssa_def *u, nir_ssa_def *v,
|
||||
nir_ssa_def *a,
|
||||
nir_def *y, nir_def *u, nir_def *v,
|
||||
nir_def *a,
|
||||
const nir_lower_tex_options *options,
|
||||
unsigned texture_index)
|
||||
{
|
||||
@@ -371,7 +371,7 @@ convert_yuv_to_rgb(nir_builder *b, nir_tex_instr *tex,
|
||||
|
||||
unsigned bit_size = nir_dest_bit_size(tex->dest);
|
||||
|
||||
nir_ssa_def *offset =
|
||||
nir_def *offset =
|
||||
nir_vec4(b,
|
||||
nir_imm_floatN_t(b, offset_vals[0], a->bit_size),
|
||||
nir_imm_floatN_t(b, offset_vals[1], a->bit_size),
|
||||
@@ -380,14 +380,14 @@ convert_yuv_to_rgb(nir_builder *b, nir_tex_instr *tex,
|
||||
|
||||
offset = nir_f2fN(b, offset, bit_size);
|
||||
|
||||
nir_ssa_def *m0 = nir_f2fN(b, nir_build_imm(b, 4, 32, m->v[0]), bit_size);
|
||||
nir_ssa_def *m1 = nir_f2fN(b, nir_build_imm(b, 4, 32, m->v[1]), bit_size);
|
||||
nir_ssa_def *m2 = nir_f2fN(b, nir_build_imm(b, 4, 32, m->v[2]), bit_size);
|
||||
nir_def *m0 = nir_f2fN(b, nir_build_imm(b, 4, 32, m->v[0]), bit_size);
|
||||
nir_def *m1 = nir_f2fN(b, nir_build_imm(b, 4, 32, m->v[1]), bit_size);
|
||||
nir_def *m2 = nir_f2fN(b, nir_build_imm(b, 4, 32, m->v[2]), bit_size);
|
||||
|
||||
nir_ssa_def *result =
|
||||
nir_def *result =
|
||||
nir_ffma(b, y, m0, nir_ffma(b, u, m1, nir_ffma(b, v, m2, offset)));
|
||||
|
||||
nir_ssa_def_rewrite_uses(&tex->dest.ssa, result);
|
||||
nir_def_rewrite_uses(&tex->dest.ssa, result);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -397,8 +397,8 @@ lower_y_uv_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_ssa_def *uv = sample_plane(b, tex, 1, options);
|
||||
nir_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_def *uv = sample_plane(b, tex, 1, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, y, 0),
|
||||
@@ -416,8 +416,8 @@ lower_y_vu_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
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);
|
||||
nir_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_def *vu = sample_plane(b, tex, 1, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, y, 0),
|
||||
@@ -435,9 +435,9 @@ lower_y_u_v_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_ssa_def *u = sample_plane(b, tex, 1, options);
|
||||
nir_ssa_def *v = sample_plane(b, tex, 2, options);
|
||||
nir_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_def *u = sample_plane(b, tex, 1, options);
|
||||
nir_def *v = sample_plane(b, tex, 2, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, y, 0),
|
||||
@@ -455,8 +455,8 @@ lower_yx_xuxv_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_ssa_def *xuxv = sample_plane(b, tex, 1, options);
|
||||
nir_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_def *xuxv = sample_plane(b, tex, 1, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, y, 0),
|
||||
@@ -474,8 +474,8 @@ lower_yx_xvxu_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
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);
|
||||
nir_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_def *xvxu = sample_plane(b, tex, 1, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, y, 0),
|
||||
@@ -493,8 +493,8 @@ lower_xy_uxvx_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_ssa_def *uxvx = sample_plane(b, tex, 1, options);
|
||||
nir_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_def *uxvx = sample_plane(b, tex, 1, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, y, 1),
|
||||
@@ -512,8 +512,8 @@ lower_xy_vxux_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
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);
|
||||
nir_def *y = sample_plane(b, tex, 0, options);
|
||||
nir_def *vxux = sample_plane(b, tex, 1, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, y, 1),
|
||||
@@ -531,7 +531,7 @@ lower_ayuv_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *ayuv = sample_plane(b, tex, 0, options);
|
||||
nir_def *ayuv = sample_plane(b, tex, 0, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, ayuv, 2),
|
||||
@@ -549,7 +549,7 @@ lower_y41x_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *y41x = sample_plane(b, tex, 0, options);
|
||||
nir_def *y41x = sample_plane(b, tex, 0, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, y41x, 1),
|
||||
@@ -567,7 +567,7 @@ lower_xyuv_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *xyuv = sample_plane(b, tex, 0, options);
|
||||
nir_def *xyuv = sample_plane(b, tex, 0, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, xyuv, 2),
|
||||
@@ -585,7 +585,7 @@ lower_yuv_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *yuv = sample_plane(b, tex, 0, options);
|
||||
nir_def *yuv = sample_plane(b, tex, 0, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, yuv, 0),
|
||||
@@ -603,7 +603,7 @@ lower_yu_yv_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *yuv = sample_plane(b, tex, 0, options);
|
||||
nir_def *yuv = sample_plane(b, tex, 0, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, yuv, 1),
|
||||
@@ -621,7 +621,7 @@ lower_yv_yu_external(nir_builder *b, nir_tex_instr *tex,
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *yuv = sample_plane(b, tex, 0, options);
|
||||
nir_def *yuv = sample_plane(b, tex, 0, options);
|
||||
|
||||
convert_yuv_to_rgb(b, tex,
|
||||
nir_channel(b, yuv, 2),
|
||||
@@ -637,7 +637,7 @@ lower_yv_yu_external(nir_builder *b, nir_tex_instr *tex,
|
||||
* computed from the gradients.
|
||||
*/
|
||||
static void
|
||||
replace_gradient_with_lod(nir_builder *b, nir_ssa_def *lod, nir_tex_instr *tex)
|
||||
replace_gradient_with_lod(nir_builder *b, nir_def *lod, nir_tex_instr *tex)
|
||||
{
|
||||
assert(tex->op == nir_texop_txd);
|
||||
|
||||
@@ -645,7 +645,7 @@ replace_gradient_with_lod(nir_builder *b, nir_ssa_def *lod, nir_tex_instr *tex)
|
||||
nir_tex_instr_remove_src(tex, nir_tex_instr_src_index(tex, nir_tex_src_ddy));
|
||||
|
||||
/* If we have a minimum LOD, clamp LOD accordingly */
|
||||
nir_ssa_def *min_lod = nir_steal_tex_src(tex, nir_tex_src_min_lod);
|
||||
nir_def *min_lod = nir_steal_tex_src(tex, nir_tex_src_min_lod);
|
||||
if (min_lod)
|
||||
lod = nir_fmax(b, lod, min_lod);
|
||||
|
||||
@@ -660,7 +660,7 @@ lower_gradient_cube_map(nir_builder *b, nir_tex_instr *tex)
|
||||
assert(tex->op == nir_texop_txd);
|
||||
|
||||
/* Use textureSize() to get the width and height of LOD 0 */
|
||||
nir_ssa_def *size = nir_i2f32(b, nir_get_texture_size(b, tex));
|
||||
nir_def *size = nir_i2f32(b, nir_get_texture_size(b, tex));
|
||||
|
||||
/* Cubemap texture lookups first generate a texture coordinate normalized
|
||||
* to [-1, 1] on the appropiate face. The appropiate face is determined
|
||||
@@ -719,25 +719,25 @@ lower_gradient_cube_map(nir_builder *b, nir_tex_instr *tex)
|
||||
*/
|
||||
|
||||
/* coordinate */
|
||||
nir_ssa_def *p =
|
||||
nir_def *p =
|
||||
tex->src[nir_tex_instr_src_index(tex, nir_tex_src_coord)].src.ssa;
|
||||
|
||||
/* unmodified dPdx, dPdy values */
|
||||
nir_ssa_def *dPdx =
|
||||
nir_def *dPdx =
|
||||
tex->src[nir_tex_instr_src_index(tex, nir_tex_src_ddx)].src.ssa;
|
||||
nir_ssa_def *dPdy =
|
||||
nir_def *dPdy =
|
||||
tex->src[nir_tex_instr_src_index(tex, nir_tex_src_ddy)].src.ssa;
|
||||
|
||||
nir_ssa_def *abs_p = nir_fabs(b, p);
|
||||
nir_ssa_def *abs_p_x = nir_channel(b, abs_p, 0);
|
||||
nir_ssa_def *abs_p_y = nir_channel(b, abs_p, 1);
|
||||
nir_ssa_def *abs_p_z = nir_channel(b, abs_p, 2);
|
||||
nir_def *abs_p = nir_fabs(b, p);
|
||||
nir_def *abs_p_x = nir_channel(b, abs_p, 0);
|
||||
nir_def *abs_p_y = nir_channel(b, abs_p, 1);
|
||||
nir_def *abs_p_z = nir_channel(b, abs_p, 2);
|
||||
|
||||
/* 1. compute selector */
|
||||
nir_ssa_def *Q, *dQdx, *dQdy;
|
||||
nir_def *Q, *dQdx, *dQdy;
|
||||
|
||||
nir_ssa_def *cond_z = nir_fge(b, abs_p_z, nir_fmax(b, abs_p_x, abs_p_y));
|
||||
nir_ssa_def *cond_y = nir_fge(b, abs_p_y, nir_fmax(b, abs_p_x, abs_p_z));
|
||||
nir_def *cond_z = nir_fge(b, abs_p_z, nir_fmax(b, abs_p_x, abs_p_y));
|
||||
nir_def *cond_y = nir_fge(b, abs_p_y, nir_fmax(b, abs_p_x, abs_p_z));
|
||||
|
||||
unsigned yzx[3] = { 1, 2, 0 };
|
||||
unsigned xzy[3] = { 0, 2, 1 };
|
||||
@@ -766,29 +766,29 @@ lower_gradient_cube_map(nir_builder *b, nir_tex_instr *tex)
|
||||
* dx = recip * ( dQdx.xy - (tmp * dQdx.z) );
|
||||
* dy = recip * ( dQdy.xy - (tmp * dQdy.z) );
|
||||
*/
|
||||
nir_ssa_def *rcp_Q_z = nir_frcp(b, nir_channel(b, Q, 2));
|
||||
nir_def *rcp_Q_z = nir_frcp(b, nir_channel(b, Q, 2));
|
||||
|
||||
nir_ssa_def *Q_xy = nir_trim_vector(b, Q, 2);
|
||||
nir_ssa_def *tmp = nir_fmul(b, Q_xy, rcp_Q_z);
|
||||
nir_def *Q_xy = nir_trim_vector(b, Q, 2);
|
||||
nir_def *tmp = nir_fmul(b, Q_xy, rcp_Q_z);
|
||||
|
||||
nir_ssa_def *dQdx_xy = nir_trim_vector(b, dQdx, 2);
|
||||
nir_ssa_def *dQdx_z = nir_channel(b, dQdx, 2);
|
||||
nir_ssa_def *dx =
|
||||
nir_def *dQdx_xy = nir_trim_vector(b, dQdx, 2);
|
||||
nir_def *dQdx_z = nir_channel(b, dQdx, 2);
|
||||
nir_def *dx =
|
||||
nir_fmul(b, rcp_Q_z, nir_fsub(b, dQdx_xy, nir_fmul(b, tmp, dQdx_z)));
|
||||
|
||||
nir_ssa_def *dQdy_xy = nir_trim_vector(b, dQdy, 2);
|
||||
nir_ssa_def *dQdy_z = nir_channel(b, dQdy, 2);
|
||||
nir_ssa_def *dy =
|
||||
nir_def *dQdy_xy = nir_trim_vector(b, dQdy, 2);
|
||||
nir_def *dQdy_z = nir_channel(b, dQdy, 2);
|
||||
nir_def *dy =
|
||||
nir_fmul(b, rcp_Q_z, nir_fsub(b, dQdy_xy, nir_fmul(b, tmp, dQdy_z)));
|
||||
|
||||
/* M = max(dot(dx, dx), dot(dy, dy)); */
|
||||
nir_ssa_def *M = nir_fmax(b, nir_fdot(b, dx, dx), nir_fdot(b, dy, dy));
|
||||
nir_def *M = nir_fmax(b, nir_fdot(b, dx, dx), nir_fdot(b, dy, dy));
|
||||
|
||||
/* size has textureSize() of LOD 0 */
|
||||
nir_ssa_def *L = nir_channel(b, size, 0);
|
||||
nir_def *L = nir_channel(b, size, 0);
|
||||
|
||||
/* lod = -1.0 + 0.5 * log2(L * L * M); */
|
||||
nir_ssa_def *lod =
|
||||
nir_def *lod =
|
||||
nir_fadd(b,
|
||||
nir_imm_float(b, -1.0f),
|
||||
nir_fmul(b,
|
||||
@@ -825,7 +825,7 @@ lower_gradient(nir_builder *b, nir_tex_instr *tex)
|
||||
break;
|
||||
}
|
||||
|
||||
nir_ssa_def *size =
|
||||
nir_def *size =
|
||||
nir_channels(b, nir_i2f32(b, nir_get_texture_size(b, tex)),
|
||||
component_mask);
|
||||
|
||||
@@ -833,15 +833,15 @@ lower_gradient(nir_builder *b, nir_tex_instr *tex)
|
||||
* gradients are s'(x,y), t'(x,y), and r'(x,y) from equation 3.19 in the
|
||||
* GL 3.0 spec; we want u'(x,y), which is w_t * s'(x,y).
|
||||
*/
|
||||
nir_ssa_def *ddx =
|
||||
nir_def *ddx =
|
||||
tex->src[nir_tex_instr_src_index(tex, nir_tex_src_ddx)].src.ssa;
|
||||
nir_ssa_def *ddy =
|
||||
nir_def *ddy =
|
||||
tex->src[nir_tex_instr_src_index(tex, nir_tex_src_ddy)].src.ssa;
|
||||
|
||||
nir_ssa_def *dPdx = nir_fmul(b, ddx, size);
|
||||
nir_ssa_def *dPdy = nir_fmul(b, ddy, size);
|
||||
nir_def *dPdx = nir_fmul(b, ddx, size);
|
||||
nir_def *dPdy = nir_fmul(b, ddy, size);
|
||||
|
||||
nir_ssa_def *rho;
|
||||
nir_def *rho;
|
||||
if (dPdx->num_components == 1) {
|
||||
rho = nir_fmax(b, nir_fabs(b, dPdx), nir_fabs(b, dPdy));
|
||||
} else {
|
||||
@@ -851,7 +851,7 @@ lower_gradient(nir_builder *b, nir_tex_instr *tex)
|
||||
}
|
||||
|
||||
/* lod = log2(rho). We're ignoring GL state biases for now. */
|
||||
nir_ssa_def *lod = nir_flog2(b, rho);
|
||||
nir_def *lod = nir_flog2(b, rho);
|
||||
|
||||
/* Replace the gradient instruction with an equivalent lod instruction */
|
||||
replace_gradient_with_lod(b, lod, tex);
|
||||
@@ -881,8 +881,8 @@ lower_tex_to_txd(nir_builder *b, nir_tex_instr *tex)
|
||||
}
|
||||
int coord = nir_tex_instr_src_index(tex, nir_tex_src_coord);
|
||||
assert(coord >= 0);
|
||||
nir_ssa_def *dfdx = nir_fddx(b, tex->src[coord].src.ssa);
|
||||
nir_ssa_def *dfdy = nir_fddy(b, tex->src[coord].src.ssa);
|
||||
nir_def *dfdx = nir_fddx(b, tex->src[coord].src.ssa);
|
||||
nir_def *dfdy = nir_fddy(b, tex->src[coord].src.ssa);
|
||||
txd->src[tex->num_srcs] = nir_tex_src_for_ssa(nir_tex_src_ddx, dfdx);
|
||||
txd->src[tex->num_srcs + 1] = nir_tex_src_for_ssa(nir_tex_src_ddy, dfdy);
|
||||
|
||||
@@ -890,7 +890,7 @@ lower_tex_to_txd(nir_builder *b, nir_tex_instr *tex)
|
||||
nir_dest_num_components(tex->dest),
|
||||
nir_dest_bit_size(tex->dest));
|
||||
nir_builder_instr_insert(b, &txd->instr);
|
||||
nir_ssa_def_rewrite_uses(&tex->dest.ssa, &txd->dest.ssa);
|
||||
nir_def_rewrite_uses(&tex->dest.ssa, &txd->dest.ssa);
|
||||
nir_instr_remove(&tex->instr);
|
||||
return txd;
|
||||
}
|
||||
@@ -919,7 +919,7 @@ lower_txb_to_txl(nir_builder *b, nir_tex_instr *tex)
|
||||
txl->src[i].src_type = tex->src[i].src_type;
|
||||
}
|
||||
}
|
||||
nir_ssa_def *lod = nir_get_texture_lod(b, txl);
|
||||
nir_def *lod = nir_get_texture_lod(b, txl);
|
||||
|
||||
int bias_idx = nir_tex_instr_src_index(tex, nir_tex_src_bias);
|
||||
assert(bias_idx >= 0);
|
||||
@@ -930,7 +930,7 @@ lower_txb_to_txl(nir_builder *b, nir_tex_instr *tex)
|
||||
nir_dest_num_components(tex->dest),
|
||||
nir_dest_bit_size(tex->dest));
|
||||
nir_builder_instr_insert(b, &txl->instr);
|
||||
nir_ssa_def_rewrite_uses(&tex->dest.ssa, &txl->dest.ssa);
|
||||
nir_def_rewrite_uses(&tex->dest.ssa, &txl->dest.ssa);
|
||||
nir_instr_remove(&tex->instr);
|
||||
return txl;
|
||||
}
|
||||
@@ -947,11 +947,11 @@ saturate_src(nir_builder *b, nir_tex_instr *tex, unsigned sat_mask)
|
||||
int coord_index = nir_tex_instr_src_index(tex, nir_tex_src_coord);
|
||||
|
||||
if (coord_index != -1) {
|
||||
nir_ssa_def *src =
|
||||
nir_def *src =
|
||||
nir_ssa_for_src(b, tex->src[coord_index].src, tex->coord_components);
|
||||
|
||||
/* split src into components: */
|
||||
nir_ssa_def *comp[4];
|
||||
nir_def *comp[4];
|
||||
|
||||
assume(tex->coord_components >= 1);
|
||||
|
||||
@@ -969,7 +969,7 @@ saturate_src(nir_builder *b, nir_tex_instr *tex, unsigned sat_mask)
|
||||
/* non-normalized texture coords, so clamp to texture
|
||||
* size rather than [0.0, 1.0]
|
||||
*/
|
||||
nir_ssa_def *txs = nir_i2f32(b, nir_get_texture_size(b, tex));
|
||||
nir_def *txs = nir_i2f32(b, nir_get_texture_size(b, tex));
|
||||
comp[j] = nir_fmax(b, comp[j], nir_imm_float(b, 0.0));
|
||||
comp[j] = nir_fmin(b, comp[j], nir_channel(b, txs, j));
|
||||
} else {
|
||||
@@ -988,7 +988,7 @@ saturate_src(nir_builder *b, nir_tex_instr *tex, unsigned sat_mask)
|
||||
return tex;
|
||||
}
|
||||
|
||||
static nir_ssa_def *
|
||||
static nir_def *
|
||||
get_zero_or_one(nir_builder *b, nir_alu_type type, uint8_t swizzle_val)
|
||||
{
|
||||
nir_const_value v[4];
|
||||
@@ -1015,10 +1015,10 @@ swizzle_tg4_broadcom(nir_builder *b, nir_tex_instr *tex)
|
||||
|
||||
assert(nir_tex_instr_dest_size(tex) == 4);
|
||||
unsigned swiz[4] = { 2, 3, 1, 0 };
|
||||
nir_ssa_def *swizzled = nir_swizzle(b, &tex->dest.ssa, swiz, 4);
|
||||
nir_def *swizzled = nir_swizzle(b, &tex->dest.ssa, swiz, 4);
|
||||
|
||||
nir_ssa_def_rewrite_uses_after(&tex->dest.ssa, swizzled,
|
||||
swizzled->parent_instr);
|
||||
nir_def_rewrite_uses_after(&tex->dest.ssa, swizzled,
|
||||
swizzled->parent_instr);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1026,7 +1026,7 @@ swizzle_result(nir_builder *b, nir_tex_instr *tex, const uint8_t swizzle[4])
|
||||
{
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *swizzled;
|
||||
nir_def *swizzled;
|
||||
if (tex->op == nir_texop_tg4) {
|
||||
if (swizzle[tex->component] < 4) {
|
||||
/* This one's easy */
|
||||
@@ -1043,7 +1043,7 @@ swizzle_result(nir_builder *b, nir_tex_instr *tex, const uint8_t swizzle[4])
|
||||
/* We have no 0s or 1s, just emit a swizzling MOV */
|
||||
swizzled = nir_swizzle(b, &tex->dest.ssa, swiz, 4);
|
||||
} else {
|
||||
nir_ssa_scalar srcs[4];
|
||||
nir_scalar srcs[4];
|
||||
for (unsigned i = 0; i < 4; i++) {
|
||||
if (swizzle[i] < 4) {
|
||||
srcs[i] = nir_get_ssa_scalar(&tex->dest.ssa, swizzle[i]);
|
||||
@@ -1055,8 +1055,8 @@ swizzle_result(nir_builder *b, nir_tex_instr *tex, const uint8_t swizzle[4])
|
||||
}
|
||||
}
|
||||
|
||||
nir_ssa_def_rewrite_uses_after(&tex->dest.ssa, swizzled,
|
||||
swizzled->parent_instr);
|
||||
nir_def_rewrite_uses_after(&tex->dest.ssa, swizzled,
|
||||
swizzled->parent_instr);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1067,18 +1067,18 @@ linearize_srgb_result(nir_builder *b, nir_tex_instr *tex)
|
||||
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *rgb =
|
||||
nir_def *rgb =
|
||||
nir_format_srgb_to_linear(b, nir_trim_vector(b, &tex->dest.ssa, 3));
|
||||
|
||||
/* alpha is untouched: */
|
||||
nir_ssa_def *result = nir_vec4(b,
|
||||
nir_channel(b, rgb, 0),
|
||||
nir_channel(b, rgb, 1),
|
||||
nir_channel(b, rgb, 2),
|
||||
nir_channel(b, &tex->dest.ssa, 3));
|
||||
nir_def *result = nir_vec4(b,
|
||||
nir_channel(b, rgb, 0),
|
||||
nir_channel(b, rgb, 1),
|
||||
nir_channel(b, rgb, 2),
|
||||
nir_channel(b, &tex->dest.ssa, 3));
|
||||
|
||||
nir_ssa_def_rewrite_uses_after(&tex->dest.ssa, result,
|
||||
result->parent_instr);
|
||||
nir_def_rewrite_uses_after(&tex->dest.ssa, result,
|
||||
result->parent_instr);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1094,7 +1094,7 @@ static bool
|
||||
lower_tex_packing(nir_builder *b, nir_tex_instr *tex,
|
||||
const nir_lower_tex_options *options)
|
||||
{
|
||||
nir_ssa_def *color = &tex->dest.ssa;
|
||||
nir_def *color = &tex->dest.ssa;
|
||||
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
@@ -1117,15 +1117,15 @@ lower_tex_packing(nir_builder *b, nir_tex_instr *tex,
|
||||
color = nir_unpack_half_2x16_split_x(b, nir_channel(b, color, 0));
|
||||
break;
|
||||
case 2: {
|
||||
nir_ssa_def *rg = nir_channel(b, color, 0);
|
||||
nir_def *rg = nir_channel(b, color, 0);
|
||||
color = nir_vec2(b,
|
||||
nir_unpack_half_2x16_split_x(b, rg),
|
||||
nir_unpack_half_2x16_split_y(b, rg));
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
nir_ssa_def *rg = nir_channel(b, color, 0);
|
||||
nir_ssa_def *ba = nir_channel(b, color, 1);
|
||||
nir_def *rg = nir_channel(b, color, 0);
|
||||
nir_def *ba = nir_channel(b, color, 1);
|
||||
color = nir_vec4(b,
|
||||
nir_unpack_half_2x16_split_x(b, rg),
|
||||
nir_unpack_half_2x16_split_y(b, rg),
|
||||
@@ -1158,8 +1158,8 @@ lower_tex_packing(nir_builder *b, nir_tex_instr *tex,
|
||||
break;
|
||||
}
|
||||
|
||||
nir_ssa_def_rewrite_uses_after(&tex->dest.ssa, color,
|
||||
color->parent_instr);
|
||||
nir_def_rewrite_uses_after(&tex->dest.ssa, color,
|
||||
color->parent_instr);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1191,8 +1191,8 @@ lower_tg4_offsets(nir_builder *b, nir_tex_instr *tex)
|
||||
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_scalar dest[5] = { 0 };
|
||||
nir_ssa_def *residency = NULL;
|
||||
nir_scalar dest[5] = { 0 };
|
||||
nir_def *residency = NULL;
|
||||
for (unsigned i = 0; i < 4; ++i) {
|
||||
nir_tex_instr *tex_copy = nir_tex_instr_create(b->shader, tex->num_srcs + 1);
|
||||
tex_copy->op = tex->op;
|
||||
@@ -1214,8 +1214,8 @@ lower_tg4_offsets(nir_builder *b, nir_tex_instr *tex)
|
||||
tex_copy->src[j].src_type = tex->src[j].src_type;
|
||||
}
|
||||
|
||||
nir_ssa_def *offset = nir_imm_ivec2(b, tex->tg4_offsets[i][0],
|
||||
tex->tg4_offsets[i][1]);
|
||||
nir_def *offset = nir_imm_ivec2(b, tex->tg4_offsets[i][0],
|
||||
tex->tg4_offsets[i][1]);
|
||||
nir_tex_src src = nir_tex_src_for_ssa(nir_tex_src_offset, offset);
|
||||
tex_copy->src[tex_copy->num_srcs - 1] = src;
|
||||
|
||||
@@ -1226,7 +1226,7 @@ lower_tg4_offsets(nir_builder *b, nir_tex_instr *tex)
|
||||
|
||||
dest[i] = nir_get_ssa_scalar(&tex_copy->dest.ssa, 3);
|
||||
if (tex->is_sparse) {
|
||||
nir_ssa_def *code = nir_channel(b, &tex_copy->dest.ssa, 4);
|
||||
nir_def *code = nir_channel(b, &tex_copy->dest.ssa, 4);
|
||||
if (residency)
|
||||
residency = nir_sparse_residency_code_and(b, residency, code);
|
||||
else
|
||||
@@ -1235,8 +1235,8 @@ lower_tg4_offsets(nir_builder *b, nir_tex_instr *tex)
|
||||
}
|
||||
dest[4] = nir_get_ssa_scalar(residency, 0);
|
||||
|
||||
nir_ssa_def *res = nir_vec_scalars(b, dest, tex->dest.ssa.num_components);
|
||||
nir_ssa_def_rewrite_uses(&tex->dest.ssa, res);
|
||||
nir_def *res = nir_vec_scalars(b, dest, tex->dest.ssa.num_components);
|
||||
nir_def_rewrite_uses(&tex->dest.ssa, res);
|
||||
nir_instr_remove(&tex->instr);
|
||||
|
||||
return true;
|
||||
@@ -1254,7 +1254,7 @@ nir_lower_txs_lod(nir_builder *b, nir_tex_instr *tex)
|
||||
unsigned dest_size = nir_tex_instr_dest_size(tex);
|
||||
|
||||
b->cursor = nir_before_instr(&tex->instr);
|
||||
nir_ssa_def *lod = nir_ssa_for_src(b, tex->src[lod_idx].src, 1);
|
||||
nir_def *lod = nir_ssa_for_src(b, tex->src[lod_idx].src, 1);
|
||||
|
||||
/* Replace the non-0-LOD in the initial TXS operation by a 0-LOD. */
|
||||
nir_instr_rewrite_src(&tex->instr, &tex->src[lod_idx].src,
|
||||
@@ -1265,15 +1265,15 @@ nir_lower_txs_lod(nir_builder *b, nir_tex_instr *tex)
|
||||
* which should return 0, not 1.
|
||||
*/
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
nir_ssa_def *minified = nir_imin(b, &tex->dest.ssa,
|
||||
nir_imax(b, nir_ushr(b, &tex->dest.ssa, lod),
|
||||
nir_imm_int(b, 1)));
|
||||
nir_def *minified = nir_imin(b, &tex->dest.ssa,
|
||||
nir_imax(b, nir_ushr(b, &tex->dest.ssa, lod),
|
||||
nir_imm_int(b, 1)));
|
||||
|
||||
/* Make sure the component encoding the array size (if any) is not
|
||||
* minified.
|
||||
*/
|
||||
if (tex->is_array) {
|
||||
nir_ssa_def *comp[3];
|
||||
nir_def *comp[3];
|
||||
|
||||
assert(dest_size <= ARRAY_SIZE(comp));
|
||||
for (unsigned i = 0; i < dest_size - 1; i++)
|
||||
@@ -1283,8 +1283,8 @@ nir_lower_txs_lod(nir_builder *b, nir_tex_instr *tex)
|
||||
minified = nir_vec(b, comp, dest_size);
|
||||
}
|
||||
|
||||
nir_ssa_def_rewrite_uses_after(&tex->dest.ssa, minified,
|
||||
minified->parent_instr);
|
||||
nir_def_rewrite_uses_after(&tex->dest.ssa, minified,
|
||||
minified->parent_instr);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1297,13 +1297,13 @@ nir_lower_txs_cube_array(nir_builder *b, nir_tex_instr *tex)
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
assert(tex->dest.ssa.num_components == 3);
|
||||
nir_ssa_def *size = &tex->dest.ssa;
|
||||
nir_def *size = &tex->dest.ssa;
|
||||
size = nir_vec3(b, nir_channel(b, size, 1),
|
||||
nir_channel(b, size, 1),
|
||||
nir_idiv(b, nir_channel(b, size, 2),
|
||||
nir_imm_int(b, 6)));
|
||||
|
||||
nir_ssa_def_rewrite_uses_after(&tex->dest.ssa, size, size->parent_instr);
|
||||
nir_def_rewrite_uses_after(&tex->dest.ssa, size, size->parent_instr);
|
||||
}
|
||||
|
||||
/* Adjust the sample index according to AMD FMASK (fragment mask).
|
||||
@@ -1358,8 +1358,8 @@ nir_lower_ms_txf_to_fragment_fetch(nir_builder *b, nir_tex_instr *tex)
|
||||
int ms_index = nir_tex_instr_src_index(tex, nir_tex_src_ms_index);
|
||||
assert(ms_index >= 0);
|
||||
nir_src sample = tex->src[ms_index].src;
|
||||
nir_ssa_def *new_sample = nir_ubfe(b, &fmask_fetch->dest.ssa,
|
||||
nir_ishl_imm(b, sample.ssa, 2), nir_imm_int(b, 3));
|
||||
nir_def *new_sample = nir_ubfe(b, &fmask_fetch->dest.ssa,
|
||||
nir_ishl_imm(b, sample.ssa, 2), nir_imm_int(b, 3));
|
||||
|
||||
/* Update instruction. */
|
||||
tex->op = nir_texop_fragment_fetch_amd;
|
||||
@@ -1377,7 +1377,7 @@ nir_lower_samples_identical_to_fragment_fetch(nir_builder *b, nir_tex_instr *tex
|
||||
nir_ssa_dest_init(&fmask_fetch->instr, &fmask_fetch->dest, 1, 32);
|
||||
nir_builder_instr_insert(b, &fmask_fetch->instr);
|
||||
|
||||
nir_ssa_def_rewrite_uses(&tex->dest.ssa, nir_ieq_imm(b, &fmask_fetch->dest.ssa, 0));
|
||||
nir_def_rewrite_uses(&tex->dest.ssa, nir_ieq_imm(b, &fmask_fetch->dest.ssa, 0));
|
||||
nir_instr_remove_v(&tex->instr);
|
||||
}
|
||||
|
||||
@@ -1389,28 +1389,28 @@ nir_lower_lod_zero_width(nir_builder *b, nir_tex_instr *tex)
|
||||
|
||||
b->cursor = nir_after_instr(&tex->instr);
|
||||
|
||||
nir_ssa_def *is_zero = nir_imm_true(b);
|
||||
nir_def *is_zero = nir_imm_true(b);
|
||||
for (unsigned i = 0; i < tex->coord_components; i++) {
|
||||
nir_ssa_def *coord = nir_channel(b, tex->src[coord_index].src.ssa, i);
|
||||
nir_def *coord = nir_channel(b, tex->src[coord_index].src.ssa, i);
|
||||
|
||||
/* Compute the sum of the absolute values of derivatives. */
|
||||
nir_ssa_def *dfdx = nir_fddx(b, coord);
|
||||
nir_ssa_def *dfdy = nir_fddy(b, coord);
|
||||
nir_ssa_def *fwidth = nir_fadd(b, nir_fabs(b, dfdx), nir_fabs(b, dfdy));
|
||||
nir_def *dfdx = nir_fddx(b, coord);
|
||||
nir_def *dfdy = nir_fddy(b, coord);
|
||||
nir_def *fwidth = nir_fadd(b, nir_fabs(b, dfdx), nir_fabs(b, dfdy));
|
||||
|
||||
/* Check if the sum is 0. */
|
||||
is_zero = nir_iand(b, is_zero, nir_feq_imm(b, fwidth, 0.0));
|
||||
}
|
||||
|
||||
/* Replace the raw LOD by -FLT_MAX if the sum is 0 for all coordinates. */
|
||||
nir_ssa_def *adjusted_lod =
|
||||
nir_def *adjusted_lod =
|
||||
nir_bcsel(b, is_zero, nir_imm_float(b, -FLT_MAX),
|
||||
nir_channel(b, &tex->dest.ssa, 1));
|
||||
|
||||
nir_ssa_def *def =
|
||||
nir_def *def =
|
||||
nir_vec2(b, nir_channel(b, &tex->dest.ssa, 0), adjusted_lod);
|
||||
|
||||
nir_ssa_def_rewrite_uses_after(&tex->dest.ssa, def, def->parent_instr);
|
||||
nir_def_rewrite_uses_after(&tex->dest.ssa, def, def->parent_instr);
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -1436,7 +1436,7 @@ lower_index_to_offset(nir_builder *b, nir_tex_instr *tex)
|
||||
if ((*index) == 0)
|
||||
continue;
|
||||
|
||||
nir_ssa_def *sum = nir_iadd_imm(b, tex->src[i].src.ssa, *index);
|
||||
nir_def *sum = nir_iadd_imm(b, tex->src[i].src.ssa, *index);
|
||||
nir_instr_rewrite_src(&tex->instr, &tex->src[i].src,
|
||||
nir_src_for_ssa(sum));
|
||||
*index = 0;
|
||||
|
||||
Reference in New Issue
Block a user