> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# D3D12_FILTER

> Specifies filtering options during texture sampling.

Specifies filtering options during texture sampling.

## Syntax

```cpp theme={null}
typedef enum D3D12_FILTER
{
    D3D12_FILTER_MIN_MAG_MIP_POINT = 0,
    D3D12_FILTER_MIN_MAG_POINT_MIP_LINEAR = 1,
    D3D12_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 4,
    D3D12_FILTER_MIN_POINT_MAG_MIP_LINEAR = 5,
    D3D12_FILTER_MIN_LINEAR_MAG_MIP_POINT = 16,
    D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 17,
    D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT = 20,
    D3D12_FILTER_MIN_MAG_MIP_LINEAR = 21,
    D3D12_FILTER_ANISOTROPIC = 85,
    D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 128,
    D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 129,
    D3D12_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 132,
    D3D12_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 133,
    D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 144,
    D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 145,
    D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 148,
    D3D12_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 149,
    D3D12_FILTER_COMPARISON_ANISOTROPIC = 213,
    D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 256,
    D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 257,
    D3D12_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 260,
    D3D12_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 261,
    D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 272,
    D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 273,
    D3D12_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 276,
    D3D12_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 277,
    D3D12_FILTER_MINIMUM_ANISOTROPIC = 341,
    D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 384,
    D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 385,
    D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 388,
    D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 389,
    D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 400,
    D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 401,
    D3D12_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 404,
    D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 405,
    D3D12_FILTER_MAXIMUM_ANISOTROPIC = 469
} D3D12_FILTER
```

## Constants

| Constant                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| D3D12\_FILTER\_MIN\_MAG\_MIP\_POINT                             | Use point sampling for minification, magnification, and mip-level sampling.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| D3D12\_FILTER\_MIN\_MAG\_POINT\_MIP\_LINEAR                     | Use point sampling for minification and magnification; use linear interpolation for mip-level sampling.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| D3D12\_FILTER\_MIN\_POINT\_MAG\_LINEAR\_MIP\_POINT              | Use point sampling for minification; use linear interpolation for magnification; use point sampling for mip-level sampling.                                                                                                                                                                                                                                                                                                                                                                                                                   |
| D3D12\_FILTER\_MIN\_POINT\_MAG\_MIP\_LINEAR                     | Use point sampling for minification; use linear interpolation for magnification and mip-level sampling.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| D3D12\_FILTER\_MIN\_LINEAR\_MAG\_MIP\_POINT                     | Use linear interpolation for minification; use point sampling for magnification and mip-level sampling.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| D3D12\_FILTER\_MIN\_LINEAR\_MAG\_POINT\_MIP\_LINEAR             | Use linear interpolation for minification; use point sampling for magnification; use linear interpolation for mip-level sampling.                                                                                                                                                                                                                                                                                                                                                                                                             |
| D3D12\_FILTER\_MIN\_MAG\_LINEAR\_MIP\_POINT                     | Use linear interpolation for minification and magnification; use point sampling for mip-level sampling.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| D3D12\_FILTER\_MIN\_MAG\_MIP\_LINEAR                            | Use linear interpolation for minification, magnification, and mip-level sampling.                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| D3D12\_FILTER\_ANISOTROPIC                                      | Use anisotropic interpolation for minification, magnification, and mip-level sampling.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| D3D12\_FILTER\_COMPARISON\_MIN\_MAG\_MIP\_POINT                 | Use point sampling for minification, magnification, and mip-level sampling. Compare the result to the comparison value.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| D3D12\_FILTER\_COMPARISON\_MIN\_MAG\_POINT\_MIP\_LINEAR         | Use point sampling for minification and magnification; use linear interpolation for mip-level sampling. Compare the result to the comparison value.                                                                                                                                                                                                                                                                                                                                                                                           |
| D3D12\_FILTER\_COMPARISON\_MIN\_POINT\_MAG\_LINEAR\_MIP\_POINT  | Use point sampling for minification; use linear interpolation for magnification; use point sampling for mip-level sampling. Compare the result to the comparison value.                                                                                                                                                                                                                                                                                                                                                                       |
| D3D12\_FILTER\_COMPARISON\_MIN\_POINT\_MAG\_MIP\_LINEAR         | Use point sampling for minification; use linear interpolation for magnification and mip-level sampling. Compare the result to the comparison value.                                                                                                                                                                                                                                                                                                                                                                                           |
| D3D12\_FILTER\_COMPARISON\_MIN\_LINEAR\_MAG\_MIP\_POINT         | Use linear interpolation for minification; use point sampling for magnification and mip-level sampling. Compare the result to the comparison value.                                                                                                                                                                                                                                                                                                                                                                                           |
| D3D12\_FILTER\_COMPARISON\_MIN\_LINEAR\_MAG\_POINT\_MIP\_LINEAR | Use linear interpolation for minification; use point sampling for magnification; use linear interpolation for mip-level sampling. Compare the result to the comparison value.                                                                                                                                                                                                                                                                                                                                                                 |
| D3D12\_FILTER\_COMPARISON\_MIN\_MAG\_LINEAR\_MIP\_POINT         | Use linear interpolation for minification and magnification; use point sampling for mip-level sampling. Compare the result to the comparison value.                                                                                                                                                                                                                                                                                                                                                                                           |
| D3D12\_FILTER\_COMPARISON\_MIN\_MAG\_MIP\_LINEAR                | Use linear interpolation for minification, magnification, and mip-level sampling. Compare the result to the comparison value.                                                                                                                                                                                                                                                                                                                                                                                                                 |
| D3D12\_FILTER\_COMPARISON\_ANISOTROPIC                          | Use anisotropic interpolation for minification, magnification, and mip-level sampling. Compare the result to the comparison value.                                                                                                                                                                                                                                                                                                                                                                                                            |
| D3D12\_FILTER\_MINIMUM\_MIN\_MAG\_MIP\_POINT                    | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_MAG\_MIP\_POINT](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the minimum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the minimum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.                 |
| D3D12\_FILTER\_MINIMUM\_MIN\_MAG\_POINT\_MIP\_LINEAR            | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_MAG\_POINT\_MIP\_LINEAR](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the minimum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the minimum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.         |
| D3D12\_FILTER\_MINIMUM\_MIN\_POINT\_MAG\_LINEAR\_MIP\_POINT     | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_POINT\_MAG\_LINEAR\_MIP\_POINT](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the minimum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the minimum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.  |
| D3D12\_FILTER\_MINIMUM\_MIN\_POINT\_MAG\_MIP\_LINEAR            | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_POINT\_MAG\_MIP\_LINEAR](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the minimum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the minimum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.         |
| D3D12\_FILTER\_MINIMUM\_MIN\_LINEAR\_MAG\_MIP\_POINT            | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_LINEAR\_MAG\_MIP\_POINT](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the minimum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the minimum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.         |
| D3D12\_FILTER\_MINIMUM\_MIN\_LINEAR\_MAG\_POINT\_MIP\_LINEAR    | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_LINEAR\_MAG\_POINT\_MIP\_LINEAR](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the minimum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the minimum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure. |
| D3D12\_FILTER\_MINIMUM\_MIN\_MAG\_LINEAR\_MIP\_POINT            | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_MAG\_LINEAR\_MIP\_POINT](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the minimum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the minimum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.         |
| D3D12\_FILTER\_MINIMUM\_MIN\_MAG\_MIP\_LINEAR                   | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_MAG\_MIP\_LINEAR](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the minimum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the minimum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.                |
| D3D12\_FILTER\_MINIMUM\_ANISOTROPIC                             | Fetch the same set of texels as [D3D12\_FILTER\_ANISOTROPIC](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the minimum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the minimum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.                          |
| D3D12\_FILTER\_MAXIMUM\_MIN\_MAG\_MIP\_POINT                    | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_MAG\_MIP\_POINT](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the maximum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the maximum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.                 |
| D3D12\_FILTER\_MAXIMUM\_MIN\_MAG\_POINT\_MIP\_LINEAR            | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_MAG\_POINT\_MIP\_LINEAR](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the maximum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the maximum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.         |
| D3D12\_FILTER\_MAXIMUM\_MIN\_POINT\_MAG\_LINEAR\_MIP\_POINT     | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_POINT\_MAG\_LINEAR\_MIP\_POINT](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the maximum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the maximum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.  |
| D3D12\_FILTER\_MAXIMUM\_MIN\_POINT\_MAG\_MIP\_LINEAR            | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_POINT\_MAG\_MIP\_LINEAR](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the maximum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the maximum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.         |
| D3D12\_FILTER\_MAXIMUM\_MIN\_LINEAR\_MAG\_MIP\_POINT            | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_LINEAR\_MAG\_MIP\_POINT](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the maximum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the maximum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.         |
| D3D12\_FILTER\_MAXIMUM\_MIN\_LINEAR\_MAG\_POINT\_MIP\_LINEAR    | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_LINEAR\_MAG\_POINT\_MIP\_LINEAR](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the maximum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the maximum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure. |
| D3D12\_FILTER\_MAXIMUM\_MIN\_MAG\_LINEAR\_MIP\_POINT            | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_MAG\_LINEAR\_MIP\_POINT](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the maximum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the maximum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.         |
| D3D12\_FILTER\_MAXIMUM\_MIN\_MAG\_MIP\_LINEAR                   | Fetch the same set of texels as [D3D12\_FILTER\_MIN\_MAG\_MIP\_LINEAR](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the maximum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the maximum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.                |
| D3D12\_FILTER\_MAXIMUM\_ANISOTROPIC                             | Fetch the same set of texels as [D3D12\_FILTER\_ANISOTROPIC](/reference/graphics/d3d12/enums/d3d12_filter_public) and instead of filtering them return the maximum of the texels.  Texels that are weighted 0 during filtering aren't counted towards the maximum.  You can query support for this filter type from the **MinMaxFiltering** member in the [D3D11\_FEATURE\_DATA\_D3D11\_OPTIONS1](https://learn.microsoft.com/en-us/windows/desktop/api/d3d11/ns-d3d11-d3d11_feature_data_d3d11_options1) structure.                          |

## Remarks

This enum is used by the [D3D12\_SAMPLER\_DESC](/reference/graphics/d3d12/structs/d3d12_sampler_desc_public) structure.

<div class="alert">**Note**  If you use different filter types for min versus mag filter, undefined behavior occurs in certain cases where the choice between whether magnification or minification happens is ambiguous. To prevent this undefined behavior, use filter modes that use similar filter operations for both min and mag (or use anisotropic filtering, which avoids the issue as well).</div>

<div />

During texture sampling, one or more texels are read and combined (this is calling filtering) to produce a single value. Point sampling reads a single texel while linear sampling reads two texels (endpoints) and linearly interpolates a third value between the endpoints.

Microsoft High Level Shader Language (HLSL) texture-sampling functions also support comparison filtering during texture sampling. Comparison filtering compares each sampled texel against a comparison value. The boolean result is blended the same way that normal texture filtering is blended.

You can use HLSL intrinsic texture-sampling functions that implement texture filtering only or companion functions that use texture filtering with comparison filtering.

Also note the following defines:

```syntax theme={null}
#define D3D12_FILTER_REDUCTION_TYPE_MASK ( 0x3 )

#define D3D12_FILTER_REDUCTION_TYPE_SHIFT ( 7 )

#define D3D12_FILTER_TYPE_MASK ( 0x3 )

#define D3D12_MIN_FILTER_SHIFT ( 4 )

#define D3D12_MAG_FILTER_SHIFT ( 2 )

#define D3D12_MIP_FILTER_SHIFT ( 0 )

#define D3D12_ANISOTROPIC_FILTERING_BIT ( 0x40 )

#define D3D12_ENCODE_BASIC_FILTER( min, mag, mip, reduction )                                                     \
( ( D3D12_FILTER ) (                                                           \
( ( ( min ) &amp; D3D12_FILTER_TYPE_MASK ) &lt;&lt; D3D12_MIN_FILTER_SHIFT ) |           \
( ( ( mag ) &amp; D3D12_FILTER_TYPE_MASK ) &lt;&lt; D3D12_MAG_FILTER_SHIFT ) |           \
( ( ( mip ) &amp; D3D12_FILTER_TYPE_MASK ) &lt;&lt; D3D12_MIP_FILTER_SHIFT ) |           \
( ( ( reduction ) &amp; D3D12_FILTER_REDUCTION_TYPE_MASK ) &lt;&lt; D3D12_FILTER_REDUCTION_TYPE_SHIFT ) ) )
#define D3D12_ENCODE_ANISOTROPIC_FILTER( reduction )                                                  \
( ( D3D12_FILTER ) (                                         \
D3D12_ANISOTROPIC_FILTERING_BIT |                            \
D3D12_ENCODE_BASIC_FILTER( D3D12_FILTER_TYPE_LINEAR,         \
D3D12_FILTER_TYPE_LINEAR,         \
D3D12_FILTER_TYPE_LINEAR,         \
reduction ) ) )
#define D3D12_DECODE_MIN_FILTER( D3D12Filter )                                                              \
( ( D3D12_FILTER_TYPE )                                                    \
( ( ( D3D12Filter ) &gt;&gt; D3D12_MIN_FILTER_SHIFT ) &amp; D3D12_FILTER_TYPE_MASK ) )
#define D3D12_DECODE_MAG_FILTER( D3D12Filter )                                                              \
( ( D3D12_FILTER_TYPE )                                                    \
( ( ( D3D12Filter ) &gt;&gt; D3D12_MAG_FILTER_SHIFT ) &amp; D3D12_FILTER_TYPE_MASK ) )
#define D3D12_DECODE_MIP_FILTER( D3D12Filter )                                                              \
( ( D3D12_FILTER_TYPE )                                                    \
( ( ( D3D12Filter ) &gt;&gt; D3D12_MIP_FILTER_SHIFT ) &amp; D3D12_FILTER_TYPE_MASK ) )
#define D3D12_DECODE_FILTER_REDUCTION( D3D12Filter )                                                        \
( ( D3D12_FILTER_REDUCTION_TYPE )                                                      \
( ( ( D3D12Filter ) &gt;&gt; D3D12_FILTER_REDUCTION_TYPE_SHIFT ) &amp; D3D12_FILTER_REDUCTION_TYPE_MASK ) )
#define D3D12_DECODE_IS_COMPARISON_FILTER( D3D12Filter )                                                    \
( D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) == D3D12_FILTER_REDUCTION_TYPE_COMPARISON )
#define D3D12_DECODE_IS_ANISOTROPIC_FILTER( D3D12Filter )                                               \
( ( ( D3D12Filter ) &amp; D3D12_ANISOTROPIC_FILTERING_BIT ) &amp;&amp;                  \
( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIN_FILTER( D3D12Filter ) ) &amp;&amp;   \
( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) &amp;&amp;   \
( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIP_FILTER( D3D12Filter ) ) )


```

| Texture Sampling Function                                                                           | Texture Sampling Function with Comparison Filtering                                                                                                                                                                                      |
| --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Sample](https://learn.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-to-sample) | [SampleCmp](https://learn.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-to-samplecmp) or [SampleCmpLevelZero](https://learn.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-to-samplecmplevelzero) |

Comparison filters only work with textures that have the following formats: [DXGI\_FORMAT\_R32\_FLOAT\_X8X24\_TYPELESS](https://learn.microsoft.com/en-us/windows/desktop/api/dxgiformat/ne-dxgiformat-dxgi_format), [DXGI\_FORMAT\_R32\_FLOAT](https://learn.microsoft.com/en-us/windows/desktop/api/dxgiformat/ne-dxgiformat-dxgi_format), [DXGI\_FORMAT\_R24\_UNORM\_X8\_TYPELESS](https://learn.microsoft.com/en-us/windows/desktop/api/dxgiformat/ne-dxgiformat-dxgi_format), [DXGI\_FORMAT\_R16\_UNORM](https://learn.microsoft.com/en-us/windows/desktop/api/dxgiformat/ne-dxgiformat-dxgi_format).

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[Core Enumerations](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-enumerations)

[Descriptors](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/descriptors)


## Related topics

- [D3D12_FILTER_TYPE](/reference/graphics/d3d12/enums/d3d12_filter_type_public.md)
- [D3D12_FILTER_REDUCTION_TYPE](/reference/graphics/d3d12/enums/d3d12_filter_reduction_type_public.md)
- [D3D12_SAMPLER_DESC](/reference/graphics/d3d12/structs/d3d12_sampler_desc_public.md)
- [D3D12_STATIC_SAMPLER_DESC](/reference/graphics/d3d12/structs/d3d12_static_sampler_desc_public.md)
- [D3D12_FEATURE](/reference/graphics/d3d12/enums/d3d12_feature_public.md)
