Skip to main content

Timeline for Readback Data through Buffers

Current License: CC BY-SA 3.0

13 events
when toggle format what by license comment
May 1, 2017 at 17:46 vote accept Madhu
Apr 25, 2017 at 22:42 answer added Derag timeline score: 1
Apr 24, 2017 at 23:06 comment added Madhu I was not able to declare my heap as type D3D12_HEAP_TYPE_READBACK. Because the second I do that, I am not able to call CreateCommitResource and even create the buffer. If i keep the heap type DEFAULT and call Map, there is nothing returned into *pDataBegin
Apr 24, 2017 at 22:43 comment added Derag What error do you get? Did you try ReadFromSubresource? Did you do steps pointed on Microsoft page?
Apr 24, 2017 at 18:36 comment added Madhu But wouldn't it be easier if i use the Map and Unmap pair? std::vector<UINT8> pDataBegin; ThrowIfFailed(m_InputBuffer1[0]->Map(0, NULL, reinterpret_cast<void**>(&pDataBegin))); but then again even this throws an error :(
Apr 21, 2017 at 9:18 comment added Derag Also i'm not sure about D3D12_RESOURCE_STATE_COPY_DEST but i don't see whole code so can't tell if its should be this resource state.
Apr 21, 2017 at 9:07 comment added Derag ID3D12Resource::ReadFromSubresource doesn't allocate memory for you and it get pointer not pointer to pointer, so you need to allocate memory and cast pDataBegin to void* not void**. Remember to free allocated memory
Apr 21, 2017 at 0:43 comment added Madhu I created the Input buffer with the following properties: ThrowIfFailed(m_device->CreateCommittedResource( &defaultHeapProperties, D3D12_HEAP_FLAG_NONE, &bufferDesc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, IID_PPV_ARGS(&m_InputBuffer1[0]))); and later on when I try to read it back as follows, the compiler throws an exception! UINT8* pDataBegin; m_InputBuffer1[0]->ReadFromSubresource(reinterpret_cast<void**>(&pDataBegin),5,5,0,0); printf("The value pointed to is %d", *pDataBegin); any idea why this is happening ?
Apr 20, 2017 at 21:18 comment added Derag I never used this with UAV but maybe it will work, just set DstRowPitch and DstDepthPitch to buffer size (in bytes) and you will see if its work. I don't see why it shouldn't work (but maybe it don't)
Apr 20, 2017 at 16:37 comment added Madhu But I am trying to read out of a compute buffer. I was under the impression that ReadFromSubresource is used primarily on textures and layouts.
Apr 20, 2017 at 13:57 comment added Derag I think you can also use ID3D12Resource::ReadFromSubresource it is a little simpler.
Apr 20, 2017 at 5:17 history edited Madhu CC BY-SA 3.0
added 76 characters in body
Apr 20, 2017 at 4:53 history asked Madhu CC BY-SA 3.0