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

Thread: GLslang: no reuse of shader objects in other program objects?

  1. #1
    Member Regular Contributor
    Join Date
    Jan 2003
    Location
    Edmonton, Alberta, Canada
    Posts
    320

    GLslang: no reuse of shader objects in other program objects?

    Based on the spec, there is an aspect of GLslang that I had hoped would be available: that is, linked a shader pair into a new program object when one or both of the pair has previously been linked. I had thought this might be good in order to maximize shader reuse. Unfortunately, it appears that if, for example, a vertex shader has been linked with a fragment shader in one program object, that same vertex shader cannot be linked with another fragment shader in a different program object. Might I be doing something wrong or is this simply impossible?

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,947

    Re: GLslang: no reuse of shader objects in other program objects?

    I'm moving this thread to the shaders forum.

  3. #3
    Member Regular Contributor
    Join Date
    Apr 2002
    Location
    Austria
    Posts
    328

    Re: GLslang: no reuse of shader objects in other program objects?

    Hello!

    This should be no problem and I just tried it. It worked. Maybe it is a bug in your driver or you're really doing something wrong.
    There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

    There is another theory which states that this has already happened...

  4. #4
    Intern Contributor
    Join Date
    Sep 2001
    Location
    Marlboro MA
    Posts
    90

    Re: GLslang: no reuse of shader objects in other program objects?

    Common things to look for:

    Did you successfully create the shader object(s)?

    Did you successfully compile the shader object(s)?

    Did you successfully create the program object(s)? Did you successfully attach the shader object(s) to the program object(s)?

    Finally, for each program object, make sure that the set of vertex shader objects attached has one and only one main entry point. Same thing with the set of fragment shader objects attached.

    But you absolutely may attach a shader object to multiple program objects.

    -mr. bill

  5. #5
    Member Regular Contributor
    Join Date
    Jan 2003
    Location
    Edmonton, Alberta, Canada
    Posts
    320

    Re: GLslang: no reuse of shader objects in other program objects?

    Originally posted by mrbill:
    Did you successfully create the shader object(s)?

    Did you successfully compile the shader object(s)?
    Yes, I make sure to check for that and toss an exception with the compilation error log if it fails.

    Did you successfully create the program object(s)? Did you successfully attach the shader object(s) to the program object(s)?
    Ah. . . Ok, the problem was my shader loading functions. I keep lists of all the shader objects and shader program objects I create and check those lists before I create another object to see if it has already been created. The problem is that when I find an already created object, I haven't been assigning its handle to the variable that I then pass into the program object.

    Quite a relief that it now works! Thanks for the help!

Posting Permissions

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