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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user