Hacker News new | ask | show | jobs
by ionafgnio 2951 days ago
Is there a legitimate reason for D3D12 to exist? It seems like just a locked-down version of Vulkan to me intended to kill cross-platform gaming (textbook Microsoft Embrace, Extend, Extinguish). I haven't heard of any advantages in performance or ease of development. But I'm certainly no expert.

Unrelated note: there's something really funky going with the comparison between the desktop and the laptop. The desktop is pretty high-end and should just obliterate that Macbook. It's seriously weird that they're so close. I'm not sure I trust the results.

5 comments

> ease of development

Apart from the fact that DirectX 12 predates Vulkan by a substantial margin (and includes APIs for more than graphics), this is a pretty major reason. The API itself is only one concern and I can't tell whether it's easier or harder to use OpenGL (assuming an expert at both) - it's just different. The tooling surrounding it is a completely different story.

Even during DirectX 9 there was a tool that would show you the state of all your backbuffers after draw calls[1]. It was extremely spartan, but with such a simple tool debugging shaders became enormously easier. I'm not sure if anything exists for OpenGL today. They productized this and more in VS2017[2] - including being able to step through shaders in a debugger. The big draw to the Windows platform for developers has always been the tooling and Microsoft knows this.

VS and DirectX aren't going away until people stop regarding them a "just a text editor" and "just an API" respectively. It would help if people earnestly competed with what Microsoft is doing, instead of dismissing their products for no other reason than dogma.

> Microsoft Embrace, Extend, Extinguish

That ended with the exit of Balmer.

[1]: https://tomtech999.wordpress.com/2011/09/07/debugging-direct...

[2]: https://msdn.microsoft.com/en-us/library/hh315751.aspx

> I'm not sure if anything exists for OpenGL today.

A few years ago Crytek open sourced this: https://renderdoc.org/

I’ve mostly used the tool with DX11, but they also support OpenGL, GLES and Vulkan.

There are several good reasons. D3D12 was finalized some time before Vulkan and was available in early / preview versions for quite a while before that. Stable drivers were available much sooner than for Vulkan. It was an easier transition for code bases that already had D3D11 support and Microsoft offered additional code to help with the transition (the D3D11 on 12 stuff). You could bring your existing HLSL shaders over easily. There were better debugging and profiling tools available sooner. The Xbox One got some additional extensions to better utilize its hardware.
OpenGL always lagged behind proprietary 3D APIs.

Microsoft is not alone, people keep forgetting OpenGL never mattered on game consoles.

Even Vulkan is supported on the Swift, the main 3D API is NVN.

Some of the benefits of DirectX, proper 3D API, with a toolkit that supports math, fonts, textures, sprites instead of playing "go fish" libraries, OOP API, OOP shading language, nice debugging integrated into visual studio.

Same applies to the other 3D APIs.

Game developers care about their IP, how it gets into each platform is secondary to that.

> there's something really funky going with the comparison between the desktop and the laptop.

The OP has relatively old GPU in the desktop, GeForce GTX 770 is from 2013, it delivers up to 3.2 TFlops single precision.

The laptop is much newer, its’ from 2016, and the Intel GPU delivers 0.7-0.8 TFlops. The raw computational power is different, but not 10 times different, just 4 times.

The reason why OP has measured 2 times difference not 4 times is probably because data access costs. Intel GPU is integrated so it has very fast access to system RAM. nVidia GPU in the desktop needs to copy data from system RAM to VRAM over the PCIx. PCIx is slower, both bandwidth (CPU to RAM: 34.1 GB/s, PCIx 3.0: 985 MB/s per lane i.e. 15.76 GB/s for 16x), and especially latency.

> The desktop is pretty high-end and should just obliterate that Macbook

I was also a little surprised at how well the MacBook performed, but it's quite reproducible for me. To be fair, this desktop is actually about 5 years old, and it wasn't really "top of the line" when I built it.