So I have a set of shaders (vertex and fragment) that have worked (on both Nvidia and ATI) for a couple years that now produce the following compiler error with the Nvidia 162.65 driver (same card/machine it work on before, just a new driver)…
(2) : warning C7050: “color-0171.w” might be used before being initialized
Internal error: assembly compile error for fragment shader at offset 15254:
– error message –
line 327, column 13: error: variable not valid as a source register
Anyone seen this before with this driver?
It looks as though it thinks I am using an uninitialized variable but that is not the case as far as I can tell by looking at my code.
So after an hour or so of just commenting out lines and recompiling I narrowed down the line of code causing the error:
float x = gl_FragColor.r;
What gives? That has to be a bug no? Why is gl_FragColor.r not a valid source register? The funny thing is, if I comment out that line my shader runs even though the very next line is:
Nope, changing the variable name does not help. I tried that one. Keep in mind, this shader works on the same card with a different driver. It also works on other cards with the same driver… it has to be a bug.