Game Development Reference
In-Depth Information
Figure 1.1: The relationship between the application, Direct3D, and the hardware
The Direct3D part of Figure 1.1 is the defined set of interfaces and
functions Direct3D exposes to the application/programmer. These
interfaces and functions represent the entire features set that the cur-
rent version of Direct3D supports. Note that just because Direct3D
exposes a feature, it doesn't imply that available graphics hardware sup-
ports it.
As Figure 1.1 shows, there is an intermediate step between
Direct3D and the graphics device—the HAL (Hardware Abstraction
Layer). Direct3D cannot interact directly with graphics devices because
there are a variety of different cards on the market, and each card has
different capabilities and ways of implementing things. For instance,
two different graphics cards may implement the clear screen operation
differently. Therefore, Direct3D requires device manufacturers to
implement a HAL. The HAL is the set of device-specific code that
instructs the device to perform an operation. In this way Direct3D
avoids having to know the specific details of a device, and its specifica-
tion can be made independent of hardware devices.
Device manufacturers implement all the features that their device
supports into the HAL. Features exposed by Direct3D but not sup-
ported by the device are not implemented into the HAL. Calling a
Direct3D function that is not implemented by the HAL results in fail-
ure, unless it's a vertex processing operation, in which case the desired
functionality can be emulated in software, if using software vertex pro-
cessing, by the Direct3D runtime. Therefore, when using esoteric
features that are only supported by a minority of devices on the market,
be sure to verify that the device supports the feature (device capabili-
ties are explained in section 1.3.8).
1.1.1 The REF Device
You may wish to write programs that use functionality that Direct3D
exposes but are not implemented on your device. For this purpose,
Direct3D provides a reference rasterizer (known as a REF device),
which emulates the entire Direct3D API in software. This allows you to
write and test code that uses Direct3D features that are not available
on your device. For example, in Part IV of this topic, we use vertex and
pixel shaders, which many cards do not support. If your graphics card
Search WWH ::




Custom Search