Platform SDK: DirectX

D3DPRIMCAPS

The D3DPRIMCAPS structure defines the capabilities for each primitive type. This structure is used when creating a device and when querying the capabilities of a device. This structure defines several members of the D3DDEVICEDESC7 structure.

typedef struct _D3DPrimCaps { 
    DWORD dwSize;               //Size of structure
    DWORD dwMiscCaps;           //Miscellaneous capabilities
    DWORD dwRasterCaps;         //Raster capabilities
    DWORD dwZCmpCaps;           //Z-comparison capabilities
    DWORD dwSrcBlendCaps;       //Source-blending capabilities
    DWORD dwDestBlendCaps;      //Destination-blending capa bilities
    DWORD dwAlphaCmpCaps;       //Alpha-test-comparison capabilities
    DWORD dwShadeCaps;          //Shading capabilities
    DWORD dwTextureCaps;        //Texture capabilities
    DWORD dwTextureFilterCaps;  //Texture-filtering capabilities
    DWORD dwTextureBlendCaps;   //Texture-blending capabilities
    DWORD dwTextureAddressCaps; //Texture-addressing capabilities
    DWORD dwStippleWidth;       //Stipple width
    DWORD dwStippleHeight;      //Stipple height
} D3DPRIMCAPS, *LPD3DPRIMCAPS; 

Members

dwSize
Size, in bytes, of this structure. This member must be initialized before the structure is used.
dwMiscCaps
General capabilities for this primitive. This member can be one or more of the following:
D3DPMISCCAPS_CONFORMANT
The device conforms to the OpenGL standard.
D3DPMISCCAPS_CULLCCW
The driver supports counterclockwise culling through the D3DRENDERSTATE_CULLMODE state. (This applies only to triangle primitives.) This corresponds to the D3DCULL_CCW member of the D3DCULL enumerated type.
D3DPMISCCAPS_CULLCW
The driver supports clockwise triangle culling through the D3DRENDERSTATE_CULLMODE state. (This applies only to triangle primitives.) This corresponds to the D3DCULL_CW member of the D3DCULL enumerated type.
D3DPMISCCAPS_CULLNONE
The driver does not perform triangle culling. This corresponds to the D3DCULL_NONE member of the D3DCULL enumerated type.
D3DPMISCCAPS_LINEPATTERNREP
The driver can handle values other than 1 in the wRepeatFactor member of the D3DLINEPATTERN structure. (This applies only to line-drawing primitives.)
D3DPMISCCAPS_MASKPLANES
The device can perform a bitmask of color planes.
D3DPMISCCAPS_MASKZ
The device can enable and disable modification of the depth buffer on pixel operations.
dwRasterCaps
Information on raster-drawing capabilities. This member can be one or more of the following:
D3DPRASTERCAPS_ANISOTROPY
The device supports anisotropic filtering. For more information, see D3DRENDERSTATE_ANISOTROPY in the D3DRENDERSTATETYPE structure.

This flag was introduced in DirectX 5.0.

D3DPRASTERCAPS_ANTIALIASEDGES
The device can antialias lines forming the convex outline of objects. For more information, see D3DRENDERSTATE_EDGEANTIALIAS in the D3DRENDERSTATETYPE structure.

This flag was introduced in DirectX 5.0.

D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT
The device supports antialiasing that is dependent on the sort order of the polygons (back-to-front or front-to-back). The application must draw polygons in the right order for antialiasing to occur. For more information, see the D3DANTIALIASMODE enumerated type.

This flag was introduced in DirectX 5.0.

D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT
The device supports antialiasing that is not dependent on the sort order of the polygons. For more information, see the D3DANTIALIASMODE enumerated type.

This flag was introduced in DirectX 5.0.

D3DPRASTERCAPS_DITHER
The device can dither to improve color resolution.
D3DPRASTERCAPS_FOGRANGE
The device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene. For more information, see Range-based Fog.

This flag was introduced in DirectX 5.0.

