Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Shading Language Compiler Quality

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2005

    Shading Language Compiler Quality

    [edit - oops, this is be in glsl forum - sorry!]

    Just having a play around with gl shading language, and noticed that the compiler seems to optimize out dead uniforms OK, but not always dead attributes.

    Example vertex shader:
    Code :
    attribute vec3 dummy;
    void main(){
       vec3 t=dummy;
       gl_Position=gl_ModelViewProjectionMatrix * gl_Vertex;  
    GL reports 2 active attributes (gl_Vertex and dummy) and 1 active uniform (gl_ModelViewProjectionMatrix). However, the 'dummy' attribute is dead so should really have been stripped.

    If I change dummy to a uniform it is successfully stripped. Also, if I leave it as an attribute and remove the 't=dummy' assignment.

    I am currently doing this sort of dead code analysis on GL ASM code very successfully. I was hoping I could move to high level code and get it done for me, but this kind of inconsistency makes me nervous!

  2. #2
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001

    Re: Shading Language Compiler Quality

    Yep, it should be done by the compiler. Only speaks for low-quality implementation. What card and driver is it?

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2005

    Re: Shading Language Compiler Quality

    What card and driver is it?
    GeForce 6600 with ForceWare 91.31 (I assume this is 'driver version' - it's recent anyway).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts