Let Your Memes Be Dreams
With Mesa 22.1 RC1 firmly out the door, most eyes have turned towards Mesa 22.2.
But not all eyes.
No, while most expected me to be rocketing off towards the next shiny feature, one ticket caught my eye:
Mesa 22.1rc1: Zink on Windows doesn’t work even simple wglgears app fails..
Sadly, I don’t support Windows. I don’t have a test machine to run it, and I don’t even have a VM I could spin Up to run Lavapipe. I knew that Kopper was going to cause problems with other frontends, but I didn’t know how many other frontends were actually being used.
The answer was not zero, unfortunately. Plenty of users were enjoying the slow, software driver speed of Zink on Windows to spin those gears, and I had just crushed their dreams.
As I had no plans to change anything here, it would take a new hero to set things right.
The Hero We Deserve
Who here loves X-Plane?
I love X-Plane. It’s my favorite flight simulator. If I could, I’d play it all day every day. And do you know who my favorite X-Plane developer is?
Friend of the blog and part-time Zink developer, Sidney Just.
Some of you might know him from his extensive collection of artisanal blog posts. Some might have seen his work enabling VulkanOpenGL interop in Mesa on Windows.
But did you know that Sid’s latest project is much more groundbreaking than just bumping Zink’s supported extension count far beyond the reach of every other driver?
What if I told you that this image
is Zink running wglgears on a NVIDIA 2070 GPU on Windows at full speed? No software-copy scanout. Just Kopper.
Full Support: Windows Ultimate Home Professional Edition
Over the past couple days, Sid’s done the esoteric work of hammering out WSI support for Zink on Windows, making us the first hardware-accelerated, GL 4.6-capable Mesa driver to run natively on Windows.
Don’t believe me?
Recognize a little Aztec Ruins action from GFXBench?
The results are about what we’d expect of an app I’ve literally never run myself:
Not too bad at all!
I think we can safely say that Sid has managed to fix the original bug. Thanks, Sid!
But why is an X-Plane developer working on Zink?
The man himself has this to say on the topic:
X-Plane has traditionally been using OpenGL directly for all of its rendering needs. As a result, for years our plugin SDK has directly exposed the games OpenGL context directly to third party plugins, which have used it to render custom avionic screens and GUI elements. When we finally did the switch to Vulkan and Metal in 2020, one of the big issues we faced was how to deal with plugins. Our solution so far has been to rely on native Vulkan/OpenGL driver interop via extensions, which has mostly worked and allowed us to ship with modern backends.
Unfortunately this puts us at the mercy of the driver to provide good interop. Sadly on some platforms, this just isn’t available at all. On others, the drivers are broken leading to artifacts when mixing Vulkan and GL rendering. To date, our solution has been to just shrug it off and hope for better drivers. X-Plane plugins make use of compatibly profile GL features, as well as core profile features, depending on the authors skill, so libraries like ANGLE were not an option for us.
This is where Zink comes in for us: Being a real GL driver, it has support for all of the features that we need. Being open source also means that any issues that we do discover are much easier to fix ourselves. We’ve made some progress including Zink into the next major version of X-Plane, X-Plane 12, and it’s looking very promising so far. Our hope is to ship X-Plane 12 with Zink as the GL backend for plugins and leave driver interop issues in the past.
The roots of this interest can also be seen in his blog post from last year where he touches on the future of GL plugin support.
Big Triangle’s definitely paying attention now.
And if any of my readers think this work is cool, go buy yourself a copy of X-Plane to say thanks for contributing back to open source.
Share this on knowasiak.com to discuss with people on this topicSign Up on Knowasiak.com now if you’re not registered yet.