locked
NV12 support in Windows 8.1

    Question

  • Hi,

        As per http://msdn.microsoft.com/en-us/library/windows/desktop/hh404483(v=vs.85).aspx 

    Texture2D resources

    Direct3D 11.1 hardware supports all formats except DXGI_FORMAT_UNKNOWN for texture 2D resources (D3D11_FORMAT_SUPPORT_TEXTURE2D).

    It follows that there is support for DXGI_FORMAT_NV12. I have already seen the answer to the question posted at http://social.msdn.microsoft.com/Forums/windowsapps/en-US/bd557813-345f-4102-b88a-a4ca99c6f671/using-nv12-texture-in-windows-developer-preview?forum=wingameswithdirectx

    What I am not able to understand is the nature of support. What do you mean by "Direct3D 11.1 hardware supports DXGI_FORMAT_NV12.

    I was expecting to be able to create a render target with NV12 format. But I get a E_INVALIDARG HRESULT everytime I try to create one.

    Request you to throw some light on the above points...

    Tuesday, November 19, 2013 10:02 AM

Answers

  • You can create a Texture2D resource with DXGI_FORMAT_NV12. You cannot create a ShaderResourceView of DXGI_FORMAT_NV12 for use with a shader. That's when you use the 'alias' types to create one or two SRVs for the NV12 Texture2D resource. You then can read the data in the shader with a texture fetch, but it is still in the video color space. In order to render with it, you in fact have to convert it to RGB since that's the only format that is valid for display.
    Wednesday, November 20, 2013 6:46 AM

All replies

  • Hi Haresh,

    There are several previous threads discussing this. You cannot use NV12 directly, but can use two shader views to address it. See http://social.msdn.microsoft.com/Forums/windowsapps/en-US/home?searchTerm=NV12 for several previous discussions.

    --Rob

    Wednesday, November 20, 2013 1:54 AM
    Owner
  • I have read those threads. If that is the case, then why have the enum value of DXGI_FORMAT_NV12? 

    It does not make sense to say that there is NV12 support in the D3D pipeline in Windows 8.1, because whatever is mentioned in the threads just says convert the NV12 buffer to RGB32 and display it.

    Wednesday, November 20, 2013 3:22 AM
  • You can create a Texture2D resource with DXGI_FORMAT_NV12. You cannot create a ShaderResourceView of DXGI_FORMAT_NV12 for use with a shader. That's when you use the 'alias' types to create one or two SRVs for the NV12 Texture2D resource. You then can read the data in the shader with a texture fetch, but it is still in the video color space. In order to render with it, you in fact have to convert it to RGB since that's the only format that is valid for display.
    Wednesday, November 20, 2013 6:46 AM