Since my last Vulkan update, we now have the full sim running natively with Vulkan and Metal! There is still a pretty big list of random things turned off or bypassed to make this happen, but we can fly in the cockpit and use the sim.

Here’s some stuff that is now working:

  • Using regular and HDR rendering, and SSAO on metal.
  • Flying with Vulkan on AMD, NVidia, and Intel drivers.
  • Hardware stereo rendering on OS X – this never existed before Metal because the Mac GL drivers didn’t support it. Hardware stereo rendering is necessary for VR support.
  • MSAA on Metal – with the restructuring of our code, you’ll be able to change MSAA settings without restarting. I don’t know if this code works on Vulkan right now; it might.

Here’s some stuff that does not work yet:

  • Plugins are bypassed right now. We have not yet written the plugin-OpenGL-interop layer.
  • VR only works when using OpenGL as the driver; we need to write some new VR code to pass Metal and Vulkan frames directly to the OVR and Rift APIs.
  • Screenshots/Movie capture are a work in progress – that’s what I’ve been working on this week.

We still have a number of visual bugs, so screenshots are an important feature so we can run our automated test system. The test system takes hundreds of screenshots of the sim in many configurations and compares them to 11.30 to catch bugs introduced by the new Vulkan and Metal back-ends. Clearly I’ll have to fix my color problems first.

One fun aspect of this port: Metal and Vulkan copy Direct3D’s convention where the viewport Y axis points down and not up. This resulted in a whole series of weird “it’s upside-down again” bugs, most of which have been fixed.

The world is drawn correctly but the atmosphere around it is upside down.

(That airplane might look silly, but at least all of the image is consistently upside down. That’s because the only remaining upside down code is the movie/screenshot capture code itself.)

We should have some performance numbers to post next week; right now our primary focus is fixing bugs, particularly bugs that bring the whole machine down.

Here are a few more pics of things that have gone wrong during development.

About Ben Supnik

Ben is a software engineer who works on X-Plane; he spends most of his days drinking coffee and swearing at the computer -- sometimes at the same time.

