nir: Don't assert on tg4 offset range.

From the GL 4.6 spec: "If the value of any non-ignored component of the
offset vector operand is outside implementation-dependent limits, the
results of the texture lookup are undefined."  We shouldn't assertion
fail, then.

GLSL-to-NIR shouldn't be enforcing limits on TG4 offsets, since it doesn't
for non-TG4 tex_src_offset either.  Leave it up to the driver to handle
it.

Fixes a crash in a piglit test on nouveau that supplies a negative random
number up to 10,000 as the first coordinate for some reason.  Other NIR
drivers lowered TG4 explicit offsets to tex_src_offset, so they weren't
affected.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16261>
This commit is contained in:
Emma Anholt
2022-04-30 07:40:59 -07:00
committed by Marge Bot
parent 70f5360037
commit 695587413b
2 changed files with 0 additions and 4 deletions

View File

@@ -2536,7 +2536,6 @@ nir_visitor::visit(ir_texture *ir)
for (unsigned j = 0; j < 2; ++j) {
int val = c->get_int_component(j);
assert(val <= 31 && val >= -32);
instr->tg4_offsets[i][j] = val;
}
}