Processing Vertex Data

The IDirect3DDevice9 interface supports vertex processing in both software and hardware. In general, the device capabilities for software and hardware vertex processing are not identical. Hardware capabilities are variable, depending on the display adapter and driver, while software capabilities are fixed.

    IDirect3DDevice9接口同时支持软件和硬件进行顶点处理。通常,软件和硬件顶点处理的设备性能并不相同。硬件性能是可变的,它依赖显示适配器和驱动程序,而软件性能是固定的。

The following flags control vertex processing behavior for the hardware abstraction layer (HAL) and reference devices.

    下面的标识为硬件抽象层和引用设备控制顶点处理的行为。

  • D3DCREATE_SOFTWARE_VERTEXPROCESSING
  • D3DCREATE_HARDWARE_VERTEXPROCESSING
  • D3DCREATE_MIXED_VERTEXPROCESSING

Specify one of the vertex processing behavior flags when calling CreateDevice. The mixed-mode flag enables the device to perform both software and hardware vertex processing. Only one vertex processing flag may be set for a device at any one time. Note that the D3DCREATE_HARDWARE_VERTEXPROCESSING flag is required to be set when creating a pure device (D3DCREATE_PUREDEVICE).

    在调用CreateDevice时指定一个顶点处理的行为标识。混合模式标识允许设备进行软件和硬件的顶点处理。一次只能为设备设置一个顶点处理标识。注意:当创建纯设备(pure device)时需要设置D3DCREATE_HARDWARE_VERTEXPROCESSING标识。

To avoid dual vertex processing capabilities on a single device, only the hardware vertex processing capabilities can be queried at run time. Software vertex processing capabilities are fixed and cannot be queried at run time.

    在单个设备上避免双重顶点处理能力,在运行时只有硬件顶点处理能力能被查询。软件顶点处理能力在运行时时固定的,无法查询。

You can consult the VertexProcessingCaps member of the D3DCAPS9 structure to determine the hardware vertex processing capabilities of the device. For software vertex processing the following capabilities are supported.

    可以参考D3DCAPS9结构中VertexProcessingCaps成员以确定设备的硬件顶点处理能力。软件顶点处理支持下列能力。

  • the D3DVTXPCAPS_DIRECTIONALLIGHTS member of D3DVTXPCAPS
  • the D3DVTXPCAPS_LOCALVIEWER member of D3DVTXPCAPS
  • the D3DVTXPCAPS_MATERIALSOURCE7 member of D3DVTXPCAPS
  • the D3DVTXPCAPS_POSITIONALLIGHTS member of D3DVTXPCAPS
  • the D3DVTXPCAPS_TEXGEN member of D3DVTXPCAPS
  • the D3DVTXPCAPS_TWEENING member of D3DVTXPCAPS

In addition, the following table lists the values that are set for members of the D3DCAPS9 structure for a device in software vertex processing mode.

    此外,下表列出设备在软件顶点处理模式中需设置的D3DCAPS9结构的成员的值。

Member

Software vertex processing capabilities

MaxActiveLights

Unlimited

MaxUserClipPlanes

6

MaxVertexBlendMatrices

4

MaxStreams

16

MaxVertexIndex

0xFFFFFFFF

Software vertex processing provides a guaranteed set of vertex processing capabilities, including an unbounded number of lights and full support for programmable vertex shaders. You can toggle between software and hardware vertex processing at any time when using the hal device, the only device type that supports both hardware and software vertex processing. The only requirement is that vertex buffers used for software vertex processing must be allocated in system memory.

    软件顶点处理提供可保证的顶点处理能力集,包括无限制的光源数量和对可编程的顶点着色器的完全支持。你可以在使用硬件抽象层设备的任意时间绑定软件和硬件顶点处理,该唯一设备同时支持硬件和软件顶点处理。唯一的要求是用于软件顶点处理的顶点缓存必须在系统内存中分配。

Note    The performance of hardware vertex processing is comparable to that of software vertex processing. For this reason, it's a good idea to provide, within a single device type, both hardware- and software-emulation functionality for vertex processing. This is not the case for rasterization, for which host processors are much slower than specialized graphics hardware. Thus both hardware- and software-emulated rasterization is not provided within a single device type. Software vertex processing is the only instance of functionality duplicated between the run time and the hardware (driver) within a single device. Thus all other device capabilities represent potentially variable functionality provided by the driver.

注意:硬件顶点处理与软件顶点处理的性能是可比较的。为此,在单个设备类型上为顶点处理同时提供硬件和软件模拟功能是个好主意。栅格化和主机处理器远慢于图形硬件的情况则不行。因此在单个设备类型上不同时提供硬件和软件模拟栅格化。软件顶点处理是在运行时和单个设备的硬件(驱动程序)之间可复制的功能的唯一实例。所有其他表现为潜在可变功能的设备能力由驱动程序提供。


英语不行,有些句子不知道怎么翻译。。。