nir/large_constants: Eliminate out-of-bounds writes to large constants
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Fri, 21 Aug 2020 13:35:28 +0000 (16:35 +0300)
committerMarge Bot <eric+marge@anholt.net>
Tue, 22 Sep 2020 09:06:52 +0000 (09:06 +0000)
commit0ba82f78a57d352c1042678962e8a386b411322f
tree9071e78fedaefe7d1f3c5b0e7fbbda39feb4483c
parent66669eb5295c207622425d9767422a62e1228407
nir/large_constants: Eliminate out-of-bounds writes to large constants

Out-of-bounds writes could be eliminated per spec:

Section 5.11 (Out-of-Bounds Accesses) of the GLSL 4.60 spec says:

"In the subsections described above for array, vector, matrix and
 structure accesses, any out-of-bounds access produced undefined
 behavior.... Out-of-bounds writes may be discarded or overwrite
 other variables of the active program."

Fixes: 1235850522cd5e7b07701f7065996430ca1514b6
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6428>
src/compiler/nir/nir_opt_large_constants.c