D3DPRASTERCAPS_FOGTABLE
The device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.
D3DPRASTERCAPS_FOGVERTEX
The device calculates the fog value during the lighting operation, places the value into the alpha component of the D3DCOLOR value given for the specular member of the D3DTLVERTEX structure and interpolates the fog value during rasterization.
D3DPRASTERCAPS_MIPMAPLODBIAS
The device supports level-of-detail (LOD) bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about LOD bias in mipmaps, see D3DTSS_MIPMAPLODBIAS.
D3DPRASTERCAPS_PAT
The driver can perform patterned drawing (lines or fills with D3DRENDERSTATE_LINEPATTERN or one of the D3DRENDERSTATE_STIPPLEPATTERN render states) for the primitive being queried.
D3DPRASTERCAPS_ROP2
The device can support raster operations other than R2_COPYPEN.
D3DPRASTERCAPS_STIPPLE
The device can stipple polygons to simulate translucency.
D3DPRASTERCAPS_SUBPIXEL
The device performs subpixel placement of z, color, and texture data, rather than working with the nearest integer pixel coordinate. This helps avoid bleed-through due to z imprecision and jitter of color and texture values for pixels. There is no corresponding state that can be enabled and disabled; the device either performs subpixel placement, or it does not. This bit is present only so that the you can better determine what the rendering quality will be.
D3DPRASTERCAPS_SUBPIXELX
The device is subpixel-accurate along the x-axis only and is clamped to an integer y-axis scan line. For information about subpixel accuracy, see D3DPRASTERCAPS_SUBPIXEL.
D3DPRASTERCAPS_TRANSLUCENTSORTINDEPENDENT
The device supports translucency that is not dependent on the sort order of the polygons. For more information, see D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT.
D3DPRASTERCAPS_WBUFFER
The device supports depth buffering using w. For more information, see Depth Buffers.
D3DPRASTERCAPS_WFOG
The device supports w-based fog. W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.
D3DPRASTERCAPS_XOR
The device can support XOR operations. If this flag is not set but D3DPRIM_RASTER_ROP2 is set, XOR operations must still be supported.
D3DPRASTERCAPS_ZBIAS
The device supports z-bias values. These are integer values assigned to polygons that allow physically coplanar polygons to appear separate. For more information, see D3DRENDERSTATE_ZBIAS in the D3DRENDERSTATETYPE enumerated type.

This flag was introduced in DirectX 5.0.

D3DPRASTERCAPS_ZBUFFERLESSHSR
The device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring the allocation of a depth-buffer. This leaves more video memory for textures. The method used to perform hidden-surface removal is hardware-dependent and is transparent to the application.

Z-bufferless HSR is performed if no depth-buffer surface is attached to the rendering-target surface and the depth-buffer comparison test is enabled (that is, when the state value associated with the D3DRENDERSTATE_ZENABLE enumeration constant is set to TRUE).

D3DPRASTERCAPS_ZFOG
The device supports z-based fog.

This flag was introduced in DirectX 7.0.

D3DPRASTERCAPS_ZTEST
The device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels have been rendered.
dwZCmpCaps
Z-buffer comparison capabilities. This member can be one or more of the following:
D3DPCMPCAPS_ALWAYS
Always pass the z test.
D3DPCMPCAPS_EQUAL
Pass the z test if the new z equals the current z.
D3DPCMPCAPS_GREATER
Pass the z test if the new z is greater than the current z.
D3DPCMPCAPS_GREATEREQUAL
Pass the z test if the new z is greater than or equal to the current z.
D3DPCMPCAPS_LESS
Pass the z test if the new z is less than the current z.
D3DPCMPCAPS_LESSEQUAL
Pass the z test if the new z is less than or equal to the current z.
D3DPCMPCAPS_NEVER
Always fail the z test.
D3DPCMPCAPS_NOTEQUAL
Pass the z test if the new z does not equal the current z.
dwSrcBlendCaps
Source-blending capabilities. This member can be one or more of the following. (The RGBA values of the source and destination are indicated by the subscripts s and d.)
D3DPBLENDCAPS_BOTHINVSRCALPHA
Source blend factor is (1–As, 1–As, 1–As, 1–As), and destination blend factor is (As, As, As, As); the destination blend selection is overridden.
D3DPBLENDCAPS_BOTHSRCALPHA
The driver supports the D3DBLEND_BOTHSRCALPHA blend mode. (This blend mode is obsolete for DirectX 6.0 and later. For more information, see D3DBLEND.)
D3DPBLENDCAPS_DESTALPHA
Blend factor is (Ad, Ad, Ad, Ad).
D3DPBLENDCAPS_DESTCOLOR
Blend factor is (Rd, Gd, Bd, Ad).
D3DPBLENDCAPS_INVDESTALPHA
Blend factor is (1–Ad, 1–Ad, 1–Ad, 1–Ad).
D3DPBLENDCAPS_INVDESTCOLOR
Blend factor is (1–Rd, 1–Gd, 1–Bd, 1–Ad).
D3DPBLENDCAPS_INVSRCALPHA
Blend factor is (1–As, 1–As, 1–As, 1–As).
D3DPBLENDCAPS_INVSRCCOLOR
Blend factor is (1–Rd, 1–Gd, 1–Bd, 1–Ad).
D3DPBLENDCAPS_ONE
Blend factor is (1, 1, 1, 1).
D3DPBLENDCAPS_SRCALPHA
Blend factor is (As, As, As, As).
D3DPBLENDCAPS_SRCALPHASAT
Blend factor is (f, f, f, 1); f = min(As, 1-Ad).
D3DPBLENDCAPS_SRCCOLOR
Blend factor is (Rs, Gs, Bs, As).
D3DPBLENDCAPS_ZERO
Blend factor is (0, 0, 0, 0).
dwDestBlendCaps
Destination-blending capabilities. This member can be the same capabilities that are defined for the dwSrcBlendCaps member.
dwAlphaCmpCaps
Alpha-test comparison capabilities. This member can include the same capability flags defined for the dwZCmpCaps member. If this member contains only the D3DPCMPCAPS_ALWAYS capability or only the D3DPCMPCAPS_NEVER capability, the driver does not support alpha tests. Otherwise, the flags identify the individual comparisons that are supported for alpha testing.
dwShadeCaps
Shading operations capabilities. It is assumed, in general, that if a device supports a given command (such as D3DOP_TRIANGLE) at all, it supports the D3DSHADE_FLAT mode (as specified in the D3DSHADEMODE enumerated type). This flag specifies whether the driver can also support Gouraud and Phong shading and whether alpha color components are supported for each of the three color-generation modes. When alpha components are not supported in a given mode, the alpha value of colors generated in that mode is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity). Phong shading is not currently supported.

