Hi there.
I'm trying to save a buffer data to texture. The approach:
ID3D11Buffer* m_pBuffer; <...> m_pd3dImmediateContext->CopyResource(m_pDebugBuffer, m_pBuffer); D3D11_MAPPED_SUBRESOURCE mapped_res; m_pd3dImmediateContext->Map(m_pDebugBuffer, 0, D3D11_MAP_READ, 0, &mapped_res); D3DXVECTOR2* v = (D3DXVECTOR2*)mapped_res.pData; FILE* fp; fopen_s(&fp, "result.dat", "wb"); fwrite(v, 512*512*sizeof(float)*2*3, 1, fp); fclose(fp);
I'm assume that result is RAW file for Photoshop, but the result I get is different from I expect to get. What's the best way to save it to texture?
And the second question - is it possible to save data like
ID3D11UnorderedAccessView* m_pUAV; ID3D11ShaderResourceView* m_pSRV;
to textures? I've tried
ID3D11Resource * res; ID3D11Texture2D * tex; m_pSRV->GetResource(&res); res->QueryInterface(&tex); HRESULT result = D3DX11SaveTextureToFile(m_pd3dImmediateContext, tex, D3DX11_IFF_BMP, L"name.bmp");
but it makes nothing ![]()

Find content
Male











