图形学书籍 Real-Time Rendering 3.2 GPU Pipeline Overview GPU管线概述(根据谷歌翻译修改)

3.2 GPU Pipeline Overview GPU管线概述

The GPU implements the conceptual geometry processing, rasterization, and pixel processing pipeline stages described in Chapter 2. These are divided into several hardware stages with varying degrees of configurability or programmability. Figure 3.2 shows the various stages color coded according to how programmable or configurable they are. Note that these physical stages are split up somewhat differently than the functional stages presented in Chapter 2.

GPU 实现第 2 章中描述的概念性几何处理、光栅化和像素处理管线阶段。这些阶段分为几个具有不同程度的可配置性或可编程性的硬件阶段。 图 3.2 显示了根据可编程或可配置性进行颜色编码的各个阶段。 请注意,这些物理阶段的划分与第 2 章中介绍的功能阶段有所不同。

3.2

Figure 3.2. GPU implementation of the rendering pipeline. The stages are color coded according to the degree of user control over their operation. Green stages are fully programmable. Dashed lines show optional stages. Yellow stages are configurable but not programmable, e.g., various blend modes can be set for the merge stage. Blue stages are completely fixed in their function.

图 3.2: 渲染管线的 GPU 实现。 这些阶段根据用户对其操作的控制程度进行颜色编码。 绿色阶段是完全可编程的。 虚线表示可选阶段。 黄色阶段是可配置(configurable)的但不是可编程的,例如,可以为合并阶段(merge stage)设置各种混合模式(blend modes)。 蓝色阶段的功能完全固定(fixed)。

We describe here the logical model of the GPU, the one that is exposed to you as a programmer by an API. As Chapters 18 and 23 discuss, the implementation of this logical pipeline, the physical model, is up to the hardware vendor. A stage that is fixed-function in the logical model may be executed on the GPU by adding commands to an adjacent programmable stage. A single program in the pipeline may be split into elements executed by separate sub-units, or be executed by a separate pass entirely. The logical model can help you reason about what affects performance, but it should not be mistaken for the way the GPU actually implements the pipeline.

我们在这里描述了 GPU 的逻辑模型,即通过 API 向程序员展示的模型。 正如第 18 章和第 23 章所讨论的,这个逻辑管道、物理模型的实现取决于硬件供应商。 通过向相邻的可编程阶段添加命令,可以在 GPU 上执行逻辑模型中固定功能( fixed-function)的阶段。 流水线中的单个程序可以拆分为由单独的子单元们执行的元素,或者完全由单独的通道执行。 逻辑模型可以帮助您推断影响性能的因素,但不应将其误认为是 GPU 实际实现管线的方式。

The vertex shader is a fully programmable stage that is used to implement the geometry processing stage. The geometry shader is a fully programmable stage that operates on the vertices of a primitive (point, line, or triangle). It can be used to perform per-primitive shading operations, to destroy primitives, or to create new ones. The tessellation stage and geometry shader are both optional, and not all GPUs support them, especially on mobile devices.

顶点着色器是一个完全可编程的阶段,用于实现几何处理阶段。 几何着色器是一个完全可编程的阶段,它在图元(点、线或三角形)的顶点上运行。 它可用于执行每个图元的着色操作、销毁图元或创建新图元。 曲面细分阶段和几何着色器都是可选的,并非所有 GPU 都支持它们,尤其是在移动设备上。

The clipping, triangle setup, and triangle traversal stages are implemented by fixed-function hardware. Screen mapping is affected by window and viewport settings, internally forming a simple scale and repositioning. The pixel shader stage is fully programmable. Although the merger stage is not programmable, it is highly configurable and can be set to perform a wide variety of operations. It implements the “merging” functional stage, in charge of modifying the color, z-buffer, blend, stencil, and any other output-related buffers. The pixel shader execution together with the merger stage form the conceptual pixel processing stage presented in Chapter 2.

裁剪、三角形设置(triangle setup)和三角形遍历阶段由固定功能(fixed-function)硬件实现。 屏幕映射受窗口和视口(viewport)设置的影响,在内部形成简单的缩放(scale)和重新定位(repositioning)。 像素着色器阶段是完全可编程的。 虽然合并阶段(merger stage)不可编程,但它是高度可配置的,可以设置为执行各种各样的操作。 它实现了“合并(merging)”功能阶段,负责修改颜色、z 缓冲区、混合、模板和任何其他与输出相关的缓冲区。 像素着色器执行与合并阶段一起构成了第 2 章中介绍的概念性像素处理阶段。

Over time, the GPU pipeline has evolved away from hard-coded operation and toward increasing flexibility and control. The introduction of programmable shader stages was the most important step in this evolution. The next section describes the features common to the various programmable stages.

随着时间的推移,GPU 流水线已经从硬编码操作演变为增加灵活性和控制。 可编程着色器阶段的引入是这一演变过程中最重要的一步。 下一节将介绍各种可编程阶段的共同特征。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值