Looking for GLSL command line compiler. Please help

Hi.
I’m kooking for GLSL command line compiler which can compile my shaders on GLSL languages. With options to make or not to make optimization and so on.
I’ve tried to compile OpenGL Compiler form 3DLabs but with no succes.

Hello, There isn’t any GLSL compiler outside the ones those comes with the gfx drivers, because GLSL ‘is directly converted’ (or ar least, should be directly converted) to specific machine microcodes. You can’t compile a GLSL shader to a ‘generic’ object code file, the best case is convert it to ARB_fp with the NV compiler.
The 3DLabs command line parser/compiler ‘only’ validate the shader, showing errors related with the language syntaxis and grammar, and builds an intermediate tree, useful for those people that wants transverse it to produce real microcode for a real GL driver.

Check out NVidia’s shaderperf tool. I believe it gives you a full dump of the compiled shader, though I’m not sure how many optimization options it has.

Nvidia’s Cg compiler can compile GLSL code via the -oglsl command line switch, and you can use -strict to turn off Nvidia’s ‘extended’ GLSL features.

But NVIDIA Cg compiler compiles the code for GeForce cards. And itsn’t optimized for ATI hardware.

Just tried CGC.EXE with -oglsl and -profile ps_2_0 for fragment program and -profile vs_2_0 for vertex.
Hmm, in the out put file no headers like
!!ARBvp1.0
!!ARBfp1.0
It seems that out file is for D3D rendering system.
I will try to use it

Ohh, just found , I have to use arbvp1 and arbfp1!
Now everything is ok.

Originally posted by Matt Zamborsky:
But NVIDIA Cg compiler compiles the code for GeForce cards. And itsn’t optimized for ATI hardware.
You can turn off Nvidia optimization with another switch.

Which one?

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