Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Upcoming Vulkan Drivers.

This thread is locked; no one can reply to it. rss feed Print
Upcoming Vulkan Drivers.
Thinkal VB
Member #16,859
May 2018

I heard that OpenGL is going to be replaced with Vulkan. If so, did it affect the cross-platform compatibility of Allegro?. If so shouldn't we be porting the code to depend on Vulkan?

SiegeLord
Member #7,827
October 2006
avatar

OpenGL will never be gone, so that's not an issue. What Vulkan does provide is an opportunity to write an Allegro driver from scratch, this time knowing what the usage patterns are and making super fast.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Chris Katko
Member #1,881
January 2002
avatar

Vulkan isn't replaced by OpenGL. I mean, effectively, AAA will use it instead. But, OpenGL isn't going away.

- OpenGL is a higher-abstraction layer API.

- Vulkan is a lower-abstraction layer API (like Glide was). That means YOU have to manually do a LOT MORE to get something running. IIRC, the "basic example Vulkan" code is over 1000 lines.

But Vulkan offers pure speed (IF you know what you're doing), and multi-CPU and multi-GPU support. And that's what AAA needs. (Looking forward, "6K and 8K will require multi-GPU solutions" according to AMD and nVidia, so Vulkan is getting ready for that.)

But most people who aren't running a large studio aren't going to see a need. OpenGL/DirectX are still going to be blazing fast. Vulkan is for those who don't mind hiring dedicated engineers to get even faster.

Hell, DirectX just added Ray Tracing support. DirectX isn't going anywhere either.

{"name":"dxr-seed.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/2\/b287fd50a06c521a4b9afc6f3fab9ccc.jpg","w":3840,"h":2160,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/2\/b287fd50a06c521a4b9afc6f3fab9ccc"}dxr-seed.jpg

{"name":"wqGZMizrayl9O3Pl.jpg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/5\/3551427c594f05d5c3dc67006008afa2.jpg","w":1021,"h":510,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/5\/3551427c594f05d5c3dc67006008afa2"}wqGZMizrayl9O3Pl.jpg

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

SiegeLord
Member #7,827
October 2006
avatar

That's probably not DirectX9, which is what Allegro uses :P. The mental model for DX11+ is likely very similar to what Vulkan requires anyway... Personally, I'm pretty excited to give it a shot, it's a lot funner to write new code than fixing the old one ;).

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Chris Katko
Member #1,881
January 2002
avatar

To be clear, I'm not opposed to Vulkan drivers.

I'm saying that >90% of Allegro users may not see any useful gain, and to get that gain, they may need to drastically alter (and manually manage) lots of additional assets that drivers normally would handle.

It's the assembly of video programming. You can make faster code, but you're going to need to know exactly what you're doing and how to do it, to get results.

That may change in 5-10 years! Vulkan should be on everyone's radar as the multi-GPU setup WILL BE REQUIRED for 6K/8K of any modern art complexity, so cards are going to start shipping with them.

Hell, look how long it's taken to get the "next-gen" from the 1080 line. We still only have the 1080. Released... in 2016!!!! So nVidia is waiting either because bitcoin inflation is making them money hand-over-fist, or, they're having production problems, or, they're still waiting/researching/developing multi-GPU solutions.

As of June 4th, nVidia CEO said "GTX 1180 is 'a long time from now'" whereas they were slated for this summer, then end of this year, and now "???". (Half-Life 3 confirmed.)

I guess that's a tangent. But it's certainly information about the industry as a whole.

So big disclaimer: I have no direct Vulkan programming experience. I've read plenty of articles, looked at sample code, but never wrote my own. My only points are that, 1) It's not needed (as in, if we don't make one, Allegro is dead and your programs won't run or will run like piss low.) 2) It's way more difficult than going between DirectX and OpenGL. It's like trying to go from modern OpenGL... to Glide, and then add a ton of new technology. Those who know about Glide know it was both much harder to program, and blazing fast, because of the low-level API. It also died super fast because it wasn't forward compatible (no support for 32-bit color, for example!) but Vulkan won't be designed that way so that's not applicable.

<edit>

Yeah, I googled Vulkan examples. This is the first result. To get a TRIANGLE on the screen, it's over 1100 lines

https://github.com/SaschaWillems/Vulkan/blob/master/examples/triangle/triangle.cpp

Yes, some are comments. But the comments also represent required knowledge to use functions.

And browse through here and the shear amount of NEW topics most Allegro users wouldn't know about:

https://github.com/SaschaWillems/Vulkan

Pipelines, descriptor sets, dynamic uniform buffesr, push constants, specialization constants, sub-passes, offscreen rendering. That's all in the "basics" section.

Skipping advanced section, the performance section includes, multi-threaded command buffer generation, instancing, indirect calling, occlusion queries, and pipeline statistics. And that doesn't cover physics, deferred rendering, and compute shaders. (whole other sections)

This is NOT an API learned in a day (or even a week!). This is an endeavor.

So again, wanna try to port Allegro? Have at it, best of luck! Just make sure you know what you're getting into.

But unlike fixed-mode OpenGL, for example, you can't just go "Okay, setup a window, and draw a cube." and then later learn how to make it fast. You HAVE to think of it in the fast way in Vulkan--or not at all. It's not designed for beginners. It's designed for professionals.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

SiegeLord
Member #7,827
October 2006
avatar

I've done a bit of OpenCL in the past, it too had quite a bit of upfront setup with command queues etc. I don't think it'll be that bad.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Thinkal VB
Member #16,859
May 2018

Thank you SiegeLord and Chris Katko for your valuable discussion on this matter.
I am humbled ....
This article is the reason for me to make this post - I just want allegro to continue; This is one of the best super cool libraries to work with. It would be a big loss for the future generations if they can't have a taste of this library.
https://www.pcgamer.com/developers-fear-for-mac-gaming-as-apple-deprecates-opengl-support/

Elias
Member #358
May 2000

Note that Apple also "deprecated" Vulkan - officially they want you to use Metal which is some weird Apple clone of DirectX/Vulkan. However as others have said, OpenGL and Vulkan aren't going anywhere and will continue to work on Apple devices with third-party support.

--
"Either help out or stop whining" - Evert

Thinkal VB
Member #16,859
May 2018

Thank you Elias, for replaying
I think Apple is nuts ;D:P
They force things down others throat.

Neil Roy
Member #2,229
April 2002
avatar

There is no way in hell I will ever write anything for that! It requires an insane amount of programming just to put a basic triangle on the screen. And I thought shaders were bad. I'm starting to like the old immediate mode OpenGL again. I may write something in it just out of spite! ;)

I think Apple's Metal will be like Microsoft's DirectX. It will exist, and probably used for Apple only products by some developers, perhaps with an option for the user to choose OpenGL instead, like many products and OpenGL/DirectX. but OpenGL supports ALL platforms and is not too complex to program for.

I suppose in the long run, Vulkan could be worth looking into, I imagine there will be a TON of boiler plate code you could write and toss into a function or library and never have to write it again for most people anyhow. I'm barely learning OpenGL Shaders, and now I need to learn this shit all over again? Time to hang up my programming gloves, at least any hope of getting into modern 3D when it keeps f@#$%^&g changing!!! >:( (and getting harder and more convoluted)

---
“I love you too.” - last words of Wanda Roy

Thinkal VB
Member #16,859
May 2018

Ah, the world is under constant change ...
What we see today is a history for tomorrow
That's why we use libraries - so that the peoples maintaining the library do the background work for us while we concentrate more on making games. 8-);D:):P;)
I think you must consider learning that ... or use a library like https://github.com/nvpro-pipeline/VkHLF

Neil Roy
Member #2,229
April 2002
avatar

Nah, I'll do things the old way that works until it is no longer supported. They can shove their new code where the sun don't shine.

I have lived through every iteration of 3D there has ever been in computers. Just when you finally learn how to do it, they change it on you and I am sick to death of wasting my time learning new ways. Fuck 'em! When you reach my age with Vulkan2, the new better total rewrite of Vulkan you just learned to use, maybe then you will see things my way.

---
“I love you too.” - last words of Wanda Roy

Thinkal VB
Member #16,859
May 2018

Oh sir,
I am not even thinking about learning vulkan 😂 . I will be dead before making my game if I choose the vulkan path .... I stick with lovely library's like Allegro to do that dirty work for me instead.

Neil Roy
Member #2,229
April 2002
avatar

OpenGL is not hard at the moment. immediate mode wasn't hard and is still supported (otherwise old games would stop working or horribly slow down). And even shaders, once you wrap your head around it aren't terribly difficult.

I created a simple 3D "game" (not really a game of any sort) using immediate mode opengl, works fine, gets between 600 and 1800 FPS on my 8 year old hardware and my code isn't optimized and I coded it without any libraries, just straight windows + opengl code.

The fact that my unoptimized code runs this fast on old hardware tells me there is still plenty that can me made with old opengl. Now if people want Vulkan, great, but I don't think stuff like immediate mode opengl should ever be depreciated in the future, heck, it can only run faster on newer hardware.

This sort of thing is for AAA titles, and there is a huge market that is growing for more classic, old style games.

---
“I love you too.” - last words of Wanda Roy

bamccaig
Member #7,536
July 2006
avatar

I think it's good news for the Allegro developers that are enthusiastic about learning it and trying to build a new backend for Allegro. I don't imagine it'll impact Allegro users much unless they neglect the OpenGL backend as a result. But it could mean good career prospects for them, which is always nice.

Neil Roy
Member #2,229
April 2002
avatar

It certainly could attract people to Allegro if someone added in support for those drivers. I don't know what other libraries have planned, but it could be a selling point I imagine. If someone likes that sort of thing and wishes to maintain it. Not a task I would enjoy. ;)

---
“I love you too.” - last words of Wanda Roy

Thinkal VB
Member #16,859
May 2018

Yea,
Adding support for Vulkan - for Allegro is certainly not a bad thing. In future who sees what allegro becomes. I think unity and unreal are working hard to shift from OpenGL to Vulkan.

Gideon Weems
Member #3,925
October 2003

I'm impressed Vulkan is even being discussed.

SiegeLord is a coding machine. I don't understand how his carpals haven't turned to dust by now.

l j
Member #10,584
January 2009
avatar

Game engines like Unity and Unreal Engine have their own fairly static rendering pipelines. With a library like Allegro there is no such thing. Vulkan's higher performance is mostly because you must define the entire pipeline yourself with renderpasses. This pipeline is quite static in nature.

I have very little experience with Vulkan (I only ever drew a triangle) so I don't know how accurate this all is, but I'd imagine that with an API like allegro, you'd have to recreate many of the Vulkan objects at runtime. I don't think there would be much of a performance gain. In fact there might even be performance penalties in some cases. Maybe if new functions were added for 'less immediate' drawing there'd be a performance benefit?

Now if OpenGL ever does really get deprecated then I'd say adding Vulkan support is necessary.

Chris Katko
Member #1,881
January 2002
avatar

l j said:

, but I'd imagine that with an API like allegro, you'd have to recreate many of the Vulkan objects at runtime. I don't think there would be much of a performance gain. In fact there might even be performance penalties in some cases. Maybe if new functions were added for 'less immediate' drawing there'd be a performance benefit?

That's kind of what I'm getting at.

I'm not sure it's POSSIBLE to really make a "general purpose" wrapper over Vulkan that is also fast. The entire PURPOSE of Vulkan is to expose the underlying, raw hardware, of a GPU into your entire game (that is, the hardware dictates design/code-you-write, not the other way around!) so that your game models itself after whats fastest for a GPU.

Not willing to write a multi-threaded game, with deferred rendering, and GPU-physics? Well, you're not writing a Vulkan game.

With a driver, the driver figures out how to translate "your stuff" to "GPU tasks" that run on CUDA cores. With Vulkan, your game is supposed to ALREADY BE IN the correct shape to go straight to a CUDA core. If you add the translation layer yourself, there's a huge chance that layer will be slower than letting the hundreds of millions in R&D that nVidia/AMD/Intel already did to figure out how to quickly translate your random engine to what the GPU wants.

As I keep saying: I'm not opposed to anyone doing work. Do all the work you want. But just don't think "Vulkan = newer, therefor MY GAME == FASTER".

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

guilt
Member #2,553
July 2002
avatar

Vulkan's not a bad idea at all. I know few would see the benefit immediately, but if anyone's writing new games, Allegro may help reduce those 1100 lines of code.

On Windows, I personally know AMD and NVIDIA cards run Vulkan. Intel's Vulkan support seems to help as well in increasing FPS.

If someone wants to game on Linux, Vulkan still works decently on NVIDIA, AMD and Intel

Finally, for OS X, Apple has been trying to push Metal but not a lot of game developers are buying it. However, there was an implementation called MoltenVK that used to address this. Thanks to Valve, it is open source now. It runs on iOS and on many new iPhones.

This is speculation for me at this point, as it needs to be seen how incompatible the API is with Allegro. However, If Allegro took care of Vulkan and MoltenVK, I believe it would be a great value-add, and the reason to use Allegro is to reduce most of those 1100 lines :D for ex_tri.c.

Go to: