PDA

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



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

Ffelagund
01-29-2005, 10: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.

gmeed
01-29-2005, 10: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.

fenris
01-29-2005, 04: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, 09:57 PM
But NVIDIA Cg compiler compiles the code for GeForce cards. And itsn't optimized for ATI hardware.

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

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

V-man
01-30-2005, 03: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, 09:25 PM
Which one?