View Full Version : Looking for GLSL command line compiler. Please help.

Ray Adams
01-29-2005, 06:36 AM
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.

01-29-2005, 09:15 AM
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.

01-29-2005, 09:17 AM
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.

01-29-2005, 03:14 PM
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.

Matt Zamborsky
01-29-2005, 08:57 PM
But NVIDIA Cg compiler compiles the code for GeForce cards. And itsn't optimized for ATI hardware.

Ray Adams
01-30-2005, 04:38 AM
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
It seems that out file is for D3D rendering system.
I will try to use it

Ray Adams
01-30-2005, 04:41 AM
Ohh, just found , I have to use arbvp1 and arbfp1!
Now everything is ok.

01-30-2005, 02:16 PM
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.

Ray Adams
01-30-2005, 08:25 PM
Which one?