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

Thread: Uniform Locations implementation dependant?

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

    Uniform Locations implementation dependant?

    Hey there,

    if i compile & link the same GLSL source with different OpenGL-implementations, can the uniform locations that i get with glGetUniformLocation differ?

    In general:
    Can i be sure, that everything that i don't find in the specification (as the assignment of uniform locations) is implementation-specific?

  2. #2
    Member Regular Contributor
    Join Date
    Jan 2012
    Location
    Germany
    Posts
    325
    Quote Originally Posted by Kastenfrosch2 View Post
    Hey there,

    if i compile & link the same GLSL source with different OpenGL-implementations, can the uniform locations that i get with glGetUniformLocation differ?
    Yes (unless you use explicit locations in your shader).
    IIRC nvidia will assign numbers based on the order of appearance in the code while AMD sorts them alphabetically first. This can change with the next driver release! Same with attribute locations. Always query the locations or set them explicitly (not available in all OpenGL versions).

    Quote Originally Posted by Kastenfrosch2 View Post
    In general:
    Can i be sure, that everything that i don't find in the specification (as the assignment of uniform locations) is implementation-specific?
    Yes. Never assume anything that isn't stated in the specs explicitly.

  3. #3
    Junior Member Newbie Kastenfrosch2's Avatar
    Join Date
    May 2012
    Location
    Germany
    Posts
    15
    Thanks a lot!

Tags for this Thread

Posting Permissions

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