While looking into transform feedback to simulate particles on the GPU, I encountered a weird problem:
My code (loading a vertex shader, setting transform feedback varyings, linking it all and simulating my particles) works just fine on Intel’s integrated GPUs (4 out of 4 tested), as well as AMDs dedicated cards (2 out of 2), but not on ANY of the 6 NVidia GPUs I tested it on.
On those cards, it seems to mangle up the strings I give to glTransformFeedbackVaryings, and either reports back that “Duplicate varying names are not allowed.”, or it complains that it cannot find a specific name, giving me back what it was looking for, which usually is a short nonsensical string (often including punctuation and other symbols not even allowed in identifiers).
Given the numbers above, I am pretty sure this is a problem with NVidia cards only, and that my code is most likely correct (of course I am very much open to correction here!).
For reference, I am working in C#, using OpenTK. But again, given that it works for non NVidia-cards, I don’t think that should be a problem.
I extracted the relevant code (including my original vertex shader, since, if I shorten it a lot (take out varyings), it sometimes DOES work, but I have not figured out any pattern there, and in fact it seems slightly random), and put it up here:
If anybody would like me to upload a complete C# solution, or an executable, let me know!
Lastly, for completeness, here is the output the above program gives me (for one working, and one not working card):
I hope someone has an idea what is wrong here, and how to fix it.
Of course I would be happy yo supply more data, if useful.
Thanks in advance to anyone taking the time to read and respond!