With the monochromatic shading modes, the blue channel of the specular component is interpreted as a white intensity. (This is controlled by the D3DRENDERSTATE_MONOENABLE render state.)

The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver. These are modified by the shading mode, color model, and whether the alpha component of a color is blended or stippled. For more information, see 3-D Primitives.

This member can be one or more of the following:

D3DPSHADECAPS_ALPHAFLATBLEND
D3DPSHADECAPS_ALPHAFLATSTIPPLED
Device can support an alpha component for flat blended and stippled transparency, respectively (the D3DSHADE_FLAT state for the D3DSHADEMODE enumerated type). In these modes, the alpha color component for a primitive is provided as part of the color for the first vertex of the primitive.
D3DPSHADECAPS_ALPHAGOURAUDBLEND
D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED
Device can support an alpha component for Gouraud-blended and stippled transparency, respectively (the D3DSHADE_GOURAUD state for the D3DSHADEMODE enumerated type). In these modes, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color components.
D3DPSHADECAPS_ALPHAPHONGBLEND
D3DPSHADECAPS_ALPHAPHONGSTIPPLED
Device can support an alpha component for Phong-blended and stippled transparency, respectively (the D3DSHADE_PHONG state for the D3DSHADEMODE enumerated type). In these modes, vertex parameters are reevaluated on a per-pixel basis, applying lighting effects for the red, green, and blue color components. Phong shading is not currently supported.
D3DPSHADECAPS_COLORFLATMONO
D3DPSHADECAPS_COLORFLATRGB
Device can support colored flat shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively. In these modes, the color component for a primitive is provided as part of the color for the first vertex of the primitive. In the monochromatic lighting model, only the blue component of the color is interpolated; in the RGB lighting model, the red, green, and blue components are interpolated.
D3DPSHADECAPS_COLORGOURAUDMONO
D3DPSHADECAPS_COLORGOURAUDRGB
Device can support colored Gouraud shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively. In these modes, the color component for a primitive is provided at vertices and interpolated across a face along with the other color components. In the monochromatic lighting model, only the blue component of the color is interpolated; in the RGB lighting model, the red, green, and blue components are interpolated.
D3DPSHADECAPS_COLORPHONGMONO
D3DPSHADECAPS_COLORPHONGRGB
Device can support colored Phong shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively. In these modes, vertex parameters are reevaluated on a per-pixel basis. Lighting effects are applied for the red, green, and blue color components in the RGB model, and for the blue component only for the monochromatic model. Phong shading is not currently supported.
D3DPSHADECAPS_FOGFLAT
D3DPSHADECAPS_FOGGOURAUD
D3DPSHADECAPS_FOGPHONG
Device can support fog in the flat, Gouraud, and Phong shading modes, respectively. Phong shading is not currently supported.
D3DPSHADECAPS_SPECULARFLATMONO
D3DPSHADECAPS_SPECULARFLATRGB
Device can support specular highlights in flat shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively.
D3DPSHADECAPS_SPECULARGOURAUDMONO
D3DPSHADECAPS_SPECULARGOURAUDRGB
Device can support specular highlights in Gouraud shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively.
D3DPSHADECAPS_SPECULARPHONGMONO
D3DPSHADECAPS_SPECULARPHONGRGB
Device can support specular highlights in Phong shading in the D3DCOLOR_MONO and D3DCOLOR_RGB color models, respectively. Phong shading is not currently supported.
dwTextureCaps
Miscellaneous texture-mapping capabilities. This member can be one or more of the following:
D3DPTEXTURECAPS_ALPHA
Supports RGBA textures in the D3DTBLEND_DECAL and D3DTBLEND_MODULATE texture filtering modes. If this capability is not set, only RGB textures are supported in those modes. Regardless of the setting of this flag, alpha must always be supported in D3DTBLEND_DECALMASK, D3DTBLEND_DECALALPHA, and D3DTBLEND_MODULATEALPHA filtering modes whenever those filtering modes are available.
D3DPTEXTURECAPS_ALPHAPALETTE
Supports palettized texture surfaces whose palettes contain alpha information (see DDPCAPS_ALPHA in the DDCAPS structure).
D3DPTEXTURECAPS_BORDER
Superseded by D3DPTADDRESSCAPS_BORDER.
D3DPTEXTURECAPS_COLORKEYBLEND
The device supports alpha-blended colorkeying through the use of the D3DRENDERSTATE_COLORKEYBLENDENABLE render state.
D3DPTEXTURECAPS_CUBEMAP
Supports cubic environment mapping. This capability flag was introduced with DirectX 7.0
D3DPTEXTURECAPS_NONPOW2CONDITIONAL
Conditionally supports the use of textures with dimensions that are not powers of 2. A device that exposes this capability can use such a texture if all of the following requirements are met.
D3DPTEXTURECAPS_PERSPECTIVE
Perspective correction is supported.
D3DPTEXTURECAPS_POW2
All nonmipmapped textures must have widths and heights specified as powers of 2. (Mipmapped textures must always have dimensions that are powers of 2.)
D3DPTEXTURECAPS_PROJECTED
Supports the D3DTTFF_PROJECTED texture transformation flag. When applied, the device divides transformed texture coordinates by the last texture coordinate.
D3DPTEXTURECAPS_SQUAREONLY
All textures must be square.
D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE
Texture indices are not scaled by the texture size prior to interpolation.

