Announcement

Collapse
No announcement yet.

Intel Adds Mesa IR To NIR Translator & Makes Other NIR Improvements

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

  • Intel Adds Mesa IR To NIR Translator & Makes Other NIR Improvements

    Phoronix: Intel Adds Mesa IR To NIR Translator & Makes Other NIR Improvements

    The NIR intermediate representation for Mesa continues taking flight and driven by Intel's open-source developers...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Is there any point in NIR after Khronos published SPIR-V specifications?

    Comment


    • #3
      Originally posted by leonmaxx View Post
      Is there any point in NIR after Khronos published SPIR-V specifications?
      I don't know much about this, but I think think they work at different levels. So NIR would be behind the compiler implementation, and SPIR-V would be behind the Vulkan implementation. NIR reduces the amount of instructions sent to hardware over mesa's IR.

      Something like.... Vulkan Code >> SPIR-V >> NIR >> Hardware

      ?????
      Last edited by duby229; 28 March 2015, 05:27 PM.

      Comment


      • #4
        Originally posted by leonmaxx View Post
        Is there any point in NIR after Khronos published SPIR-V specifications?
        Originally posted by duby229 View Post
        I don't know much about this, but I think think they work at different levels. So NIR would be behind the compiler implementation, and SPIR-V would be behind the Vulkan implementation. NIR reduces the amount of instructions sent to hardware over mesa's IR.

        Something like.... Vulkan Code >> SPIR-V >> NIR >> Hardware

        ?????
        SPIR-V can be thought of as a format used for shader program transmission; what the tools do with it is out of the specification's scope. A frontend that translated GLSL to SPIR-V could perfectly use LLVM IR as a more appropiate intermediate representation, and so could a Vulkan or OpenCL driver backend that ate SPIR-V and outputted hardware instructions. It seems SPIR-V is not suitable for applying optimization passes on it. Moreover, many passes have already been implemented for LLVM IR (and that's just an example), so, even if it was [suitable], it would probably be converted to the already-used IR just for convenience. (As was already said by developers: Converting is not as much a performance hit as even a single pass).

        There seems to be confusion regarding this. SPIR-V will not replace Mesa's internal data structures. NIR makes as much sense as it is appropiate for unveiling optimization opportunities and applying optimization passes - just as LLVM IR, Mesa IR, GLSL IR, and the rest. In fact, most of them will be kept there, as there are working optimization passes already implemented for them.

        That said, there has been talk of SPIR-V being placed alongside Gallium3D's IR, TGSI. However, the Vulkan specification is still not there, so… who knows? I hope developers talk a bit on this.

        Comment


        • #5
          Originally posted by leonmaxx View Post
          Is there any point in NIR after Khronos published SPIR-V specifications?
          They are completely different, so yes.

          SPIR-V will be provided by apps to the drivers, which will then translate it into a driver-specific format that they can optimize and send on to their hardware. NIR is that layer.

          Comment


          • #6
            It seems SPIR-V is not suitable for applying optimization passes
            Not that I doubt you, but do you have a reference for that?
            It would be unfortunate if the sole reason for spirv is to allow glsl to become distributable. Seems a missed opportunity.

            Comment


            • #7
              Originally posted by liam View Post
              Not that I doubt you, but do you have a reference for that?
              It would be unfortunate if the sole reason for spirv is to allow glsl to become distributable. Seems a missed opportunity.
              Why would that be unfortunate? It's a key feature, and the entire reason SPIR-V exists - well that, and making sure driver compilers are much simpler/faster, and allowing different languages to be used by developers.

              SPIR-V is a flat-file binary format - of course you are meant to translate it into some kind of in-memory data structure. Doing things directly on the binary file would be pointlessly more difficult.

              Comment


              • #8
                Originally posted by smitty3268 View Post
                Why would that be unfortunate?
                Because I'd imagine there is a minimum amount of optimization they could apply so as to ease the work of the drivers. GPU's aren't so different, after all. They all share similar functional units. Even considering opencl, they still have to map to the same units whether they commands are graphics or compute.
                I'm entirely prepared to be wrong about this, but that's how I've been thinking of it.

                Comment


                • #9
                  Originally posted by liam View Post
                  Because I'd imagine there is a minimum amount of optimization they could apply so as to ease the work of the drivers. GPU's aren't so different, after all. They all share similar functional units. Even considering opencl, they still have to map to the same units whether they commands are graphics or compute.
                  I'm entirely prepared to be wrong about this, but that's how I've been thinking of it.
                  Meh - that's the job of whatever is compiling into SPIR-V in the first place. Such as the GLSL compiler that's producing it. It's already in SSA form, which is a lot of the common work already. You are free to optimize that code all you want before passing it into the driver, if you fear the driver's compiler will suck at optimizing it.

                  Comment

                  Working...
                  X