Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (3 posts)

Directx 12 : What is the best way to read back data from frame buffer?

Last post 3/9/2017 6:12 PM by Charybdis. 2 replies.
  • 2/18/2016 9:54 PM

    Directx 12 : What is the best way to read back data from frame buffer?

    Hi,
    I am trying to read back content from a frame buffer and save it in a file.
    After a lot of trial and error, I am doing the following (reverse of DX helper function UpdateSubresources)
    1) Created committed buffer resource with type  : D3D12_HEAP_TYPE_READBACK and state : D3D12_RESOURCE_STATE_COPY_DEST
    2) Switch frame buffer to D3D12_RESOURCE_COPY_SOURCE
    3) Call GetCopyableFootprint of the committed buffer created in step 1
    4) call CopyTextureRegion ( SCR : Framebuffer , DST : committed buffer created in step 1)
    5) Switch frame buffer to state it was before
    6) Map committed buffer created in step 1
    7) copy to image file
    8) Unmap committed buffer created in step 1
    It works, but is there a better way?
    Thanks
  • 3/9/2017 4:23 AM In reply to

    Re: Directx 12 : What is the best way to read back data from frame buffer?

    Hey!
    Can you please provide me with the code for reading back content from buffer to file . I am a beginner and have no clue how to proceed.
  • 3/9/2017 6:12 PM In reply to

    Re: Directx 12 : What is the best way to read back data from frame buffer?

    If you are a beginner, don't use DirectX 12. The DirectX 12 API is designed for graphics experts with a very strong background in DirectX 11 programming with a deep understanding of GPU hardware, and can take on the high-levels of validation that is required to successfully ship a robust application. DirectX 12 is particularly unforgiving to newbies. If you are new to DirectX, stick with DirectX 11.

    Some resources here:

    DirectX Tool Kit for DirectX 11: See ScreenGrab.

    DirectX Tool Kit for DirectX 12: See ScreenGrab.
Page 1 of 1 (3 posts) Previous Discussion Next Discussion