This flag was introduced with DirectX 7.0

D3DPTEXTURECAPS_TRANSPARENCY
Texture transparency is supported. (Only those texels that are not the current transparent color are drawn.)
dwTextureFilterCaps
Texture-filtering capabilities. General texture-filtering flags reflect which texture-filtering modes are supported and can be set for the D3DTSS_MAGFILTER, D3DTSS_MINFILTER, or D3DTSS_MIPFILTER texture-stage states. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending with the IDirect3DDevice7 interface. This member can be any combination of the following general and per-stage texture-filtering flags:
General texture-filtering flags
D3DPTFILTERCAPS_LINEAR
Bilinear filtering. Chooses the texel that has the nearest coordinates, then performs a weighted average with the four surrounding texels to determine the final color. This applies to both zooming in and zooming out. If either zooming in or zooming out is supported, both must be supported.
D3DPTFILTERCAPS_LINEARMIPLINEAR
Trilinear interpolation between mipmaps. Performs bilinear filtering on the two nearest mipmaps, then interpolates linearly between the two colors to determine a final color.
D3DPTFILTERCAPS_LINEARMIPNEAREST
Linear interpolation between two point-sample mipmaps. Chooses the nearest texel from the two closest mipmap levels, then performs linear interpolation between them.
D3DPTFILTERCAPS_MIPLINEAR
Nearest mipmapping, with bilinear filtering applied to the result. Chooses the texel from the appropriate mipmap that has the nearest coordinates, then performs a weighted average with the four surrounding texels to determine the final color.
D3DPTFILTERCAPS_MIPNEAREST
Nearest mipmapping. Chooses the texel from the appropriate mipmap with coordinates nearest to the desired pixel value.
D3DPTFILTERCAPS_NEAREST
Point sampling. The texel with coordinates nearest to the desired pixel value is used. This applies to both zooming in and zooming out. If either zooming in or zooming out is supported, both must be supported.
Per-stage texture filtering flags
D3DPTFILTERCAPS_MAGFAFLATCUBIC
The device supports per-stage flat cubic filtering for magnifying textures. The flat cubic magnification filter is represented by the D3DTFG_FLATCUBIC member of the D3DTEXTUREMAGFILTER enumerated type.
D3DPTFILTERCAPS_MAGFANISOTROPIC
The device supports per-stage anisotropic filtering for magnifying textures. The anisotropic magnification filter is represented by the D3DTFG_ANISOTROPIC member of the D3DTEXTUREMAGFILTER enumerated type.
D3DPTFILTERCAPS_MAGFGAUSSIANCUBIC
The device supports the per-stage Gaussian cubic filtering for magnifying textures. The Gaussian cubic magnification filter is represented by the D3DTFG_GAUSSIANCUBIC member of the D3DTEXTUREMAGFILTER enumerated type.
D3DPTFILTERCAPS_MAGFLINEAR
The device supports per-stage bilinear interpolation filtering for magnifying textures. The bilinear interpolation magnification filter is represented by the D3DTFG_LINEAR member of the D3DTEXTUREMAGFILTER enumerated type.
D3DPTFILTERCAPS_MAGFPOINT
The device supports per-stage point-sample filtering for magnifying textures. The point-sample magnification filter is represented by the D3DTFG_POINT member of the D3DTEXTUREMAGFILTER enumerated type.
D3DPTFILTERCAPS_MINFANISOTROPIC
The device supports per-stage anisotropic filtering for minifying textures. The anisotropic minification filter is represented by the D3DTFN_ANISOTROPIC member of the D3DTEXTUREMINFILTER enumerated type.
D3DPTFILTERCAPS_MINFLINEAR
The device supports per-stage bilinear interpolation filtering for minifying textures. The bilinear minification filter is represented by the D3DTFN_LINEAR member of the D3DTEXTUREMINFILTER enumerated type.
D3DPTFILTERCAPS_MINFPOINT
The device supports per-stage point-sample filtering for minifying textures. The point-sample minification filter is represented by the D3DTFN_POINT member of the D3DTEXTUREMINFILTER enumerated type.
D3DPTFILTERCAPS_MIPFLINEAR
The device supports per-stage trilinear interpolation filtering for mipmaps. The trilinear interpolation mipmapping filter is represented by the D3DTFP_LINEAR member of the D3DTEXTUREMIPFILTER enumerated type.
D3DPTFILTERCAPS_MIPFPOINT
The device supports per-stage point-sample filtering for mipmaps. The point-sample mipmapping filter is represented by the D3DTFP_POINT member of the D3DTEXTUREMIPFILTER enumerated type.
dwTextureBlendCaps
Not used.

