Gadgetory


All Cool Mind-blowing Gadgets You Love in One Place

What is DirectX and How Does it Work? (DX11 vs. DX12)

2016-07-19
when an architect decides to build a building he or she doesn't just start building it has to be designed first it requires blueprints and if the building is especially tall it requires several hundred blueprints same goes for game developers they don't simply envision some epic game and then immediately begin playing it ridiculous and heading serious developer would be offended if that was all but you thought they did to connect this analogy blueprints for game designers are api's application programming interfaces Direct X as we know it today is a library packed full of api's and without it most of the games you likely play wouldn't exist let's start off with API in short picture a district attorney by the name of I don't know Sam Sam represents the video game coder Sam has been practicing law for twenty years but he doesn't know everything every now and then he has to refer to state and federal law books to ensure that he's properly prosecuting these laws are essentially the codes by which he must abide and venturing outside of these guidelines could be catastrophic for his particular case or even career you get no argument from me there but if your obstruction allows a massacre to happen I will crucify you mr. Kralik I will charge you with negligent homicide and after I convict you I'll resign my job and represent the families of the victims in a wrongful death suit against you in the Union by the time I'm done you'll be finished much in the same way an application programming interface is a guy that programmers should follow when designing video games around a particular platform and in the case of DirectX that platform or operating system rather is Windows now DirectX in and of itself isn't a single API it's actually a collection of them rules and regulations if you will for various media including audio video and games direct sound direct play and direct3d have all been integral api's of DirectX in the past however for the sake of this video and for the sake of gaming we'll be focusing primarily on direct3d as it's the API responsible for 3d graphics generation when a developer utilizes direct3d he or she is opening up a world of endless possibilities the API allows for the utilization of onboard and discrete graphics which we'll discuss more detail in just a sec making for a user-friendly 3d interface perfect for game coders who require visual representations of what they're actually coding in the API direct3d is currently at odds OpenGL a similar 3d graphics API although most of what you'll see today and play today will rely on Direct X speaking of which how does DirectX take advantage of graphics hardware is DirectX partial towards one graphics card manufacturer or the other and what is the difference or what are the differences between DirectX 11 and DirectX 12 let's start with question one how does DirectX take advantage of graphics cards it's actually quite simple when a programmer writes a code within direct3d that requires a solid sphere let's say to rotate Windows will utilize the DirectX 3d API to instruct the primary display device typically a dedicated graphics card to execute the program code for instance the code may require the use of shader pipelines within a GPU I discuss processor pipelines in more detail in the video right here it may also request that anti-aliasing hardware and other blending effects begin working at a hardware level to generate the rotating sphere and as long as the graphics card in question is relatively new and not a potato when it comes to gaming performance these commands will be executed almost instantaneously and without fail if however your card was not designed with either DirectX 11 or 12 in mind windows and in the case of DirectX 12 Windows 10 will inform you that no discrete display adapter is available to utilize that API picture like a foreign language the Arafa card cannot comprehend nor interpret if good old District Attorney Sam can't read his own law books how on earth is he supposed to prosecute now let's tackle question 2 is DirectX partial towards one graphics card manufacturer well in all fairness this question is actually worded a bit incorrectly since DirectX particularly direct3d and graphics cards are always evolving in all ways proving it's difficult to gauge whether the display card manufacturer or the API developers or a fault per se at any given time in the case of DirectX 11 it has been noted that Nvidia takes the cake and especially moderate resolutions 1080 and 720p this however is not the fault of DirectX but rather the fault of AMD don't shoot me red fans just hear me out things will get better for you GC & Architecture heavily favors something known as parallelism in which several thousand graphics cores handle large workload simultaneously but in order to do this efficiently GCN demands a great deal of CPU horsepower to feed the graphics card information if the CPU has read weak cores or simply not enough of them the AMD counterpart will suffer to a greater and under the DirectX 11 library which was designed to fully utilize a maximum of two cores this is why owners of AMD graphics cards attest to Intel CPUs yielding much higher frame rates than their AMD counterparts since Intel CPUs have higher IPC's and generally stronger single cores then let's say the FX lineup from AMD they're able to process and send more data to the hungry open CL frameworks of AMD GPUs essentially the less extreme the cpu bottleneck the more advantageous owning an AMD graphics card becomes from Nvidia standpoint CUDA technology is designed to process and execute in a much more linear pattern benefiting platforms with a greater deal of CPU overhead ie DirectX 11 since CPUs are designed to process data swiftly in small diverse chunks and since CUDA is designed to handle serial operations at a generally faster rate than that of OpenCL NVIDIA edged out additional DirectX 11 performance gains whereas AMD was crippled by its rather far-fetched and futuristic technology however DirectX 12 and the new direct3d api have sought to change that incomes question 3 how exactly are DirectX 11 and DirectX 12 different well as DirectX has evolved from its early 2 & 3 versions up to its pre teen years Hardware overhead has dramatically increased but this is actually on purpose graphics cards are growing more and more powerful by the second every new release is a giant leap forward the GTX 1080 is a prime example now what DirectX 12 seeks to do primarily is two things this o is substantially larger deal of graphics rendering responsibilities directly upon the CPU and increase the number of fully UI CPU cores this reduces CPU bottlenecking and latency obviously while at the same time maximizing graphics card Hardware asynchronous compute 2 comes to mind but that is for an entirely separate crash course you gonna take it DirectX 12 is also the reasons many assume the FX lineup notably the FX 6300 and the FX 8350 would have a sudden resurgence thanks to their many integer course and while this may be the case in theory we have yet to fully understand how the 12th version of direct3d utilizes these relatively weak course as more DirectX 12 based games are released this should become more clear but in the case of graphics processing DirectX 12 undeniably favors AMD this isn't just coming from a scientific standpoint that world observations out there as well in this scenario it's the API that favors the graphics hardware although you could look at this from a different perspective that Nvidia CUDA technology wasn't changed to a great enough degree to benefit from DirectX 12 in the same way AMD has who saw this coming 10 years ago regardless AMD has the edge this time around and that's thanks to fully realized asynchronous compute Hardware reduced driver overhead and maximized parallelism parallelism parallelism if you liked what you saw in this video be sure to give it a thumbs up give it a thumbs down if you feel the complete opposite or if you hate everything about light be sure to click the subscribe button have it ready stay tuned for more crash courses here on the channel sorry folks no gtx 1060 stuff today I guess we're just not glorious enough to be noticed by Nvidia at this point we'll change that hopefully at some point but for now least your pros on DirectX right this is science studio thanks for learning this you
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.