Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Issue about accessing array element of uniform block (AMD glsl compiler)

  1. #11
    Junior Member Newbie
    Join Date
    Aug 2009
    Posts
    22
    Quote Originally Posted by Alfonse Reinheart View Post
    All of them. At least, for arrays of regular values. GLSL 1.10 allowed this.

    I'd guess that this is a driver bug. Try using vec4's instead of vec3's; it's best not to confuse AMD drivers...



    Point of order: as stated in "the very next section", they aren't. Only Dynamically Uniform Expressions can be used with opaque types.

    But that's irrelevant, since he isn't using an opaque type here.
    You are right, after changing vec3 to vec4 everything works fine. Thank you for the suggestion!

  2. #12
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    Quote Originally Posted by tonyo_au View Post
    I thought his index is Dynamically Uniform Expressions since lightCount is a Dynamically Uniform Expressions?
    What you originally quoted was, "Arrays can be accessed with arbitrary numeric expressions. They do not have to be compile-time constants (though there are a few exceptions to this rule; for example, the very next section)." Then you said, "They are valid from 4.00 for opaque types."

    Your original statement said nothing about expressions being dynamically uniform. Your statement was misleading, suggesting that "arbitrary numeric expressions" are "valid from 4.00 for opaque types." I just wanted to clear that up in case anyone got the wrong idea.

    Yes, in his example, his loop is dynamically uniform. But he's not using an opaque type, so that's irrelevant: arbitrary numeric expressions should work on non-opaque types, regardless of GL version.

  3. #13
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,098
    Quote Originally Posted by Alfonse Reinheart View Post
    What you originally quoted was, "Arrays can be accessed with arbitrary numeric expressions. They do not have to be compile-time constants (though there are a few exceptions to this rule; for example, the very next section)." Then you said, "They are valid from 4.00 for opaque types."

    Your original statement said nothing about expressions being dynamically uniform. Your statement was misleading, suggesting that "arbitrary numeric expressions" are "valid from 4.00 for opaque types." I just wanted to clear that up in case anyone got the wrong idea.

    Yes, in his example, his loop is dynamically uniform. But he's not using an opaque type, so that's irrelevant: arbitrary numeric expressions should work on non-opaque types, regardless of GL version.
    OK I understand

Posting Permissions

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