Announcement

Collapse
No announcement yet.

The Difference In Optimizations Between NIR & GLSL

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

  • #11
    Originally posted by Drago View Post
    Are you sure about that? As I heard, they are nothing alike.
    Yeah, they aren't.

    I mean, you could say that TGSI is like a serialized form of NIR, and that would be sort of correct on an abstract level. But practically they aren't the same at all, and neither is SPIR-V.

    Comment


    • #12
      Originally posted by Ericg View Post
      Rendering a triangle in OpenGL was something like 60 lines of code, with Vulkan being 600 or so.
      That's reusable code. Written once, for ex. in Dota2, used in any apps. Vulkan will surely not be more complicated to use, than 20 years old gl.

      Comment


      • #13
        @Michael : (pow, 4) isn (x*x)*(x*x). What you wrote in the article "(x*x)*x(x*x)." is (pow,5).

        Comment


        • #14
          Originally posted by Serafean View Post
          @Michael : (pow, 4) isn (x*x)*(x*x). What you wrote in the article "(x*x)*x(x*x)." is (pow,5).
          i was about writing the same. but more interesting is that it seems that the GLSL (not really sure here) as well as the NIR (here i am pretty sure) code snippets actually implement the latter, which would be a big mistake.
          Or did i understood the code snippets wrong?

          Comment


          • #15
            Originally posted by Serafean View Post
            @Michael : (pow, 4) isn (x*x)*(x*x). What you wrote in the article "(x*x)*x(x*x)." is (pow,5).
            True. (x*x)*(x*x) is even written in commit description.

            Comment


            • #16
              Originally posted by a user View Post
              i was about writing the same. but more interesting is that it seems that the GLSL (not really sure here) as well as the NIR (here i am pretty sure) code snippets actually implement the latter, which would be a big mistake.
              Or did i understood the code snippets wrong?
              The NIR one is definitely (x*x)*(x*x). The GLSL looks like that as well but the syntax is such a clutterfsck that I couldn't say for sure immediately after waking up. I think it's close to
              func (x)

              x = x^2
              ret x*x
              Last edited by nanonyme; 25 April 2015, 05:09 AM.

              Comment


              • #17
                Originally posted by nanonyme View Post
                The NIR one is definitely (x*x)*(x*x). The GLSL looks like that as well but the syntax is such a clutterfsck that I couldn't say for sure immediately after waking up. I think it's close to
                func (x)

                x = x^2
                ret x*x
                Is it just me or does the NIR example look very lisp-like?!

                I like.

                Comment


                • #18
                  I think it has been stated here already that NIR is using a python based code generator, while the old GLSL code doesn't. So not really sure what the point of this article is.

                  Comment


                  • #19
                    Originally posted by log0 View Post
                    I think it has been stated here already that NIR is using a python based code generator, while the old GLSL code doesn't. So not really sure what the point of this article is.
                    To be a page to put advertisements around of?

                    Comment


                    • #20
                      Originally posted by log0 View Post
                      I think it has been stated here already that NIR is using a python based code generator, while the old GLSL code doesn't. So not really sure what the point of this article is.
                      That NIR thanks to automation and code gen is providing clear benefits for mesa devs? And by implication that NIR based compilers will be easier to write and by implication that smaller independent teams will be able to output quality compilers faster. (Think all the mobile GPUs).


                      Big wins proved by simple optimization.


                      All of that is independent of IR actually. Its more code verbose vs code verbose, one could as well have NIR with OLD code verbosity. So big thx to somebody who got that code gen rolling!


                      Also how does it compare to LLVM and radeon?

                      IIRC Vulkan will STRONGLY favour spliting compiler stack into offline and online portions, but compiler stack may be shared between OGL and Vulkan. Those NIR code gen techniques should be nicely applicable to SPIR-V. Is anybody from AMD looking into it?

                      Comment

                      Working...
                      X