So you've finally gotten your hot little hands
on a shiny new graphics card for your PC, and you're confident that by pushing it to its limits,
you'll be able to run any game at mouth-watering settings.
But it turns out there's a long-standing bottleneck
that limits how many frames your GPU can push.
And we're not talking about your CPU or the PCI Express slot.
It's actually the GPU's pipeline, the set of steps that visual data has to go through
in order to become a fully rendered image. But how does that pipeline bottleneck
your gaming experience? Let's find out by learning how a graphics pipeline works.
And we'd like to extend our warm thanks to Jianye Liu, Senior Program Manager at Microsoft
for helping us understand the problem and the solution that's starting to gain adoption.
The first three steps of the pipeline, called the geometry pipeline, are really important
and actually end up being where the bottleneck is. Step one is when the raw visual data,
basically just numbers, plain numbers, like mama used to make them, goes through an input assembler,
which takes the vertices of the triangles that ultimately make up a finished image
and organizes them so that they're pointing at each other correctly.
Step two takes this organized set of vertices and puts them through a vertex shader,
which raises or lowers the vertices to create a 3D mesh of sorts.
For example, the vertex shader can create a bumpy texture on a wall or ripples on a pond.
The third step is a rasterizer. This is the bit that puts pixels inside each triangle
to fill out the image. Now, there are other steps beyond these three,
namely pixel shading, which gives each pixel
the appropriate color and lighting, and the output merger, which puts different visual elements
together, such as ensuring a character standing in front of a wall is displayed properly
so you only see the character and not the wall behind them.
However, the big bottleneck we're talking about today involves those first three steps.
But why are they such a bottleneck? I mean, the process seems pretty straightforward.
Well, there are a few big reasons for this. One is that that first step, the input assembler,
can only understand data that's organized in a very specific way.
Typically, it can't accept compressed data that can be moved around more quickly.
Or if a developer thinks of a more efficient way to organize their data,
the input assembler simply won't be able to understand it. Two, there are actually several optional stages
after the vertex shader. For example, one is called a geometry shader
that can take a point and expand it out to a particular shape, such as a strand of hair.
This is quicker than drawing a bunch of new triangles, but the geometry shader and other optional steps
have been added over the years as games have become more complex.
They're essentially glommed onto the pipeline in a rigid, sequential way that can't be processed
in parallel, meaning they take longer. Three, because of this rigid sequence,
you have to wait until you get to the rasterizer to start culling.
Sounds dangerous. Or throwing away unused triangles that are way off
in the distance or obscured by an object on the screen. This is a problem because by the time the data
has gotten to the rasterizer phase of the pipeline, the GPU has already done a ton of legwork
rendering unnecessary triangles.
Sounds like my typical Wednesday evening. So because the geometry pipeline is so inflexible,
the solution isn't to retool it. It's to replace it completely.
This is where mesh shading comes in, one of the biggest features in the DirectX 12 Ultimate API.
Instead of having discrete steps before the rasterizer,
the mesh shader is one stage that can do a few really cool things.
First, the data that you feed into it can be much more arbitrary
so it can understand compressed data and other data sets an old school input assembler couldn't.
You can't handle this new data old man. Essentially, the mesh shader is almost
like a mini programmable computer. So if a developer wants to accomplish some rendering task
more efficiently, they can just code it in. Each of the processes above can also intelligently
communicate with each other within a mesh shader. So instead of waiting to cull triangles
so late in the process, it can be done earlier. And the geometry can even be arranged in a way
to make culling easier, demanding even less GPU power.
Oh, and we haven't even talked about the whole reason it's called mesh shading in the first place.
It's a really fun term, meshlets.
Instead of working on one triangle at once, your GPU can instead work on meshes
of multiple triangles in parallel. So instead of making a decision about culling one triangle,
your GPU can instead do them in batches. Throwing out data, it doesn't need a process
and saving precious resources. Older vertex shaders only saw a soup of points
instead of an actual mesh, but mesh shaders are much smarter
and they can know exactly what they're working with much earlier in the rendering process.
So what does all of this mean? Well, because your GPU doesn't have to work
as hard for each frame, it means faster frame rates and more detailed environments.
Ultimately, the things we all want from our graphics cards.
Currently, many game developers are looking at the best ways to implement mesh shading into their titles
because it's such a customizable tool and the old geometry pipeline
has been around for such a long time. It might take a few years before we see widespread adoption
of mesh shading in popular games. The good news though, is that there's already
hardware support for it with newer consumer graphics cards.
So by the time we see these games on the market, chances are we'll all have next-gen graphics cards
that support these new features. Every one of us.
Yes! I can't wait.
Well guys, that's a Techquickie video. Not sure if you've ever seen one before,
but that's what it's like. Hey, speaking of like, you wanna like the video
if you liked it? Hey, do you have a like? Do you have a like to give out?
Please, we love your likes. Also check out other videos,
comment below with video suggestions and don't forget to subscribe and follow Techquickie.
Love you.