freedreno/ir3: Drop the max_const on a6xx to 512.
authorEric Anholt <eric@anholt.net>
Fri, 29 May 2020 23:35:43 +0000 (16:35 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 5 Jun 2020 20:36:29 +0000 (13:36 -0700)
commite349f502792e927a1acdeaf00e591878bd18c837
treed43fabfb13c189460ea22dec2817930d2da6f909
parent486b89430795cf12c0fe027fa070b75262337a18
freedreno/ir3: Drop the max_const on a6xx to 512.

The GLES blob on the p3a limits constlen to 512 between VS and FS across
a6xx gpu ids (615, 630, 640, and 650).  Experimentally, exceeding that
limit in any one stage results in rendering corruption or GPU hangs
(though my most detailed testing had a loop limit in a uniform, so that
may the cause of the hang).  Clamp the limit we use inside of a shader so
we don't exceed it within a stage.

This commit doesn't resovle limiting inter-stage.  Experimentally, I've
found that I can push up to a total of ~768 vec4s between VS and FS on
a630, with or without uniform updates between each draw.  We'll need to do
some shader key-based limiting of constlen at draw time to respect that
limit, but that's left for future work, and this commit is enough for the
google earth case that initiated this work.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5273>
src/freedreno/ir3/ir3_compiler.c