News for hackers. Stuff that matters.
Re:Bringing Vulkan everywhere by Lio on Tuesday August 07, 2018 @02:34PM (#17709282)
Hopefully this will offer some way forward for FOSS software like Blender running on macOS when Apple kill OpenGL off.
Re:Bringing Vulkan everywhere by electricslpnsld on Tuesday August 07, 2018 @02:45PM (#17709388)
I don't think there is any Rust (or any Rust on the roadmap) in Blender -- they would most likely use MoltenVK on macOS, similar to the path the Qt folks are taking [0].

[0] http://blog.qt.io/blog/2018/05/30/vulkan-for-qt-on-macos/

Re:Bringing Vulkan everywhere by nemaar on Tuesday August 07, 2018 @02:55PM (#17709480)
I believe you can use this without touching Rust. If I remember correctly they even ran Dota2 with this. That certainly does not have Rust inside.
Re:Bringing Vulkan everywhere by electricslpnsld on Tuesday August 07, 2018 @03:00PM (#17709533)
Interesting, thanks for the clarification! Any idea as to the advantages of using these bindings vs. the Molten bindings, if one isn't using Rust?
Re:Bringing Vulkan everywhere by baobrien on Tuesday August 07, 2018 @03:17PM (#17709681)
I think -- and I could be wrong here -- that gfx-rs aims to eventually implement Vulkan on D3D12 in addition to Metal, while MoltenVK only aims to work on Metal.
Re:Bringing Vulkan everywhere by wlesieutre on Tuesday August 07, 2018 @03:46PM (#17709955)
I don't know about the MoltenVK branding specifically, but Khronos does plan a "Universally portable subset" of Vulkan with tools to target both Metal and D3D12 from one rendering codebase and common SPIR-V shaders.

The project is call Vulkan Portability Initiative:

https://www.khronos.org/blog/khronos-announces-the-vulkan-po...

Re:Bringing Vulkan everywhere by shmerl on Tuesday August 07, 2018 @04:03PM (#17710169)
If I understood correctly, gfx-rs aims to provide an implementation for that initiative. Khronos only announced it in concept, they didn't implement it.
Re:Bringing Vulkan everywhere by kvark on Wednesday August 08, 2018 @11:29AM (#17716729)
Both gfx-rs and MoltenVK are in that technical subgroup within Khronos.
Re:Bringing Vulkan everywhere by maccam94 on Tuesday August 07, 2018 @03:30PM (#17709785)
Are there any D3D12 platforms that don't also support Vulkan?
Re:Bringing Vulkan everywhere by jsheard on Tuesday August 07, 2018 @03:43PM (#17709925)
Windows, partially. Vulkan can be used in classic win32 apps but not in "modern" UWP apps.

The Xbox One uses a variant of D3D12 and doesn't support Vulkan at all.

Re:Bringing Vulkan everywhere by drb91 on Tuesday August 07, 2018 @04:53PM (#17710683)
> Vulkan can be used in classic win32 apps but not in "modern" UWP apps.

Why is this/how do they enforce that?

The Xbox is hardly a surprise, but then again you're only going to target that for games so it's less of a problem.

Re:Bringing Vulkan everywhere by jsheard on Tuesday August 07, 2018 @04:58PM (#17710746)
> Why is this/how do they enforce that?

Technically Windows doesn't support Vulkan at all, but the openness of the win32 platform allowed Khronos to define a "backdoor" interface where the application ignores the Windows graphics stack and instead gets a Vulkan context by talking to the graphics driver directly. The UWP sandbox makes this impossible so you're stuck with the native Direct3D APIs.

Re:Bringing Vulkan everywhere by shmerl on Tuesday August 07, 2018 @05:26PM (#17710969)
I don't think UWP with Vulkan is completely impossible.

https://github.com/KhronosGroup/Vulkan-Docs/issues/366

It doesn't exist now though for sure, so for all practical purposes UWP locks developers out of using Vulkan.

Re:Bringing Vulkan everywhere by drb91 on Tuesday August 07, 2018 @05:01PM (#17710770)
Ahh, I had no idea UWP implied running on microsoft's terms. Is there a way to run them out of the sandbox manually?
Re:Bringing Vulkan everywhere by megaman22 on Tuesday August 07, 2018 @05:05PM (#17710793)
Statistically, nobody actually builds real UWP apps, so it is largely an academic point. But if you're out of the sandbox, I fail to see a good reason not to just build a regular old Win32 app the way it has always been done.
Re:Bringing Vulkan everywhere by pjmlp on Wednesday August 08, 2018 @01:06AM (#17713328)
Microsoft has decided to approach the problem by other means, meaning the introduction of MSIX containers for Win32, and merging both worlds.

The next Office for Windows 10 being store only is already an indication how things will go from now on.

Re:Bringing Vulkan everywhere by imtringued on Tuesday August 07, 2018 @07:29PM (#17711876)
If you are on Windows on ARM then there is no option other than UWP apps. Why would anyone buy an ARM laptop if they have to rely on emulation for everything anyway. It's not like the ARM laptops are any cheaper than the intel ones. (they actually have worse specs and cost more)
Re:Bringing Vulkan everywhere by johncolanduoni on Wednesday August 08, 2018 @12:25AM (#17713198)
Older Intel chips (pre-Skylake IIRC) don’t have Vulkan support on Windows, even though they do on Linux.
Re:Bringing Vulkan everywhere by wolfgke on Tuesday August 07, 2018 @03:39PM (#17709874)
I am not completely sure, but I can imagine XBox One.
Re:Bringing Vulkan everywhere by kvark on Wednesday August 08, 2018 @11:31AM (#17716742)
gfx-rs Metal backend can be powerful and faster
Re:Bringing Vulkan everywhere by steveklabnik on Tuesday August 07, 2018 @02:59PM (#17709520)
My understanding is that this exposes a C ABI so that it's not purely for Rust programs.
Re:Bringing Vulkan everywhere by achandlerwhite on Tuesday August 07, 2018 @03:09PM (#17709605)
Is Apple “killing off” OpenGL? Isn’t it just deprecated ie not further development but not removed?
Re:Bringing Vulkan everywhere by statusreport on Tuesday August 07, 2018 @03:35PM (#17709837)
In this year’s WWDC I asked the same question one of the GPU software engineers and he claimed that Apple is going to completely remove support for OpenGL in about two years from now.

Regardless, “deprecated” means “no longer maintained”, meaning that if any regressions will appear in the near future, it’s possible no one will fix them, as these issues will not be prioritized.

Re:Bringing Vulkan everywhere by bodas on Tuesday August 07, 2018 @05:19PM (#17710912)
I'd take that with a grain of salt. Apple likes to threaten removal of technologies they have deprecated as a way to increase adoption of their replacements but rarely if ever go from deprecation to removal so aggressively, at least on the Mac.
Re:Bringing Vulkan everywhere by malkia on Tuesday August 07, 2018 @06:11PM (#17711339)
Re:Bringing Vulkan everywhere by tomovo on Tuesday August 07, 2018 @05:40PM (#17711097)
They might exclude deprecated APIs from the pre-announced iOS-MacOS portable platform (Marzipan). That is the move that makes them unsuitable for future use.

This also includes UIWebView and other quite popular pieces of the SDK.

A clean cut - good opportunity to shed some weight, actually.

Re:Bringing Vulkan everywhere by pcwalton on Tuesday August 07, 2018 @08:40PM (#17712246)
Note that Apple is still committed to supporting WebGL in Safari, so OpenGL ES will at least be supported that way going forward.

So it's arguably not so much "OpenGL is going away" as it is "OpenGL is going to be maintained by the Safari team, and JS will be the only interface to it" :)

Re:Bringing Vulkan everywhere by pjmlp on Wednesday August 08, 2018 @01:08AM (#17713334)
WebGL does not require OpenGL implementation.

Most browsers on Windows use DirectX instead and the games consoles also only have their own 3D APIs.

Re:Bringing Vulkan everywhere by pcwalton on Wednesday August 08, 2018 @01:30AM (#17713416)
WebGL is an OpenGL implementation. On Windows, it's often implemented with ANGLE, also an OpenGL implementation.

The GL spec doesn't require that the hardware or OS manufacturers are the ones to implement it. :)

Re:Bringing Vulkan everywhere by raphlinus on Tuesday August 07, 2018 @03:17PM (#17709672)
Given that it was already on a very old version, not doing further development counts as "killing it off" in my book. I'm bummed because I did an OpenGL based text renderer in xi-editor, and now have to decide whether to go back to CoreGraphics (assuming they've fixed the performance problems there) or forward with something like this.
Re:Bringing Vulkan everywhere by muizelaar on Tuesday August 07, 2018 @04:33PM (#17710492)
I'd recommend something like this. We plan on switching to it for WebRender in the future.
Re:Bringing Vulkan everywhere by shmerl on Tuesday August 07, 2018 @04:02PM (#17710145)
They plan to kill it, but it's not very clear when. Quite stupid and as bad as not supporting Vulkan, but that's Apple for you.
Re:Bringing Vulkan everywhere by Volt on Tuesday August 07, 2018 @03:35PM (#17709841)
Apple removes deprecated stuff eventually.
Re:Bringing Vulkan everywhere by dwaite on Tuesday August 07, 2018 @03:57PM (#17710075)
Some things are removed swiftly, others stay around forever (e.g. /usr/lib/libssl.0.9.8.dylib)
Re:Bringing Vulkan everywhere by pjmlp on Tuesday August 07, 2018 @04:56PM (#17710719)
Usually Apple removes deprecated stuff after 5 years.
Re:Bringing Vulkan everywhere by berkut on Tuesday August 07, 2018 @05:12PM (#17710851)
Application software doesn't necessarily want to be using low-level stuff like Vulkan just yet:

the reason being is that these low-level APIs with more direct access/control to the hardware don't (currently) provide load-balancing between multiple applications, which all OpenGL implementations (via the drivers) do currently do fairly well. i.e. so you can have two differential applications open which both fairly heavily utilise the graphics card (for drawing, not compute), and both get a fair share (depending on which has focus in some cases depending on driver settings) of the GPU.

For desktop applications where you're multi-tasking with potentially multiple applications using the graphics card this is often quite important.

For games it's obviously less so.

It's definitely a reason we're not jumping on the new low level APIs in the VFX industry currently.

Re:Bringing Vulkan everywhere by electricslpnsld on Tuesday August 07, 2018 @05:45PM (#17711139)
> It's definitely a reason we're not jumping on the new low level APIs in the VFX industry currently.

While the big studios on Linux (people like Pixar) probably don't care about the lower level APIs, the major vendors like Autodesk and SideFX are going to have to if they still want to target macOS.

Re:Bringing Vulkan everywhere by berkut on Tuesday August 07, 2018 @06:29PM (#17711463)
Possibly, but I bet they'll hold out on OpenGL for ages, and I wouldn't be surprised if push comes to shove that macOS gets dropped for VFX in the future - as a developer who used to work at The Foundry years ago, it causes so much trouble to develop for compared to Linux, and in relation to the number of people who used it I'm not sure it's worth it any more... Quite a few individuals are still using it, but there's been quite an uptick in Linux users in that area, at least where the software allows...
Re:Bringing Vulkan everywhere by VSTN on Wednesday August 08, 2018 @09:10AM (#17715578)
Some companies have already dropped future support of the mac version of their software based on Apple making it official that OpenGL is truly dead.

https://apple.slashdot.org/story/18/07/29/1939212/autodesk-d...

"According to a note posted on Autodesk's support website, while older Alias versions can run on High Sierra or earlier, "no versions of VRED will run on that operating system due to the OpenGL deprecation."

While openGL is not going to stop working on Mojave, it has served as a good excuse for autodesk to stop bothering with the work of developing mac versions and refusing to provide any support or patching of any future issue that might arise on current releases being run on mojave.

Apple is working very hard at killing the mac both because of what they've done to the hardware and what they're doing to their OS for any user that's not some grandma that does nothing outside browsing facebook on a $1500 macbook..

Re:Bringing Vulkan everywhere by sounds on Wednesday August 08, 2018 @03:54PM (#17718888)
Just to offer a counterpoint (and I'm happy to discuss), Vulkan has much better load-balancing and resource-sharing potential than OpenGL.

Resource Sharing:

--------------------

Vulkan requires the application provide verbose information about the features being used. Vulkan also reports the number and types of heaps, their sizes, and detailed information on the max number of each type of resource the application can allocate.

OpenGL allows the application to just "go for it," allocate resources without bound [1], and the driver will attempt to "make it work." The only way the application knows it has reached a limit is when the driver finally fails with GL_OUT_OF_MEMORY.

When the driver and OS need to move resources around, such as if the GPU's memory is exhausted, Vulkan applications are much easier to manage. A Vulkan application's memory will be clearly structured so that the driver can identify little-used resources and relocate them so that the next application can get the resources it needs.

Load Balancing:

-------------------

Vulkan requires the application to be much more explicit about which queues and devices the application will be using, and even what priority the application places on different loads.

OpenGL again has no such concept. An application can only access OpenGL from a single thread, and OpenGL just lets the application "go for it."

When the driver and OS need to load balance, a Vulkan application is much easier to load balance. Any rendering or compute in Vulkan is explicitly defined with clear fences, transitions and barriers. The OpenGL application's only mode of operation is "why didn't this run faster?" The GPU vendor's OpenGL driver contains hundreds of application-specific tweaks to the OpenGL API to try to accomodate one particular application. The GPU vendor's Vulkan driver has not been around long enough to accumulate much of that bitrot.

In summary, neither API explicitly triggers load-shedding behavior in the application. The Android app lifecycle is a completely different story.

On desktop machines, Vulkan and OpenGL applications are designed with very few constraints. They mostly are expected to be the main or only application running, and expect to run on machines with medium or high-end specs. The OS and driver manage load-sharing and resource-sharing silently behind the scenes. With Vulkan, however, the OS and driver have a much easier time for the reasons discussed above.

I recommend Vulkan strongly for all new development.

[1] https://stackoverflow.com/questions/6354208/glgentextures-is...