I get this seemingly at random after a edit of a shader file. The shader would have been working perfectly fine (and works fine still in another program), yet, change a number and Bam, error in similar vein to this one.
Often the only solution is to re-write that particular section exactly the same as it was. Just... re-written... Again.
I don't know my way around Mame very well. So i can't really fix it myself (And I'm not skilled enough), but I did turn up this Stack link if someone would like to have a look; HERE That seems to be what I'm seeing in the Mame source, but no idea how to go about fixing it.