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 2 of 2

Thread: Can uniform blocks get removed by GLSL compiler?

  1. #1
    Member Regular Contributor
    Join Date
    Jan 2012

    Question Can uniform blocks get removed by GLSL compiler?


    is it legal for the GLSL compiler to optimze away a whole uniform block (layout std140 !) given that _no_ uniform from it is used? I know, that the layout itself is well defined by the specs and a single uniform in it can not get 'optimized away' (that's what layout packed is for). However, if none of the uniforms are used / no uniform is active, can the uniform block become inactive?

    This seems to happen on MacOS X, but on the other hand, the uniform buffer implementation there (and OpenGL/GLSL in general) is quite buggy (I filed 2 bugreports today alone..) so I woudn't be surprised if that behavior is not ok. But couldn't find a definitive clue in the specs.

    Any idea?

  2. #2
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Search for "active" in the spec:

    "Like uniforms, uniform blocks can be active or inactive. Active uniform blocks are those that containactive uniforms after a program has been compiled and linked. "

Posting Permissions

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