Direct3D编程的新手:11 vs 12 [英] New to Direct3D programming: 11 vs 12

查看:209
本文介绍了Direct3D编程的新手:11 vs 12的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于D3D编程的新手来说,是应该直接学习D3D12还是在学习D3D12之前必须学习D3D11?

For a newbie in D3D programming, should one just learn D3D12 directly or is D3D11 necessary before diving into D3D12?

假设从头开始并具有不错的C ++知识,我应该走哪条路?

Assuming starting from scratch and decent knowledge of C++, which way should I go?

推荐答案

我已经回答了

I've answered this question before so you should take a look at that post.

简而言之,应该将Direct3D 12视为"DirectX Extreme Pro".假定您已经是Direct3D 11运行时工作原理的专家,并且基本上可以自己编写.它旨在使中间件引擎和低级图形开发人员可以最大程度地控制GPU的行为. Direct3D 11还是一个低级"图形API,但是DirectX 12具有如此薄的抽象,以至于许多复杂的现代GPU都直接暴露给应用程序程序员. Direct3D 11对您隐藏的复杂性.

In short, Direct3D 12 should be thought of as "DirectX Extreme Pro". It assumes you are already an expert in how the Direct3D 11 runtime works to the point that you can basically write it yourself. It is designed to allow middleware engines and low-level graphics developers to have maximum control over the behavior of the GPU. Direct3D 11 is also a "low-level" graphics API, but DirectX 12 has such a thin abstraction that many complexities of modern GPUs are exposed directly to the application programmer; complexities that Direct3D 11 hides from you.

Direct3D 12非常强大,但是要实现非常低的CPU开销,API和运行时对您的帮助很少.这样就暴露了驱动程序的内存模型,并使GPU/CPU同步成为手动过程,类似于CPU上的无锁编程".

Direct3D 12 is very powerful, but to achieve a very low CPU overhead, the API and runtime do very little to help you out. This exposes the memory model of the driver and makes the GPU/CPU synchronization a manual process that's a bit akin to 'lock-free programming' on the CPU.

如果您是Direct3D的新手,我强烈建议您从 DirectX工具套件及其<使用Direct3D 11的a href ="https://github.com/Microsoft/DirectXTK/wiki/Getting-Started" rel ="noreferrer">教程在适合您的应用程序的地方迁移到Direct3D 12.

If you are entirely new to Direct3D, I strongly suggest you start with DirectX Tool Kit and its tutorials using Direct3D 11. Once you've mastered that, you should be in a good place to move to Direct3D 12 when it makes sense for your applications.

有关Direct3D 11的大量教程,示例,书籍和其他教育资料.Direct3D 12资料有点薄,主要由

There's a ton of tutorials, samples, books, and other educational material on Direct3D 11. The Direct3D 12 material is a bit thin, mainly consisting of the content on the DirectX-Graphics-Samples GitHub repo. I'm currently working on adding DirectX 12 support to DirectX Tool Kit, but even when it is available you'll find that starting with Driect3D 11 is a lot easier than trying to jump feet-first into DirectX 12.

要记住的另一件事到DirectX 12:仅在启用了DirectX 12的视频驱动程序的Windows 10系统上支持.这包括大多数 Direct3D功能级别 11.0+硬件,包括NVIDIA Fermi,Kepler,Maxwell; AMD GCN;以及英特尔的Haswell,Broadwell和Skylake.但是,这不包括任何较旧的视频卡.参见 DirectX 12:游戏的大步 AMD DirectX 12技术

The other thing to keep in mind w.r.t. to DirectX 12: It is supported only on Windows 10 systems with DirectX 12 enabled video drivers. This includes most Direct3D Feature Level 11.0+ hardware including NVIDIA Fermi, Kepler, Maxwell; AMD GCN; and Intel's Haswell, Broadwell, and Skylake. This, however, does not include any older video cards. See DirectX 12: A Major Stride for Gaming, AMD DirectX 12 Technology, and DirectX Developer Blog

更新:用于DirectX 12的DirectX工具套件现在可用,包括基本教程.在处理Direct3D 12之前,您应该专注于学习Direct3D11.DirectX 12是专为图形专家设计的API,对于新手来说是相当宽容的. DirectX工具套件可以使边缘稍微柔化,但幅度不大.一般而言,除非您达到Direct3D 11的CPU性能极限,否则就无需使用Direct3D12.也就是说,对于图形专家而言,值得学习以更好地了解底层GPU硬件的工作方式,或者是那些希望推动GPU硬件发展的人.硬件达到性能极限.

UPDATE: DirectX Tool Kit for DirectX 12 is now available including basic tutorials. You should focus on learning Direct3D 11 before tackling Direct3D 12. DirectX 12 is an API designed for graphics experts and is quite unforgiving to newbies. DirectX Tool Kit helps soften the edges a little, but not much. Generally speaking, unless you are hitting the CPU performance limits of Direct3D 11 there's no need to use Direct3D 12. That said, for graphics experts it's worth learning to have a better understanding of how the underlying GPU hardware works, or those wanting to push the hardware to the limits of performance.

更新2:我应该根据最近的一些经验来提一下,如果您主要使用DirectX工具包中提供的功能(精灵,精灵字体,基本基元和模型等),切换从DirectX 11到DirectX 12版本相当简单.另外,如果您想使用 DirectX光线跟踪 DirectML

UPDATE 2: I should mention that based on some recent experience, if you mainly use the functionality provided in the DirectX Tool Kit (sprites, spritefont, basic primitives and models, etc.), switching from the DirectX 11 to DirectX 12 version is fairly straight-forward. Also, if you want to use DirectX Raytracing, DirectML, or Shader Model 6, you need to use DirectX 12 instead of DirectX 11. Of course, most game developers actually use existing 3rd party engines like Unity or Unreal Engine which abstract the API so it's more an issue of your target platform instead of usability for those cases.

这篇关于Direct3D编程的新手:11 vs 12的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