cgc - cg compiler driver cgc [options] file ... cgc is the standalone Cg compiler which translates Cg or GLSL programs into OpenGL or DirectX shader assembly code, or OpenGL or DirectX shading language code.

Basic options
Sets the entry function for the shader to compile. Defaults to "main". Sets the output file to be written. Default outputs to "stdout". Sets the listing file, where error and warning messages are written. Defaults to "stderr". Selects the target profile, specifying the shader language to be generated. Sets one or more profile specific options. Sets check only mode, where no shader is compiled, but all the code in the input file is checked for syntactic correctness.

Language options
Sets the source language to GLSL. Sets the source language to OpneGL/ES GLSL. Enable or disable strict typechecking, where most questionable constructs will be flagged as warnings. Like "-strict" but in addition, unportable GLSL constructs will be flagged as errors. Disable all warnings. Disable one or more specific numbered warnings. Enables or disables FX parsing mode, where FX keywords are recognized. Defaults to on in Cg mode and off in GLSL mode. Disable the standard library.

Code Generation Options
Enable or disable optimizations that may chage/lose precision in low order bits, such as assocative transforms like "(a + b) + c" instead of "a + (b + c)". Default is "-fastmath". Enable or disable optimzations doing operations at lower precision than is specified when the result is later converted to a lower precision or the operands were originally in lower precision. Default is "-nofastprecision". Always do things in the best possible precision; only use lower precision operations if there is no possibility of difference. Implies "-nofastmath" and "-nofastprecision". Control loop unrolling. "-unroll all" will force unrolling of all loops that can be unrolled, while "-unroll none" will prevent unrolling except if code cannot otherwise be generated in the current profiles (so it will have no effect in profiles that don't support looping). "unroll count=N " will unroll loops if the estimate of the resulting code is less than N instructions. The estimate does not take into account further optimizations that may be done after unrolling, so it might be quite inaccurate. Control function inlining. Setting "-inline none" will additionally disable inlining of functions with an explicit "inline" keyword, which are otherwise always inlined. Setting "-inline count=0" will effectively disable inlining of all functions that do not have an explicit "inline" keyword. control if conversion (replacement of small if/else blocks with conditional assignments). Sets the optimization level of the compiler, from 0 (lowest) to 3 (highest). Higher values may produce better code and will cause compile time to increase. Default is "-O1". Assume loops that the compiler cannot determine an upper bound on the number of iterations may loop as many as N iterations. This may require generating extra code for such loops in some profiles. Generate code compatible with the Direct3D specification. break basic blocks after N instructions. This has an effect on local optimizations that don't cross basic block boundaries and may avoid bad compile time blowups in the presence of huge basic blocks due to algorithms that are non-linear in the basic block size. Deprecated. Don't unroll loops with more than N iterations. Use the -unroll option instead, which provides better fine-grained control.

Preprocessor Options
Sets a preprocessor macro. If VALUE is not specified it defaults to 1. Adds a directory to the end of the search path for "#include" files. The default search path is empty. Don't compile, just prepocess the input. With "-E", suppresses the generation of "#line" directives in the output. With "-E", preserves comments in the output. Ignore "#include" files that can't be found, rather than issuing an error. Generate dependency information about "#include"d files. These options are intended to be compatible with the options to "gcc".

Miscellaneous Options
Suppress all 'noise' output (copyright notices, indications of which files are being compiled, etc). With -o and -l, should result in no output being produced. Suppress final code generation. Will actually run all the way through the compiler (so any errors present should be diagnosed), but don't produce any actual output code. Print compiler version information to listing. Print short option help summary to stdout and exit. Print longer option help summary to stdout, including all supported profiles and profile options, and exit. Set an override type binding for a variable. Read override type bindings for variables from a file. Dump type bindings for all variables to a file. This file may be passed back to the compiler with "-typefile".

Debugging options
Enable the "debug" builtin function to abort operation of a shader and immedaitely output a value. Like "-debug", except the shader does not abort; instead it continues and outputs the value of the last "debug" function called. Like "-debug", except if no "debug" call is reached, the output will be set to the specified value instead of what the shader normally computes. Issue errors instead of warnings for any deprecated features used. A profile specifies the output language of the cg compiler (either a shader assembly dialect, or a shading language). Each profile has its own set of profile options that can be set for it, though many related profiles have similar or identical options. Profiles can be grouped by program type, API, or GPU generation. ds_5_0, gs_4_0, gs_5_0, hlslf, hlslv, hs_5_0, ps_1_1, ps_1_2, ps_1_3, ps_2_0, ps_2_x, ps_3_0, ps_4_0, ps_5_0, vs_1_1, vs_2_0, vs_2_x, vs_3_0, vs_4_0, vs_5_0 arbfp1, arbvp1, fp20, fp30, "fp30unlimited", fp40, "fp40unlimited", glslf, glslg, glslv, gp4fp, gp4gp, gp4vp, gp5fp, gp5gp, gp5tcp, gp5tep, gp5vp, vp20, vp30, vp40 arbfp1, fp20, fp30, "fp30unlimited", fp40, "fp40unlimited", glslf, gp4fp, gp5fp, hlslf, ps_1_1, ps_1_2, ps_1_3, ps_2_0, ps_2_x, ps_3_0, ps_4_0, ps_5_0 glslg, gp4gp, gp5gp, gs_4_0, gs_5_0 arbvp1, glslv, gp4vp, gp5vp, hlslv, vp20, vp30, vp40, vs_1_1, vs_2_0, vs_2_x, vs_3_0, vs_4_0, vs_5_0 fp20, vp20 fp30, vp30 fp40, vp40 gp4fp, gp4gp, gp4vp gp5fp, gp5gp, gp5tcp, gp5tep, gp5vp

Profile options
Here is a complete list of all profiles and their corresponding profile options Targets the ARB_fragment_program OpenGL extension Use the ARB_draw_buffers option for multiple renderbuffer targets (MRT). This is the default Use the ATI_draw_buffers option for multiple renderbuffer targets (MRT). Set the maximum number of renderbuffer targets. Default is 1 Set the maximum number of uniform parameter slots available. Default is 32 Sets the maximum number of texture indirections allowed in the output program. Default is 1024 Sets the maximum number of instructions in the output program. Default is 1024 Sets the maximum number of non-texture instructions in the output program. Default is 1024 Sets the maximum number of TEMP registers in the output program. Default is 32 Sets the maximum number of texture instructions in the output program. Default is 1024 Targets the ARB_vertex_program OpenGL extension Sets the maximum number of ADDRESS registers in the output program. Default is 1 Sets the maximum number of instructions in the output program. Default is 1024 Set the maximum number of uniform parameter slots available. Default is 96 Sets the maximum number of TEMP registers in the output program. Default is 32 Generate position invariant code (same as fixed-function) for POSITION output Targets the NV_register_combiners2 and NV_texture_shader OpenGL extensions Targets the NV_fragment_program OpenGL extension Sets the maximum number of instructions in the output program. Default is 256 Sets the maximum number of temporaries in the output program. Default is 32 Same as fp30 with various hardware limits on registers and instructions lifted Sets the maximum number of instructions in the output program. Default is 4194304 Sets the maximum number of temporaries in the output program. Default is 512 Targets the NV_fragment_program2 OpenGL extension Work around various bugs with KIL instructions in the OSX-tiger implementation of NV_fragment_program2 Use the ARB_draw_buffers option for multiple renderbuffer targets (MRT). This is the default Use the ATI_draw_buffers option for multiple renderbuffer targets (MRT). Set the maximum number of uniform parameter slots available. Default is infinite Sets the maximum number of instructions in the output program. Default is infinite Sets the maximum number of TEMP registers in the output program. Default is infinite If N is 3 or 4, force output to fp16 precision. If N is 2, force output to fp32 precision. Same as fp40 with various hardware limits on registers and instructions lifted Work around various bugs with KIL instructions in the OSX-tiger implementation of NV_fragment_program2 Use the ARB_draw_buffers option for multiple renderbuffer targets (MRT). This is the default Use the ATI_draw_buffers option for multiple renderbuffer targets (MRT). Set the maximum number of uniform parameter slots available. Default is 1024 Sets the maximum number of instructions in the output program. Default is 4194304 Sets the maximum number of TEMP registers in the output program. Default is 512 If N is 3 or 4, force output to fp16 precision. If N is 2, force output to fp32 precision. Produces a dump of the program in a non-executable format Targets the OpenGL Shading language (GLSL) v1.10. glslf targets fragment programs while glslv targets vertex programs GLSL version to target. Supported versions are 100, 110, 120, 130, 140 and 150. Use user-defined varying instead of gl_TexCoord. Use ATI_draw_buffers extension for MRT. Use EXT_gpu_shader4 extension where useful. Targets the NV_gpu_program4 and NV_fragment_program4 OpenGL extensions. Assume integer multiply inputs have at most 24 significant bits. Use the NV_shader_buffer_load OpenGL extension. Use the NV_parameter_buffer_object2 OpenGL extension. Use the NV_parameter_buffer_object2 OpenGL extension. Use the ARB_draw_buffers option for multiple renderbuffer targets (MRT). This is the default Use the ATI_draw_buffers option for multiple renderbuffer targets (MRT). Use integer pixel centers. Use upper left pixel origin. Targets the NV_gpu_program4 and NV_geometry_program4 OpenGL extensions. Set the input primitive type for the geometry program Set the output primitive type for the geometry program Set the number of vertices output by the geometry program Targets the NV_gpu_program4 and NV_vertex_program4 OpenGL extensions. Generate position invariant code (same as fixed-function) for POSITION output Targets the NV_gpu_program5 OpenGL extension. Assume integer multiply inputs have at most 24 significant bits. Use the NV_shader_buffer_load OpenGL extension. Use the NV_parameter_buffer_object2 OpenGL extension. Use the NV_parameter_buffer_object2 OpenGL extension. Use the ARB_draw_buffers option for multiple renderbuffer targets (MRT). This is the default Use the ATI_draw_buffers option for multiple renderbuffer targets (MRT). Use the ARB_fragment_coord_conventions OpenGL extension to specify integer pixel centers. Use the ARB_fragment_coord_conventions OpenGL extension to specify upper left pixel origin. Perform depth and stencil tests prior to fragment program invocation. Targets the NV_gpu_program5 OpenGL extension. Set the input primitive type for the geometry program Set the output primitive type for the geometry program Set the number of vertices output by the geometry program Targets the NV_tessellation_program and NV_gpu_program5 OpenGL extensions. Targets the NV_tessellation_program and NV_gpu_program5 OpenGL extensions. Targets the NV_gpu_program5 OpenGL extension. Generate position invariant code (same as fixed-function) for POSITION output Targets Microsoft High-Level Shading Language (HLSL). hlslf targets pixel programs while hlslv targets vertex programs Targets DirectX pixel programs Maximum absolute value representable in a pixel shader. Default is 1. Targets DirectX pixel programs Set the maximum number of renderbuffer targets. Default is 1 Sets the maximum number of instructions in the output program. Default is 96 or 512 Sets the maximum number of temporaries in the output program. Default is 12 or 32 Targets DirectX pixel programs Set the maximum number of renderbuffer targets. Default is 1 Set the maximum number of uniform parameter slots available. Default is 224 Sets the maximum number of instructions in the output program. Default is 32768 Sets the maximum number of temporaries in the output program. Default is 32 If N is 3 or 4, force output to fp16 precision. If N is 2, force output to fp32 precision. Targets the NV_vertex_program OpenGL extension Set the maximum number of uniform parameter slots available. Default is 96 Generate position invariant code (same as fixed-function) for POSITION output Targets the NV_vertex_program2 OpenGL extension Set the maximum number of uniform parameter slots available. Default is 256 Generate position invariant code (same as fixed-function) for POSITION output Targets the NV_vertex_program3 OpenGL extension Sets the maximum number of ADDRESS registers in the output program. Default is 2 Sets the maximum number of instructions in the output program. Default is 2048 Set the maximum number of uniform parameter slots available. Default is 544 Sets the maximum number of TEMP registers in the output program. Default is 32 Generate position invariant code (same as fixed-function) for POSITION output Targets DirectX vertex programs Output dx9-style dcls statements Set the maximum number of uniform parameter slots available. Default is 96 Sets the maximum number of instructions in the output program. Default is 128 Sets the maximum number of temporaries in the output program. Default is 12 Targets DirectX vertex programs Output dx9-style dcls statements Set the maximum number of uniform parameter slots available. Default is 256 Sets the maximum number of instructions in the output program. Default is 256 Sets the maximum number of temporaries in the output program. Default is 12 Targets DirectX vertex programs Output dx9-style dcls statements Set the maximum number of uniform parameter slots available. Default is 256 Sets the maximum number of instructions in the output program. Default is 32768 Sets the maximum number of temporaries in the output program. Default is 32 Cg_language, arbfp1, arbvp1, fp20, fp30, fp40, glslf, glslv, gp4fp, gp4gp, gp4vp, hlslf, hlslv, vp20, vp30, vp40