GLSLC Shader Program Compiler

This section describes glslc, a compiler for OpenGL ES 3.0-style program binaries. This compiler runs on the Linux host system to produce program binaries that can be transferred to the target NVIDIA® Tegra® device.

Note:

Program binaries produced with glslc from a particular NVIDIA DRIVE SDKcan only be used with the OpenGL ES 3.0 driver from the same NVIDIA DRIVE SDK. Shader sources must be recompiled to generate new program binaries whenever a new SDKis installed.

To compile a shader program

  • Generate a program binary <output_file> from vertex and fragment shader source files <vertex_shader_file> and <fragment_shader_file> with the following command (on the host system):
glslc -gles -chip 10 -binary <output_file>  -vs <vertex_shader_file> -fs <fragment_shader_file>

Shader sources must not contain #include directives. If glslc is successful, it produces a non-zero sized binary named <output file>.

Note:

For complete information about additional shader types and supported options for glslc, run the following command:

glslc --help