Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 18

Thread: Forward Declaration of Scoped Variables (Uniform Buffer Objects)

Threaded View

  1. #1
    Junior Member Newbie Kastenfrosch2's Avatar
    Join Date
    May 2012
    Location
    Gemrany
    Posts
    15

    Forward Declaration of Scoped Variables (Uniform Buffer Objects)

    I attach two vertex-shaders to my Program Object

    Vertex Shader1:
    Code :
    uniform BlockName{
      int varName;
    } scopeName;
     
    // ...

    in Vertex Shader2, i want to use varName. So i forward declarate it.
    Code :
    uniform int scopeName.varName; // Compile Error: unexpected syntax Error at "."

    Edit:
    Makes sense, because the compiler doesn't know about scopeName when compiling Shader2.
    But how can i use the scoped uniforms in my second Shader? Can i forward declarate or redeclarate the Scope or the Uniform Buffer?

    I didn't find anything about it in the Uniform_Buffer_Object specification.
    (I use a GeForxe GTX 560 with Driver 296.10)
    Last edited by Kastenfrosch2; 05-18-2012 at 02:34 AM.

Posting Permissions

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