Testing shaders

When writing shaders, I often find that what works on one card does not work on another. Specifically, since I’m using nvidia everywhere, users with ATI usually end up suffering.

The obvious budget-dependent solution to that is to buy a machine just to put an ATI card in. However, the errors are usually syntax errors of various kinds; once those are fixed, it tends to run well enough. So, I’m wondering:

  • Since I don’t actually need to run them (I should, but I don’t have to), it should be possible for ATI to create a standalone program that just test-compiles shaders. I can’t find anything like that. Do you know?

  • Lacking that, is there a service somewhere that would let me test-compile shaders on a variety of hardware?

  • Lacking that, would someone be interested in helping me make one? I can do the programming, if you have a server with an ATI card sitting around to deal with that half of the equation.

AMD do just that - they provide a great tool called GPUShaderAnalyser which does a great job of compiling your shaders and shows you various compilation results for different h/w. It’s a free down load from their site.

Oh, well.

I did find that one, but I should probably mention - it needs to work in Linux. I don’t have a Windows license anywhere.

Sort of thread crashing, but does NVidia have a tool like ShaderAnalyzer?

nvidia has cg compiler. You can use it to compile GLSL code to see if everything is ok. This is the same compiler they use in the driver.

Right. Try these command lines:


cgc -oglsl -strict -glslWerror -nocode -profile gpu_vp vert.glsl
cgc -oglsl -strict -glslWerror -nocode -profile gpu_fp frag.glsl

Thanks! That’s really useful. (I didn’t know the cg compiler could do glsl too).

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.