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: The New Graphics and Compute API - GDC 2015 Sessions

  1. #11
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,135
    Damn, thank you. That's a lot of decorations. The example for the fragment shader above the "Decorations" sections actually shows some of them (smooth, noperspective) and even some names, but no location which seems to be crucial to linking.

    Admittedly, I don't fully understand what the "Component" decoration is used for.

  2. #12
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,135
    My point is that it's already a solved problem, and has been for many years.


    It's also solved for GLSL. However, if you translate to an IL which (at least it seemed so at first) doesn't carry the information which current GLSL linkers in part use to do the matching, then one might feel that something is missing.

  3. #13
    Senior Member OpenGL Lord
    Join Date
    May 2009
    Posts
    5,906
    Admittedly, I don't fully understand what the "Component" decoration is used for.
    It's from ARB_enhanced_layouts, one of the cooler 4.4 things. It lets you have two (or more) variables share the same location, but different components within it. Since each vertex shader input and fragment shader output is always (internally) some kind of vec4, it lets you save space on rendering inputs/outputs.

    For example, if you have two 2D texture coordinates to pass to a vertex shader, you could give them separate locations. But since inputs are effectively vec4's, you're effectively throwing away a location needlessly. You could use a vec4 in your shader, but then you have to treat it semantically like a vec4. That looks ugly in the shading language, since it's basically a hack.

    The component designation allows you to have one vec2 use the first two components of the location, with the second two going to a different vec2 variable in the same location.

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
  •