|
本帖最后由 xman2343 于 2009-8-12 06:27 编辑
DX10算是革新式的结构,可以类比于 windows7和vista对于 XP 的变化。
不同的是DX10算是一帆风顺,毕竟从DX8,DX9 MS就开始在做放弃固定管线的工作了。DX10有一个很好的铺垫。
不过采用SHADER来渲染 DX10没有比DX9慢的可能性,例如孤岛之类的,不管是DX9,DX10模式都是用的shader在渲染,而shader的执行效率目前只取决于显卡厂商,毕竟MS还没能力一边倒的压制ATI和NVIDIA。
当然孤岛DX10下采用的功能要多些,自然就慢些,至于画面就只能说看他们的美术细胞。不过DX10支援了更多的功能,就意味着创作者有更多的手段来创造画面。 如果DX10也全完用和DX9相同的SHADER,速度不应该不同。 而且DX9也不是不能跑DX10的效果,如果NVIDIA或者ATI愿意的话,让他们XP下面的驱动也把Shader Model 4.0的代码送给显卡,就是DX8也能支援现在的Shader Model 4.0,毕竟现在市面卖的主流显卡都是支援Shader Model 4.0的。 DX10主要还是的架构优于DX8,DX9,编程比DX8,DX9安全和便捷了。
DX10和DX9大致区别如下。
The general API usage for Direct3D 10 is in its basic structure not unlike previous versions of Direct3D. The process of rendering using the Direct3D 10 device is structurally similar to Direct3D 9 where you follow the flow of a pipeline:
Set a vertex stream source,
Set input layout (Vertex Stream Decl in Direct3D 9 speak),
Declare primitive topology,
Set textures,
Set state objects,
Set shaders,
Draw
Where the Draw command is the call that ties the operations of the "Set" calls together and the ordering of Set's is arbitrary so long as they occur before the "Draw". The major differences in the Direct3D 10 API design are as follows:
Removal of Fixed Function
Removal of CAPS bits - Direct3D 10's base feature set is guaranteed
Stricter management of
resource access,
device state,
shader constants,
shader linkage (inputs and outputs to shaders) between stages
API entry point names changed to reflect the virtualization of GPU memory (Map() instead of Lock()).
Provision of a Debug Layer which may be added to the device at creation time
Primitive Topology broken out from the Draw Call, this is now an explicit device state
Constant buffer slots on the device instead of explicit constants
Shader authoring is done entirely in HLSL. The HLSL compiler now resides in the primary Direct3D 10 DLL.
New programmable stage - the Geometry Shader (GS)
Shorter stage names in the API
VS - Vertex Shader, GS - Geometry Shader, PS - Pixel Shader
Removal of Begin Scene / End Scene
Common 2D, focus and adapter-management functionality refactored into a new component: DXGI
We will discuss many of the items listed above in more detail during the rest of this document. |
|