locked
Depth Buffer Support Formats

    Question

  • Hi,

    I just tried to create a depth buffer. While looking through the HDR Format 10 example I believe I considered a bug in the example or in the documentation.

    The documentation states that the depth buffer formats are

    D16_NORM
    D24_UNORM_S8_UINT
    D32_FLOAT
    D32_FLOAT_S8X24_UINT

    The HDR Format 10 example is checking for the R16_TYPELESS, R32_TYPELESS and R32_FLOAT_X8X24_TYPELESS formats and can not find any of them on my machine .... the documentation does not say anything about those formats. Replacing the _TYPELESS formats with the one above works.

    I assume typeless means that it is looking for a _NORM or _UNORM format and picks whatever is available?

    - Wolfgang

    Sunday, January 28, 2007 4:32 PM

All replies

  • The sample is incorrect in checking for TYPELESS Format support for depth buffers.  This will be fixed in the next SDK release.

    The TYPELESS formats are not supported directly as depth formats.  TYPELESS formats are used in the scenario where you want to create a base resource with a certain bit-depth, and then have views of that resources that interpret the data differently.

    For example, if you create a R32_TYPELESS resource, you can then create views of the resource with D32_FLOAT, R32_FLOAT, R32_UINT, and R32_SINT.  However, if you created the resource with R32_FLOAT, you would only be able to create an R32_FLOAT view of that resource.

    -sid

    Friday, February 02, 2007 5:06 PM
  • Actually no. _TYPELESS means that you can choose between _NORM and _UNORM when it comes time to make a View. If you declare the Resource _NORM or _UNORM during creation, all Views must be the same as the Resource. Using _TYPELESS with a Resource that will be used as a Depth/Stencil implies that the Resource will most likely be recycled/ used as a Texture, because D32_FLOAT must be used with DepthStencil Views, whereas D32_FLOAT cannot be used as a ShaderResourceView (R32_FLOAT can though).
    Friday, February 02, 2007 5:08 PM