vc4: store tex sampler in proper register

When unpacking the texture sample result ensure it is moved to the
proper expected dest register.

This fixes incorrect texturing in Chromium using PixiJS framework.

CC: mesa-stable
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18122>
This commit is contained in:
Juan A. Suarez Romero
2022-08-18 10:03:39 +02:00
committed by Marge Bot
parent 177f7fae01
commit 4ba21c3e8c
2 changed files with 4 additions and 25 deletions

View File

@@ -1139,11 +1139,7 @@ spec@glsl-1.10@execution@built-in-functions@vs-tan-float,Fail
spec@glsl-1.10@execution@built-in-functions@vs-tan-vec2,Fail
spec@glsl-1.10@execution@built-in-functions@vs-tan-vec3,Fail
spec@glsl-1.10@execution@built-in-functions@vs-tan-vec4,Fail
spec@glsl-1.10@execution@fs-texture-select,Fail
spec@glsl-1.10@execution@glsl-fs-convolution-2,Fail
spec@glsl-1.10@execution@samplers@glsl-fs-sampler-numbering-2,Fail
spec@glsl-1.10@execution@samplers@glsl-fs-sampler-numbering-3,Fail
spec@glsl-1.10@execution@samplers@in-parameter-array,Fail
spec@glsl-1.20@built-in constants,Fail
spec@glsl-1.20@built-in constants@gl_MaxVertexAttribs,Fail
spec@glsl-1.20@execution@fs-nan-builtin-max,Fail

View File

@@ -246,24 +246,6 @@ ntq_store_dest(struct vc4_compile *c, nir_dest *dest, int chan,
}
}
static struct qreg *
ntq_get_dest(struct vc4_compile *c, nir_dest *dest)
{
if (dest->is_ssa) {
struct qreg *qregs = ntq_init_ssa_def(c, &dest->ssa);
for (int i = 0; i < dest->ssa.num_components; i++)
qregs[i] = c->undef;
return qregs;
} else {
nir_register *reg = dest->reg.reg;
assert(dest->reg.base_offset == 0);
assert(reg->num_array_elems == 0);
struct hash_entry *entry =
_mesa_hash_table_search(c->def_ht, reg);
return entry->data;
}
}
static struct qreg
ntq_get_src(struct vc4_compile *c, nir_src src, int i)
{
@@ -523,7 +505,6 @@ ntq_emit_tex(struct vc4_compile *c, nir_tex_instr *instr)
enum pipe_format format = c->key->tex[unit].format;
struct qreg *dest = ntq_get_dest(c, &instr->dest);
if (util_format_is_depth_or_stencil(format)) {
struct qreg normalized = ntq_scale_depth_texture(c, tex);
struct qreg depth_output;
@@ -577,10 +558,12 @@ ntq_emit_tex(struct vc4_compile *c, nir_tex_instr *instr)
}
for (int i = 0; i < 4; i++)
dest[i] = depth_output;
ntq_store_dest(c, &instr->dest, i,
qir_MOV(c, depth_output));
} else {
for (int i = 0; i < 4; i++)
dest[i] = qir_UNPACK_8_F(c, tex, i);
ntq_store_dest(c, &instr->dest, i,
qir_UNPACK_8_F(c, tex, i));
}
}