"nvidia 396 GL_INVALID_OPERATION error generated" when compiling 1024 vertex shaders

Hi, I am experiencing an issue with nvidia-396 using GTX 1070 on Arch Linux with latest updates (although the problem occurs with Ubuntu 18.04 and other graphics cards too). When I try to run an application (a game, The Sims 2, through modified wine version that ups vertex shaders limits to 1024, see here https://bugs.winehq.org/show_bug.cgi?id=8051#c161), it fails with an error:

C6020: Constant register limit exceeded at pos_fixup; more than 1024 registers needed to compile program

and

nvidia 396 GL_INVALID_OPERATION error generated.

the latter being printed again and again. This error results in an application not displaying anything in its window, it’s just filled with a blue color, although the application itself seems to react to pressing buttons where they should be and plays music.
It used to work perfectly fine under nvidia-390 driver version, so I assume this is a regression. Would be nice to see this get fixed.

Setting __GL_NextGenCompiler=0 doesn’t help.