pan/bi: clean up tex coord lowering
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28899>
This commit is contained in:
committed by
Marge Bot
parent
3139f8f623
commit
f153f945fc
@@ -3573,10 +3573,11 @@ bi_emit_tex_valhall(bi_builder *b, nir_tex_instr *instr)
|
||||
for (unsigned i = 0; i < instr->num_srcs; ++i) {
|
||||
bi_index index = bi_src_index(&instr->src[i].src);
|
||||
unsigned sz = nir_src_bit_size(instr->src[i].src);
|
||||
unsigned components = nir_src_num_components(instr->src[i].src);
|
||||
|
||||
switch (instr->src[i].src_type) {
|
||||
case nir_tex_src_coord:
|
||||
case nir_tex_src_coord: {
|
||||
unsigned components = nir_src_num_components(instr->src[i].src) - instr->is_array;
|
||||
|
||||
if (instr->sampler_dim == GLSL_SAMPLER_DIM_CUBE) {
|
||||
sregs[VALHALL_TEX_SREG_X_COORD] = bi_emit_texc_cube_coord(
|
||||
b, index, &sregs[VALHALL_TEX_SREG_Y_COORD]);
|
||||
@@ -3586,20 +3587,20 @@ bi_emit_tex_valhall(bi_builder *b, nir_tex_instr *instr)
|
||||
/* Copy XY (for 2D+) or XX (for 1D) */
|
||||
sregs[VALHALL_TEX_SREG_X_COORD] = index;
|
||||
|
||||
if ((components == 2 && !instr->is_array) || components > 2)
|
||||
if (components >= 2)
|
||||
sregs[VALHALL_TEX_SREG_Y_COORD] = bi_extract(b, index, 1);
|
||||
|
||||
if (components == 3 && !instr->is_array) {
|
||||
if (components == 3)
|
||||
sregs[VALHALL_TEX_SREG_Z_COORD] = bi_extract(b, index, 2);
|
||||
}
|
||||
}
|
||||
|
||||
if (instr->is_array) {
|
||||
sregs[VALHALL_TEX_SREG_ARRAY] =
|
||||
bi_extract(b, index, components - 1);
|
||||
bi_extract(b, index, components);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case nir_tex_src_lod:
|
||||
if (nir_src_is_const(instr->src[i].src) &&
|
||||
|
||||
Reference in New Issue
Block a user