OpenGL Faster Than DirectX - Or Is It?
Written by Harry Fairhead   
Friday, 03 August 2012

It is being reported that Valve has found OpenGL to be faster than DirectX, but the real conclusion is slightly more complicated.

Valve is well known for its fast PC-based graphics and if anyone knows anything about DirectX you would expect it to be Valve. However, a recent blog post suggests that, even with all that knowledge, it wasn't possible to get DirectX working as fast as a port to OpenGL.

 

opengllogo

 

This looks damming for DirectX, especially so when the port to OpenGL even ran faster under Windows - i.e. OpenGL under Windows is faster than DirectX.

The game Left4Dead 2 was ported to a 32-bit version of Linux and initially it achieved 6 fps, which isn't unreasonable for a direct port of a program optimized to run under Windows/DirectX. The setup was:

Hardware

  • Intel Core i7 3930k
  • NVIDIA GeForce GTX 680
  • 32 GB RAM

Software

  • Windows 7 Service Pack 1 64-bit
  • Left 4 Dead 2
  • Ubuntu 12.04 32-bit

After three levels of optimization:

  • Modifying the game to work better with the kernel
  • Modifying the game to work better with OpenGL
  • Optimizing the graphics driver

the frame rate shot up to 315 fps. This is to be compared to the optimized Windows/DirectX frame rate of 270.6 fps. The graphics driver improvements also resulted in the Windows OpenGL version running at 303 fps, which still beat the DirectX version.

This does seem to be a long way from what you might expect, given the time already taken to get the DirectX version running as fast as possible. However, to quote from the Valve blog:

This experience lead to the question: why does an OpenGL version of our game run faster than Direct3D on Windows 7? It appears that it’s not related to multitasking overhead. We have been doing some fairly close analysis and it comes down to a few additional microseconds overhead per batch in Direct3D which does not affect OpenGL on Windows. Now that we know the hardware is capable of more performance, we will go back and figure out how to mitigate this effect under Direct3D.

So the problem with Direct3D isn't something deep and structural, but a small overhead on each graphics operation that adds up. As the Valve blog says, given that the problem is now identified there might be something that can be done to speed up DirectX to run faster.

This isn't quite as damning as some news reports suggest. It has been used as proof that DirectX is in some way deeply flawed. Of course it might be, but on the basis of what has been presented it seems that DirectX is a little (around 15%) worse than OpenGL. In addition a lot of work has been done to improve the Linux OpenGL drivers and it isn't clear how much this contributed to the speed up.

 

opengllogo

 

What you can say from the result is that OpenGL is a high performance graphics platform - as long as you have the right drivers installed.

 

More Information

Valve Linux Blog

Related Articles

OpenGL 3D fluid simulation (video)

OpenGL GPU Smoke simulation

blog comments powered by Disqus

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner


Immutable No Longer As Lazy
04/11/2014

Immutable is intended to bring persistent data collections to Javascript. Pioneered by Facebook, it is open source and has just reached version 3.0.0. 



Neural Turing Machines Learn Their Algorithms
05/11/2014

Another breakthrough at Google DeepMind? A neural network form of the Turing machine architecture is proposed and demonstrated, and it does seem to learn its algorithms.


More News
   

Last Updated ( Friday, 03 August 2012 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2014 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.