A trip through the graphics pipeline 2011 Part 10(翻译)

之前的几篇翻译都烂尾了,这篇希望。。。。能好些,恩,还有往昔呢。

------------------------------------------------------------

第十部分

译:minggoddess

欢迎回来。上一次,我们一头扎进了像素管线的最底端。这次,切换到管线的中间位置看一下伴随D3D10而来的大概是最引人注目扩展:几何着色器(Geometry Shaders)。

但首先呢,我会先讲一下我在本系列中如何分解图形管线,这与你从APIs角度看到的景象是多么的不同。

多重管线/对管线阶段的剖析

尽管第三部分已经提及过,因为它特别重要,所以我还要再重复一次:如果你去看比如,D3D10的文档,你就会发现D3D10管线的文档。你会发现有一份D3D10管线的示意图

包含了可能涉及到的各个阶段。这个D3D10管线里会包含几何着色器,,即使你没有设置过几何着色器,同样对输出流(Stream-Out)也是如此。在纯功能型的D3D10模型中,

几何着色器阶段总是在那里的;如果你没有设置几何着色器,它就会很简单(和没意思):数据仅仅从这里以不被修改的方式传递到下面的阶段(光栅化阶段/输出流)。

这是使用API的正确方法,但是却不是我们在本系列中了解这件事的好方法。我们更关心的是硬件是如何实现这种功能模型的呢。那么,到目前为止,我们看到的这两个着色器阶段

(VS和PS)是怎样的呢?对于顶点着色器(VS), 我们了解了输入装配器(IA--Input Assembler)。IA为着色准备了顶点数据块,然后把这一批次分发到一个着色单元。

着色单元处理了一会儿之后,我们得到了返回结果并把结果写到缓冲区(供面片装配用)。确保它们按照正确的顺序进行装配,然后把它们发到下一个管线阶段(剔除/裁剪等等)。

对于像素着色器(PS),我们接受到从光栅化阶段发过来的,准备被着色的四边形,把它们批量缓存起来,直到ps着色器单元空闲下来,可以接收新的批次时,把这一批次的数据分发

到一个着色单元。同样在着色器单元处理一会儿之后,我们的到处理结果并把结果写到缓冲区(供使用),确保它们是正确的顺序,然后做混合和延迟深度剔除(late Z)然后把结果

发到内存,听起来有点熟悉,是吗?

实际上,如果我们想让着色器单元帮我们做事情,就总是这样的情况:我们先是需要一个缓冲区,然后一些分发逻辑(实际上这部分逻辑很普遍,所以可以被所有着色器类型

所共享),然后我们扩展这一行为到一束着色器上进行并行运算。最终我们需要另一个缓冲区和有排序功能的单元来处理前面的运算结果。

时间: 2024-10-09 08:08:35

A trip through the graphics pipeline 2011 Part 10(翻译)的相关文章

A trip through the Graphics Pipeline 2011_01

It’s been awhile since I posted something here, and I figured I might use this spot to explain some general points about graphics hardware and software as of 2011; you can find functional descriptions of what the graphics stack in your PC does, but u

A trip through the Graphics Pipeline 2011_09_Pixel processing – “join phase”

Welcome back! This post deals with the second half of pixel processing, the “join phase”. The previous phase was all about taking a small number of input streams and turning them into lots of independent tasks for the shader units. Now we need to fol

A trip through the Graphics Pipeline 2011_08_Pixel processing – “fork phase”

In this part, I’ll be dealing with the first half of pixel processing: dispatch and actual pixel shading. In fact, this is really what most graphics programmer think about when talking about pixel processing; the alpha blend and late Z stages we’ll e

A trip through the Graphics Pipeline 2011_10_Geometry Shaders

Welcome back. Last time, we dove into bottom end of the pixel pipeline. This time, we’ll switch back to the middle of the pipeline to look at what is probably the most visible addition that came with D3D10: Geometry Shaders. But first, some more word

A trip through the Graphics Pipeline 2011_06_(Triangle) rasterization and setup

Welcome back. This time we’re actually gonna see triangles being rasterized – finally! But before we can rasterize triangles, we need to do triangle setup, and before I can discuss triangle setup, I need to explain what we’re setting things up for; i

A trip through the Graphics Pipeline 2011_03

At this point, we’ve sent draw calls down from our app all the way through various driver layers and the command processor; now, finally we’re actually going to do some graphics processing on it! In this part, I’ll look at the vertex pipeline. But be

A trip through the Graphics Pipeline 2011_02

Welcome back. Last part was about vertex shaders, with some coverage of GPU shader units in general. Mostly, they’re just vector processors, but they have access to one resource that doesn’t exist in other vector architectures: Texture samplers. They

A trip through the Graphics Pipeline 2011_05

After the last post about texture samplers, we’re now back in the 3D frontend. We’re done with vertex shading, so now we can start actually rendering stuff, right? Well, not quite. You see, there’s a bunch still left to do before we actually start ra

A trip through the Graphics Pipeline 2011_07_Z/Stencil processing, 3 different ways

In this installment, I’ll be talking about the (early) Z pipeline and how it interacts with rasterization. Like the last part, the text won’t proceed in actual pipeline order; again, I’ll describe the underlying algorithms first, and then fill in the