dk2 at September 25th, 2013 23:37 — #1
Looks like a new API is going to be replacing DirectX 11, on AMD GPUs at least. I haven't looked at the details, but anyone know why AMD is able to provide better performance with Mantle, but not with DirectX?
reedbeta at September 26th, 2013 03:03 — #2
I don't think that question will be fully answerable until we have a lot more technical details about Mantle. But if, as they say, it's a "console-style" API, there are three major differences that I can speculate might be present:
- Direct application control over video memory allocation
- Command buffers built directly by the application
- Shaders pre-compiled all the way to the fully optimized GPU microcode, rather than a device-independent intermediate language
Each of these things would remove huge swaths of code and complexity from the graphics driver, with corresponding improvements in CPU performance. Some of the driver logic must be moved to the application instead, but then it can be implemented in an app-specific way that is likely much simpler than the general case.
For example, the memory management system in a PC graphics driver has to be able to deal with absolutely any pattern of allocs/frees that an application could conceivably do. It has to take care of such possibilities as the app freeing resources that the GPU is still using, the app using
MAP_WRITE_DISCARD or similar and forcing the driver to make shadow copies of things, or the app allocating more memory than the GPU actually has, forcing the driver to page things in and out of system memory. The kind of book-keeping and data management needed to support that level of generality is not at all trivial.
In contrast, a game engine could simply have a pre-determined memory layout like on a console. (Actually probably a handful of layouts to support GPUs with greater or lesser amounts of memory.) The driver would just hand you a big block of video memory and you could poke your resources into it wherever you want, having pre-determined exactly how much memory you want for each resource or buffer. Essentially zero run-time book-keeping.
Again, this is all just speculation and I don't have any knowledge of what Mantle actually does. I'm just illustrating that there are lots of CPU performance gains to be had by slimming down the API. There's a reason why PC games are limited to \~3,000 draw calls but consoles can push over 10,000. There might be GPU gains to be had as well in some cases, but I'd expect those to be relatively minor.
fireside at September 26th, 2013 09:07 — #3
I can see it maybe being used because companies will be writing for consoles anyway, so no big deal to also port to PC with that tech. This is one of the advantages of AMD scoring all the consoles.
reedbeta at September 30th, 2013 16:14 — #4
Another thing I'll be very interested in hearing about is whether Mantle does anything to extend current shading languages, or whether it still uses HLSL/GLSL. There are some hardware features that aren't exposed in the standard languages. That would be a big chunk of work and might well be outside the scope of what they're doing, though.
AMD have said more details are supposed to come out in November, so we'll see what they say.