图形管道的哪些部分是使用CPU和CPU完成的图形处理器?

发布于 2024-09-04 04:23:17 字数 385 浏览 6 评论 0原文

管道的哪些部分是使用 CPU 完成的,哪些部分是使用 GPU 完成的?

阅读有关图形管道的维基百科,也许我的问题并不完全代表我要问的内容。

参考这个问题,哪些“步骤”是在CPU中完成的,哪些是在GPU中完成的?

编辑:
我的问题更多的是[从文件]显示地形+3D 模型所需的逻辑高级步骤的哪些部分正在使用 CPU/GPU,而不是哪些函数。

Which parts of pipelines are done using CPU and which are done using GPU?

Reading Wikipedia on Graphics Pipeline, maybe my question does not precisely represent what I am asking.

Referring to this question, which "steps" are done in CPU and which are done in GPU?

Edit:
My question is more into which parts of logical high level steps needed to display terrain+3D models [from files] are using CPU/GPU instead of which functions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天赋异禀 2024-09-11 04:23:17

管道的哪些部分是使用 CPU 完成的,哪些部分是使用 GPU 完成的?

据我所知...
完全取决于硬件、驱动程序和opengl 实现。
您可以在 OpenGL 中执行的所有操作都有效,但您无法 100% 确定处理发生的位置 - 它很方便地对您隐藏(这实际上是 OpenGL 的优点之一)。
有全软件 OpenGL 模拟器,例如 - mesa3d(未经认证)。
将此类 opengl32.dll(如果您在 Windows 上)放入程序文件夹中,所有内容都将在 CPU 上运行。

通常,光栅化(管道的最后阶段 - alpha 混合、放置像素、ztest)是在硬件中完成的。使用旧显卡,其余功能可能会在 CPU 上运行。顶点变换、顶点操作,甚至标准光照都可以在 CPU 上完成(并且它们很长一段时间都是在 CPU 上完成)——具体取决于显卡。然而,我必须承认,没有硬件 TL(变换和光照)支持的显卡已经相当陈旧了。 AFAIK,如果卡仅支持 DirectX 7 的完整硬件加速(特定于 Windows 平台),则转换和照明始终在 CPU 上执行。

不过,在 openGL 中可能有平台相关的方式来获取显卡功能。

旁注:
DirectX 为您提供有关卡功能的更多信息,以及控制发生情况的方法(即,即使显卡支持硬件加速,您也可以选择软件 T&L - 在某些情况下这可能是必要的)。这会带来一些损失 - DirectX 不如 OpenGL 灵活,更难使用,更难实验,它比 OpenGL 可用的平台更少,并且担心哪些功能受支持、哪些不支持需要开发时间。

Which parts of pipelines are done using CPU and which are done using GPU?

As far as I know...
It depends entirely on the hardware, driver and opengl implementation.
Everything you can do in OpenGL, works, but you can't be 100% sure where processing happens - it is conveniently hidden from you (it is actually one of OpenGL benefits).
There are full-software OpenGL emulators, for example - mesa3d (non-certified).
Put such opengl32.dll (if you're on windows) into your program folder, and everything will be running on CPU.

Typically, rasterization (last stage of pipeline - alpha-blend, putting pixel, ztest) is done in hardware. Get old videocard, and it is possible that the rest of functionality will run on CPU. Vertex transformations, vertex manipulations, and even standard lighting can be done on CPU (and they were done on CPU for a long time) - depending on videocard. However, I must admit that that videocards without hardware TL (transform and lighting) support are quite old. AFAIK, transformation and lighting is always performed on CPU if card only supports full hardware acceleration of DirectX 7 (windows-platform specific).

There may be platform dependent way to get videocard capabilities in openGL, though..

Side note:
DirectX gives you more information about card capabilities, and a ways to control what happens where (i.e. you can choose software T&L even if videocard supports hardware acceleration - in some cases this may be necessarry). This comes with penalty - DirectX is less flexible than OpenGL, harder to use, harder to experiment with, it is available on less platforms than OpenGL, and worrying about which feature is supported and which isn't takes development time.

莫言歌 2024-09-11 04:23:17

答案取决于什么 GPU(因为它们在硬件功能上有所不同,特别是在集成 GPU 上),但在现代非集成 GPU 上,整个管道都是在硬件中实现的。这包括剔除、z 排序和遮挡。

集成芯片组,例如英特尔的芯片组,具有较少的硬件功能,例如,它们通常进行转换和转换。使用软件照明。

The answer depends on what GPU (since they differ in HW capabilities, specially in integrated ones), but on modern non-integrated GPUs, the entire pipeline is implemented in HW. This includes culling, z-sort and occlusion.

Integrated chipsets, such as Intel's, have less HW features, for example, they usually do tranformation & lighting using software.

浅笑轻吟梦一曲 2024-09-11 04:23:17

这在很大程度上取决于系统配置,至少CPU必须向GPU发出命令(发送顶点列表、上传纹理等),而GPU通常会完成所有几何变换、纹理映射、光照等。

但在许多情况下,如果硬件不支持某些功能,GPU 应该做的部分工作可能会由 CPU 完成。

如果您使用 3D 引擎,它还可能对 CPU 进行一些预优化,以减少 GPU 必须处理的三角形数量,例如丢弃已知隐藏的几何图形的预先部分(通过使用 BSP 的例如,像 IdTech 引擎或像虚幻引擎这样的门户)。

移动和旋转模型网格(例如行走动画)之类的事情通常是在 CPU 中完成的,但现在我猜趋势也将是硬件加速它们。

关于维基百科链接,其中提到的所有步骤通常都是在 GPU 中完成的,但由 CPU 中运行的软件来决定将发送哪些多边形进行处理(即使它们稍后被 GPU 丢弃,因为它们被隐藏或位于视锥体之外)。

It depends a lot on the system configuration, at least the CPU has to issue the commands to the GPU (send vertices lists, upload textures, etc.), and the GPU usually does all the geometric transformations, texture mappings, lighting, etc.

But in many cases, part of the work that the GPU should be doing might be done by the CPU if the hardware doesn't support certain features.

If you're using a 3D engine, it might also do some pre-optimizations on the CPU to alleviate the number of triangles that the GPU has to process, like discarding beforehand parts of the geometry that are known to be hidden (by using BSP's like IdTech engines or Portals like Unreal Engine, for example).

Things like moving and rotating the meshes of the models (e.g. the walking animations) are usually done in the CPU, but nowadays I guess the trend would be to HW accelerate them too.

Regarding the wikipedia link, all the steps mentioned there are usually done in the GPU, but is up to the software running in the CPU to decide what polygons are going to be sent for processing (even if they are discarded by the GPU later on because they're hidden or out of the viewing frustrum).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文