Announcement

Collapse
No announcement yet.

Mesa Makes Way For Assembly Shaders To GLSL IR

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • smitty3268
    replied
    Originally posted by shatsky View Post
    As I understand, before Gallium3D in Mesa GLSL used to be compiled to some Mesa IR, which was tied to OpenGL API, thus forbidding other APIs to be implemented on top of it. Then the Tungsten Graphics developed Gallium3D, and now Gallium3D OpenGL state tracker translates GLSL directly to their API-independent TGSI, and other state trackers as well. Then idea of using LLVM for common optimizations came out, TGSI->LLVM translator was written and now LunarG crew is working on their stack which uses LLVM as its only IR.
    So what is "GLSL IR" and what is its place in all this?
    The old mesa drivers got Mesa IR from both these assembly shaders and the old GLSL compiler. It was limited to GL 1.x features i think.

    When Gallium3D was added, it converted this Mesa IR into TGSI for gallium drivers to use. TGSI was actually a similar format, i think, but better defined, cross-platform, and with more features available.

    Around Mesa 7.10 or so, Intel committed a new GLSL compiler, which generates GLSL IR natively (IR is a common compiler term - internal representation). At first, this GLSL IR was converted into Mesa IR for backwards compatibility - then sent off to the classic drivers or turned into TGSI for gallium. Later, the i965 driver gained the ability to work on GLSL IR directly, and gallium converted directly from it into TGSI to bypass the Mesa IR as well. That was important because Mesa IR was getting old and missing features that both GLSL IR and TGSI had that were necessary for newer GL features.

    My understanding of the current LLVM work is that it would directly replace TGSI in the gallium stack (as an alternative option) - although it's still early and many different things could eventually end up happening. There's also been whispers of possibly replacing TGSI with GLSL IR, or it could introduce multiple levels where it starts as one language and is later converted to another.

    Leave a comment:


  • shatsky
    replied
    As I understand, before Gallium3D in Mesa GLSL used to be compiled to some Mesa IR, which was tied to OpenGL API, thus forbidding other APIs to be implemented on top of it. Then the Tungsten Graphics developed Gallium3D, and now Gallium3D OpenGL state tracker translates GLSL directly to their API-independent TGSI, and other state trackers as well. Then idea of using LLVM for common optimizations came out, TGSI->LLVM translator was written and now LunarG crew is working on their stack which uses LLVM as its only IR.
    So what is "GLSL IR" and what is its place in all this?

    Leave a comment:


  • pingufunkybeat
    replied
    Wrong screenshot, Michael. That's the old, correct path. Ian's new branch is the screenshot in the middle, where rendering errors are apparent.

    Anyway, I'm kind of losing track of what is going on, and what the plan is. This eliminates Mesa IR, right? What is left?

    Leave a comment:

Working...
X