71 comments on “Vulkan and Metal: It Runs!

  1. Wow!
    Thank you for the info Ben! I’m waiting for it to go beta someday 😀 !!!

  2. Things have been crazy quiet from your quarter Ben, and “we” all knew why. This heartbeat is great, great news. Thanks for poking your head above water and letting us see what’s going on, even if it’s upside down, backwards and inverted. 😉

  3. Really loved the ‘aurora clouds effect’ 😉

    Tip #1: Use Australian airports by default – this should flip back the Y-Axis for now.

  4. I did some programming a long while back and I can see from your tantalising screenshots that your at that exciting moment when your on the cusp of getting key items to successfully render.

    As always great work by LR’s and thanks for keeping us uptodate on your progress

  5. In your debugging screenshot comparisons does the process run a pixel by pixel delta and raise flags for any differences in color? Or is it a pixel hash of some sort?

    1. We abs-diff the image pixel by pixel and then run some kind of ‘how bright is the diff’ and sort them by how much diff there is. The algos come from a Python imaging package…it detects both small-spatial but huge differences (e.g. “holy crap, the shadows are gone”) and large subtle differences (e.g. the whole image is off by 2% cuz tone mapping is wrong).

  6. This is excellent news. I am glad to hear that there is progress being made with Vulkan implementation, regardless of bugs now faced. Lately I have been also using Aerofly FS2, with its Vulkan implementation, and I am amazed at how smooth it runs in VR. It’s my hope this will become the same experience with X-Plane 11.

    If I may, one thing I would like to wishlist- I noticed with Aerofly FS2, there is the option of either mirroring the eyes of the Rift on monitor, OR maintaining the regular 16:9 aspect ratio full screen (while still giving the user what they need inside the VR headset).

    As an avid youtube content creator, this is ingenious! This allows us to record full screen without the “portrait view” that we currently see in most VR enabled titles. I do not know how they did it, but it would make my year, if X-Plane had such an option to show the regular (non VR) monitor view, and keep what I need to make VR function properly. This would completely eliminate my need to use the Oculus Mirror app to record from, or cropping the X-Plane 11 window so that I get a 1080p landscape view.

    1. Exacty my comment last spring when using my Lenovo WMR Drew…its now sold , and cancelled my Pimax 5K Plus. Now awaiting my 2160×2160 per eye HP Reverb to ship from Amazon.

      With my WMR Lenovo I tried everything I could to Stream full screen, ala The streaming Rifties like, On The Glideslope and Bambino, but only had fullscreen streaming success in side-by-side 3-D.

      Hopefully Microsoft will allow streaming a full screen mirror on the Reverb!

      Chas

  7. That’s fantastic news guys, and it’s really cool that you posted the ‘fails’ screenshots. I remember getting stuff like that when I first started writing OpenGL/GLSL code. It won’t be long before all that’s figured out I think.

  8. Upside down? are you sure you’re not in Australia? Looks good so far, its always a bit humorous to see the bugs but at the same time, being able to see them means you’re making progress. Please do keep posting the updates, at least for me they’re educational if not a bit fun

  9. I don’t think Vulkan will make it in 2019. Lot and lot of work to do I guess based on this post. But it looks promising.

      1. Is this in addition to the bingo board we’ve been playing during the Q&A sessions?

      2. Whatever Laminars official ETA is, add 5 months. In add ons, for 3D mesh and textures, we add 3 months. Code is 5 months.

        1. The problem is, it’s recursive. So once you have the _real_ estimate by adding 5 months…ya gotta add five months to _that_. Then when you have that _really real_ estimate…

    1. Considering that they didn’t have any part of the “main xp world” so to speak rendering in vulkan only last month, a beta before the end of the year isn’t out of the ballpark imo

      1. It’s really hard to judge in either direction from past deltas…a _huge_ amount of work went into getting from Airfoil-Maker to Plane-Maker…it might not be obvious how much work that was from just looking at Plane-Maker.

    1. I can say this so far: the Vulkan and Metal drivers appear to be pleasantly ‘thin’ – that is, when they are working correctly, they just don’t take up that much CPU time. That’s exactly how it’s supposed to go.

      Now, that’s not all just free FPS – the OpenGL driver _did more work_ (using more CPU time) and some of that work still has to be done by us, so the app has picked up new responsibilities that can eat CPU. But it means the CPU work is an area we can optimize, not one we’re stuck with.

      1. sounds good, we are all looking forward to the “performance figures” you have mentioned

      2. My expectations of this move to vulkan would be to have a “smooth” flight from A to B without stutters or hiccups, that would make me a happy camper. I for one don’t care for “we want more fps” as more fps does not necessarily mean smoother stutter free immersion. I would rather have 60fps stutter free (or even 30) than 100 with hiccups.

        1. Ben’s been talking publicly about stutter-free being a long-term goal for a while now, and Vulkan & Metal finally give us the tools to get there.

  10. Congrats team! I trust you raised a couple during the well-deserved celebration of this very exciting milestone.

  11. This is very exciting news.
    I really would be happy to test an early beta if and when it is released.
    What are your plans on that front?
    Do you want the beta pretty much ready and fully functional with just bug squashing or do you plan a range of betas adding as you go until full functionality is included?

  12. congratulation team!, to think 2 programmers are working on this and 3 platforms, impressive.

    I was wondering when shipping Vulcan, will you have two executable just like xp10 with 32Bit / 64Bit?

    I remember you were working on a new “3D water” any news on that?

    And obligatory: will LR implement seasons after Vulkan? at least snow, there is already an addon trying to achieve that without using texture replacement method.

    Thank you.

    1. Not sure on two executables – that was necessary for 64-vs-32 bit where the executable format is different. For Vulkan and Metal, we can select the driver at run-time, so we’re not sure.

  13. When you write the new VR code, I think you’ll see the current VR loading screen a few times. Can you take out the floor that is flying among the cube map. The community can create nice looking cube maps (I’ve already created 2 different loading_cube.png files) but we can’t get rid of this flying floor. The loading screen could by the way allow higher resolution images. At the moment it looks like work in progress and not like a showpiece of what you’ll get when X-Plane VR situation finished loading (it’s wow).

    best regards

  14. Can plug-in DLLs with X-Plane-independent window management under Windows work as before with Direct2D and Direct3D? So is the coexistence of Vulkan and Direct3D under Windows guaranteed?

    1. You mean you made a system window using, like, Win32 APIs and you draw yourself? Yeah, that’ll work – since it’s not tied to us, it won’t change.

  15. Ben great work really looking forward to the performance numbers, will there be a new stream anytime soon with a talk about vulkan and metal ?

    1. Next video live stream will probably be this summer when a few of us meet for planning. Before that we’ll be at FSExpo in Orlando in a big way.

      1. Looking forward to seeing you again at FSExpo in Orlando.

        Would be great if you were showing off Vulkan there but time will tell.

        As a Linux user that only uses VR will be great when I can use VR on my OS of choice.

        Thanks Bill

  16. Thanks Guys I am sure I speak for everyone when I say we thank you for everything you do to make the BEST SIM on the market even better

  17. For the “Metal and Vulkan copy Direct3D’s convention where the viewport Y axis points down and not up.” problem and the next video conference, there’s an easy solution: You don’t have to stand upside down; putting a mirror on the floor and directing the camera towards it will fix things 😉
    Avoiding extra computations for a reasonable coordinate system seems to make Vulcan that fast! Another 😉
    (Sorry I couldn’t resist)

    1. The funny thing is that Vulkan actually supports flipping the viewport natively, which is also how the normal rendering is done (since Vulkan’s coordinate system by default is flipped compared to every other API out there). So when we render offscreen targets, instead of flipping the projection matrix, we just flip the viewport again to its default and invert the winding of the vertices.

      1. Wait, Sidney, aren’t we flipping the viewport _and_ the projection matrix for RTT FBOs so that we can emulate GL semantics? 🙂 I feel like you’re soft-selling the level of convolution here.

        1. You are on Metal, on Vulkan I just flip the viewport and leave the projection matrix as is. You should look at the Vulkan command encoder sometimes 😛

  18. This is super exciting! With Vulkan, will it
    be easier to make graphical improvements? I’d like to see the HUDs in XP11 get a visual upgrade.

    1. Honestly, mostly, no. The new cleaned up graphics API we put on top of Vulkan and Metal _is_ nicer to use than what came before it, but the old system did support pretty much anything you’d want to implement new and/or improved quality.

      The big win in terms of future development with the new API comes in terms of performance, I think.
      – The new API is just faster, and let’s us express the algorithms more efficiently on the CPU side.
      – We can multi-thread things very easily now, where-as we basically couldn’t do that at all with the old tech.
      – There are great tools to view GPU performance for Vulkan and Metal, so we can see what we’re doing when we optimize for GPU use.

      1. Does this mean my gpu will finally be utilized? I “upgraded” from a gtx770 to a vega64 not expecting a huge improvement, but definately didn’t expect the downgrade in performance.

        1. You may see an improved utilization of the Vega64, due to the CPU being able to push frames faster. The down-grade you saw was due to the AMD OpenGL driver being less CPU-efficient than the NV one. The Vulkan drivers are much closer together in terms of perf, and both are quite lean and mean.

          The other problem with GPU perf is how much concurrency we get out of the GPU. We at least have the ability to _look_ at that kind of thing now that we’re on the new APIs.

  19. You guys rock – looking forward to numbers but all you say about multithreading now possible, thinner API and the speed at which you are progressing is impressive.

  20. WOW … 4 times a week i was looking for a message like that – Today is just an amazing day. Thank you 😉

  21. This is pretty exciting ! I have a question though regarding multi-GPU support . So here goes. Are you going to be supporting the Explicit Multi-GPU ability of Vulcan and metal? Especially in regards to VR/ Per eye rendering? I have a system with not one but 2 Nvidia Titan V video cards. And they only support working in tandem through explicit multi-GPU because those cards do not have any way of physically connecting themselves to each other (e.g. there is no physical SLI / NV link support). but they will work using the Explicit Multi-GPU API providing they don’t saturate the PCI E bus. the mere thought of this possibility of pairing the two most powerful single card video solutions in the world with each other boggles my mind. (I am currently using them for 3D asset development and VR) in any case I cannot imagine the smoothness that would be possible especially in VR using the 8K Pimax VR sets that my brother and I currently use. in any case the benefits of such a system implementation is far-reaching to other users of either SLI and crossfire, or even those people who have multiple dissimilar video cards . I.e. users who have one big video card for rendering e.g. 1080/2080 series and a second dissimilar card (read that as cheaper) in order to offload calculations for Nvidia’s PhysX System. you can always tell someone who use dictation software, because the post like this get ridiculously long, my apologies for that. and ahem, network synchronization ? yeah I know, I had to throw that out there anyway, you knew I was going to. 🙂 but seriously fantastic news can’t wait to see how this all comes together.

    1. We have designed the new graphics code to be _capable_ of supporting multiple GPUs via X-Plane, without driver magic. We are not doing anything to act on this in the initial Vulkan/Metal roll-out. Gotta crawl before we walk here.

      In terms of priorities for perf, my thinking is:
      1. Perf optimizations that help all users who have one GPU.
      2. Perf optimizations that help users who use one GPU per monitor to get the two monitors to run ‘independently’.
      If/when we have done all of that, if it turns out that case (2) can be _easily_ used to do dual-GPU/dual-eye rendering, we’ll look at it, but it’s way down on our priority list. There just isn’t a huge number of users sitting on Dual Titans + a Pimax asking for this. If the market moves a lot and everyone and their mother has this config, we’ll reconsider the priorities.

      The one thing that’s just not on the list is dual GPUs for a single monoscopic display (e.g. AFR/split frame).

      1. I detect a little note of sarcasm there, but you’re right my setup is unique and a little over the top but when you’re retired as my brother and I both are, and have no other distractions (I have devoted most of my adult life to this industry) then set ups like this become possible. and I appreciate the response. having said all that, I do believe the Per eye rendering will benefit all of those who have VR headsets and dual cards of which there are indeed very many ! Heck I’d like to see what the metrics you collect are telling you the distribution is on this. maybe I’m totally wrong here. It wouldn’t be the first time. but it certainly seems like the industry is trending in that direction for VR users as more and more higher end / higher resolution sets enter the marketplace.

        1. Maybe a spoonful of sarcasm but not a full cup. We do hear about once every year or so from a user who has an ultra-high-end setup, e.g. two of the most expensive video card on the market, and our response is pretty much always that this is a low priority setup because it’s rare, so it’s a lot of engineering for a very small part of the user base. If we have any other optimizations we can do, we have to do those, not do dual eye and then tell our users to go double what they spend on GPUs.

          1. I totally understand that, I really do, my acquisition of those video cards was actually by happenstance, I purchased one for my work, and the second one was actually gifted to me ! but you are sort of missing the point I was trying to make by focusing on my personal rig, (perhaps a bad example on my part) I was merely trying to bring attention to the community of dual video card users. Read that as SLI/crossfire users. of which there are actually very many. But anyway I love the direction you guys are taking, I love to meet you someday because you’re not far from me here in New England. Anyway, good work as always.

      2. Great news!! I am a pimax user and I would be very interested to buy another gpu for more frames.

    2. The notion of one GPU per peeper is exciting – even if only for a future priority if the code can be wrangled without angina. That would level the playing field and really provide the kind of FPS that VR deserves, especially with the upward march in resolution that’s bound to occur.

      1. Will eGPUs be supported with Metal? This is an issue in the Mac community as all Mac laptops (unless upgraded with Vega graphics) and Mac Minis do not have sufficiently powerful graphics cards to run X Plane at acceptable frame rates. Currently X Plane recognises eGPUs but does appear to use any hardware acceleration running at single figure FPS.

  22. Interesting. I might reinstall XP11 once Vulkan is there to see how it performs compared to Aerofly FS 2!

  23. Can’t wait to fly that new Boeing. Kinda like the plain orange livery, too.

  24. Ben,

    Congrats on the progress with Vulkan. As VR will require a revisit when being ported could I ask that you take a look at natively supporting headsets with canted displays. I previously emailed Chris about this but with more headsets appearing the issue is going to come more to the fore. We first had the Pimax 5k and 8k and now Valve have released the Index with a similar method of increasing the field of view. The open Vr function call GetEyeToHeadTransform returns a matrix which includes the rotation. It’s likely already called in xplane to get the users IPD but the rotation part of the matrix has not been implemented.

    Having this natively supported would remove the need for costly compatibility modes.

    Thanks for your efforts

    Fergus

    1. Yes I think Lamiar are looking at a chicken and egg scenario when it comes to their seemingly reluctant support for VR.
      Sure they want to put most resources toward development the majority will benefit from but when pointing to the limited VR users it is a case of the development need to be there for people to adopt it rather than the other way around.
      For example I would purchase a HMD just for Xplane but currently the best HMD’s are not well supported by poor Xplane performance, especially wider FOV headsets.
      If I knew Xplane would run well on the new gen of HMD’s I would purchase one and I dare say there are many other people who feel the same.

  25. You may need to try the Metal backend on AMD Radeon RX580, I believe there’re still some freezes issue there.

  26. Hey, what about those performance numbers you talked about?

    I’m really curious to see the first impressions (I know it will be a work in progress, but would be nice to know what I can expect on day one with Vulkan).

Comments are closed.