In previous releases of DirectX, this member contained information about the driver's capability for applying texture-blending through the now-obsolete D3DRENDERSTATE_TEXTUREMAPBLEND render state. Information about the texture-blending capabilities for a DirectX 7.0 device is exposed in the dwTextureOpCaps member of the D3DDEVICEDESC7 structure.

dwTextureAddressCaps
Texture-addressing capabilities. This member can be one or more of the following:
D3DPTADDRESSCAPS_BORDER
Device supports setting coordinates outside the range [0.0, 1.0] to the border color, as specified by the D3DTSS_BORDERCOLOR texture-stage state.
D3DPTADDRESSCAPS_CLAMP
Device can clamp textures to addresses.
D3DPTADDRESSCAPS_INDEPENDENTUV
Device can separate the texture-addressing modes of the u and v coordinates of the texture. This ability corresponds to the D3DTSS_ADDRESSU and D3DTSS_ADDRESSV render-state values.

This flag was introduced in DirectX 5.0.

D3DPTADDRESSCAPS_MIRROR
Device can mirror textures to addresses.
D3DPTADDRESSCAPS_WRAP
Device can wrap textures to addresses.
dwStippleWidth and dwStippleHeight
Maximum width and height of the supported stipple (up to 32×32).

Requirements

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Version: Requires DirectX 2.0 or later.
  Header: Declared in d3dcaps.h.