OpenGL(R) Shading Language Meta Compiler


  1. About
  2. Intoduction
  3. Roadmap
  4. Translation table draft
  5. Copyright and licenceing details
  6. Website Details and Contact

About the OpenGL(R) Shading Language Meta Compiler

The task of the OpenGL(R) Shading Language Meta Compiler is to compile GL Shading Language sourcecode to a implementation specific code. Currently the development focuses on the ARB_vertex_program and the ARB_fragment_program extensions to OpenGL.

Introduction

As GPUs are evolving more and more featues are added, and the development shows the same pattern that we now already from the CPU development. After the development of programmable GPUs, these were only programmable using a assembler.

To ease up programming soon a few high level languages were developed. Most known are Cg, DirectX HLSL and the RenderMan shader language. With the progress in the development of OpenGL and it's next version 2, the need of a vendor independent programming interface for GPUs has led to the development of the OpenGL Shading Language or short glslang.

While the first drafts, describing most features were avaliable since late 2002, driver implementors introduce glslang only slowly, and in very erarly releases since December 2003, when ATI released their Catalyst 3.10 drivers. Although 3D Labs is supporting glslang for a longer time with their Wildcat Chip series, most consumer chips lack a sane support of glslang.

The goal of this project is to provide a compiler for glslang utilizing the avaliable capabilities of current OpenGL to enable the use of glslang shader programs. Additionally driver developers are encouraged to use the provided source as a source for their own developments.

Development Roadmap

Task
mid februaray 2004development of a translation table for the ARB extensions
april 2004first compiler implementation
july 2004adding limited flow control structure support
september 2004loop unroller optimization

The dates are not strict, they're just a guess, of when I should be able to start a certain task, under the circumstance, that I can work the same time on it, as currently.

Translation table draft for the ARB extensions

The development process is done from the view of the already avaliable programming interfaces. These are the ARB_vertex_program and the ARB_fragment_program extensions. Maybe I'll also consider to implement support for NV_vertex_program_2, since it would enable more features of glslang to be used in the vertex part.

Currently not avaliable through the given programming interface if arbitrary flow control. Only the KIL instruction of the fragment processor allows limited flow control. Already considerd, but nut planned it loop unrolling.

The planning of the compiler starts from these tables, draftig a translation of the ASM commands to the glslang pendants. At the moment I'm developing these tables. The table for the ARB_fragment_program shows a possible representation of the KIL instruction in glslang.

ARB_vertex_program to glslang translation
ASM Instructionglslang construct

ARB_fragment_program to glslang translation
ASM Instructionglslang construct
KIL identifier
if( identifier.x < 0 ||
    identifier.y < 0 ||
    identifier.z < 0 ||
    identifier.w < 0 )
{
    discard;
}

Copyright and licenceing details

The OpenGL Shading Language Meta Compiler will be licenced in either the LGPL and/or the BSD licence. Details about this to come.

The generic glslang compiler used as a working base for this project is copyrighted by 3DLabs.

OpenGL(R) is a registered trademark of SGI. Cg(R) is a registered trademark of nVidia. DirectX is a registered trademark of Mircosoft. Any other trademarks in the documents of this project are protected by the owners.

Website Details and Contact

This website is only a filler, to stay, until the first release of the GLSLMC.

Contact:

TaskNameeMail
Main Developer, WebmasterWolfgang Draxingerdatenwolf 'a t' users.sourceforge.net

Hosted by:
SourceForge.net Logo