Created attachment 119059 [details] Patch that avoid the problem Software versions: 4.2.0-1-generic OpenGL version string: 3.0 Mesa 11.1.0-devel (git-13a5805) GPU hardware: OpenGL renderer string: Mesa DRI Intel(R) Haswell Desktop 00:02.0 VGA compatible controller [0300]: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller [8086:0412] (rev 06) CPU hardware: x86_64 Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz CTS version: git@67ae88f31295 command: ./glcts --deqp-case=ES31-CTS.arrays_of_arrays.InteractionFunctionCalls2 Environment: Mesa built with: --enable-debug export MESA_GLES_VERSION_OVERRIDE=3.1 export MESA_EXTENSION_OVERRIDE=GL_ARB_compute_shader ------------------------------------------------------ When running the InteractionFunctionCalls2 OpenGL ES 3.1 CTS test, I hit below assert: glcts: nir/nir_lower_vars_to_ssa.c:462: lower_copies_to_load_store: Assertion `arg_entry' failed. Aborted (core dumped) With attached patch the issue is avoided and all the Arrays of arrays tests pass. The problem is that we get duplicated set and keys, which are then deleted from the table, so on the second time in the loop we hit the assert. The patch just removes the duplication, but the real fix would avoid the duplication in the first place.
It looks like the problem is with the get_deref_node() function, arrays of arrays support looks to be missing here and so its returning the same deref_node for two different AoA vars.
Ignore my last comment the AoA support in that function looks fine. There is an issue well before getting to this code. In assignment visitor in the glsl to nir pass nir_visitor::visit(ir_assignment *ir) the rhs and lhs side reference the same variable.
Ok so this isn't a problem just with arrays of arrays its a problem with 1D arrays too. I've send a minimal piglit test [1] that triggers the assert, the problem I believe is a missed opportunity to optimise out a redundant assignment and so nir ends up with a scenario it wasn't expecting. It shouldn't be to hard to fix once I figure out where in the code we would normally optimise this out. [1] https://patchwork.freedesktop.org/patch/63355/
Mesa patch : https://patchwork.freedesktop.org/patch/63372/
I confirm that the patch fixes the problem.
Just pushed a fix. Turns out it was a bug in nir_lower_vars_to_ssa where it couldn't handle a copy_var from a deref to the same deref. It's a silly thing to have in a shader but certainly not illegal. Thanks, Timothy, for pointing me at it!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.