PDA

View Full Version : Testing shaders



Baughn
08-11-2010, 02:13 PM
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.

BionicBytes
08-12-2010, 01:10 AM
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.

Baughn
08-12-2010, 03:00 AM
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.

hound
08-12-2010, 04:46 AM
Sort of thread crashing, but does NVidia have a tool like ShaderAnalyzer?

randall
08-12-2010, 06:20 AM
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.

Dark Photon
08-12-2010, 08:54 AM
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

hound
08-12-2010, 10:59 AM
Thanks! That's really useful. (I didn't know the cg compiler could do glsl too).