I am trying to move some of my heavy calculations from the CPU to the GPU and have created a RWTexture2D object for this using
RWTexture2D<float3> image : register(u1);
In my shader the image is modified and I am looking to get this data back to the CPU so I can either display it or output the contents to a file.
I have this in my application to set up the shader resource views.
//create texture srv desc D3D11_TEXTURE2D_DESC textureDesc; ZeroMemory(&textureDesc, sizeof(textureDesc)); textureDesc.Width = 640; textureDesc.Height = 480; textureDesc.MipLevels = 1; textureDesc.ArraySize = 1; textureDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; textureDesc.SampleDesc.Count = 1; textureDesc.SampleDesc.Quality = 0; textureDesc.Usage = D3D11_USAGE_DEFAULT; textureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS; textureDesc.CPUAccessFlags = 0; textureDesc.MiscFlags = 0; device->CreateTexture2D(&textureDesc, 0, &m_tex); //UAV D3D11_UNORDERED_ACCESS_VIEW_DESC descUAV; ZeroMemory(&descUAV, sizeof(descUAV)); descUAV.Format = DXGI_FORMAT_UNKNOWN; descUAV.ViewDimension = D3D11_UAV_DIMENSION_TEXTURE2D; descUAV.Texture2D.MipSlice = 0; device->CreateUnorderedAccessView(m_tex, &descUAV, &m_uavAccess); //SRV D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc; srvDesc.Format = textureDesc.Format; srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; srvDesc.Texture2D.MostDetailedMip = 0; srvDesc.Texture2D.MipLevels = 1; device->CreateShaderResourceView(m_tex, &srvDesc, &m_srvTexOutput);
Perhaps these are unnecessary as I’m not passing an already existing texture to the shader, but creating one and then trying to pass it to the CPU.
I’m looking to save the modified texture to a file using the code below, but it requires a
ID3D11Resource * to save
D3DX11SaveTextureToFile(context, ???, D3DX11_IFF_PNG, L"output.png");
Maybe I am missing the point on something, so how can I obtain the texture from the GPU?
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!