1

I wanna render an image to a texture taking advantage of DirectX acceleration. But instead of showing that image on the screen, I wanna get this image back to the regular memory as a bitmap to do anything with the result. How do I transfer some texture to the regular memory? I am using DirectX 11.

2
  • 1
    You can find the same problem, and the solution, here. You only need to use DirectX 11 version instead of 10. Commented Dec 12, 2012 at 15:09
  • almost there... In fact I want to have ACCESS to the pixels. D3DX10SaveTextureToFile() does it in background of course. But I wanna know how to do it by myself. I think it's something related to Map/Unmap of resources(DX10/DX11), but I couldn't find anything that really works! :-( Commented Dec 17, 2012 at 20:49

1 Answer 1

2

You can use a seperate "staging" texture which has cpu read access. Than copy your rendertarget texture to this staging texture with CopySubresource() or CopyResource() an perform Map() to this staging texture.

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

Sign up to request clarification or add additional context in comments.

2 Comments

Oh, I saw that's the solution in the comments above... I used this several times and it works. Whats your problem with Map/Unmap?
Any suggestions on how to do it in DirectX 12? It seems that many memory related things have changed there :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.