From 695587413b261dc1a8d8e17ee466dd3ba137905a Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Sat, 30 Apr 2022 07:40:59 -0700 Subject: [PATCH] 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 Part-of: --- src/compiler/glsl/glsl_to_nir.cpp | 1 - src/gallium/drivers/nouveau/ci/nouveau-gm206-fails.txt | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp index 47e9b0d..4113615 100644 --- a/src/compiler/glsl/glsl_to_nir.cpp +++ b/src/compiler/glsl/glsl_to_nir.cpp @@ -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; } } diff --git a/src/gallium/drivers/nouveau/ci/nouveau-gm206-fails.txt b/src/gallium/drivers/nouveau/ci/nouveau-gm206-fails.txt index 79bc66e..7457cf6 100644 --- a/src/gallium/drivers/nouveau/ci/nouveau-gm206-fails.txt +++ b/src/gallium/drivers/nouveau/ci/nouveau-gm206-fails.txt @@ -86,9 +86,6 @@ KHR-GL43.shader_ballot_tests.ShaderBallotBitmasks,Fail KHR-GL43.shader_ballot_tests.ShaderBallotFunctionBallot,Fail KHR-GL43.shader_ballot_tests.ShaderBallotFunctionRead,Fail -# "../src/compiler/glsl/glsl_to_nir.cpp:2539: virtual void {anonymous}::nir_visitor::visit(ir_texture*): Assertion `val <= 31 && val >= -32' failed." -shaders@glsl-bug-110796,Crash - shaders@glsl-uniform-interstage-limits@subdivide 5- statechanges,Fail shaders@point-vertex-id gl_vertexid,Fail shaders@point-vertex-id gl_vertexid divisor,Fail -- 2.7.4