nir: Don't assert on tg4 offset range.
authorEmma Anholt <emma@anholt.net>
Sat, 30 Apr 2022 14:40:59 +0000 (07:40 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 3 May 2022 21:45:49 +0000 (21:45 +0000)
commit695587413b261dc1a8d8e17ee466dd3ba137905a
treebf293350b9ab803f12b69eb083be5ccabe17e018
parent70f53600377d0b9444618b54c779f5f98e1d56d6
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>
src/compiler/glsl/glsl_to_nir.cpp
src/gallium/drivers/nouveau/ci/nouveau-gm206-fails.txt