locked
How to convert DXGI_FORMAT_NV12 to DXGI_FORMAT_R8G8B8A8_UNORM?

    Question

  • first, I must use the DXGI_FORMAT_NV12 format to create a texture, then I map this texture to a mesh. But the render result is not right.I think the texture should be created with DXGI_FORMAT_R8G8B8A8_UNORM format ,and that will be render well.

    So how can I convert DXGI_FORMAT_NV12 to DXGI_FORMAT_R8G8B8A8_UNORM?

    I found the DXGI_FORMAT_NV12 is YUV 4:2:0 video resource format. if it doesn't need to convert, How to render right with DXGI_FORMAT_NV12 ?

    Thursday, April 26, 2012 8:25 AM

All replies

  • first, I must use the DXGI_FORMAT_NV12 format to create a texture, then I map this texture to a mesh. But the render result is not right.I think the texture should be created with DXGI_FORMAT_R8G8B8A8_UNORM format ,and that will be render well.

    So how can I convert DXGI_FORMAT_NV12 to DXGI_FORMAT_R8G8B8A8_UNORM?

    I found the DXGI_FORMAT_NV12 is YUV 4:2:0 video resource format. if it doesn't need to convert, How to render right with DXGI_FORMAT_NV12 ?

    Chuck Walbourn  told me in this link http://social.msdn.microsoft.com/Forums/en-US/wingameswithdirectx/thread/e19906f4-afd5-455b-82ba-92c63addabec/#9076c422-f23e-4168-bf57-fb572914eaed

    which he said “You don't. You can only use the aliasing to create a resource of hte format NV12 and then use shader resource views of the format R8 and R8G8 pointing to the same NV12 resource.”

    My question is how to use shader resource views of the format R8 and R8G8 pointing to the same NV12 resource?


    • Edited by zjubaoli Thursday, April 26, 2012 8:48 AM
    Thursday, April 26, 2012 8:47 AM
  • Is this so necessary to convert them in this way?

    NEU_ShieldEdge

    Friday, April 27, 2012 9:37 AM
  • Are you playing video to a texture? If so then TransferVideoFrame can copy a video frame to a regular texture - I think RGBA8 works fine.

    Filip Skakun

    Friday, April 27, 2012 3:39 PM