Good afternoon!
In DirectX I'm a beginner, I do not know many things.
I have a texture in the memory of the video card in RGBA format (DXGI_FORMAT_R8G8B8A8_UNORM). This is an intercepted game buffer. Before copying its contents into the computer's memory, I need to do a transformation of this texture in the format BGRA (DXGI_FORMAT_B8G8R8A8_UNORM). How to convert a texture from one pixel format to another means of video card?
// DXGI_FORMAT_R8G8B8A8_UNORM
ID3D11Texture2D *pTexture1;
// DXGI_FORMAT_B8G8R8A8_UNORM
ID3D11Texture2D *pTexture2;
D3D11_TEXTURE2D_DESC desc2 = {};
desc2.Width = swapChainDesc.BufferDesc.Width;
desc2.Height = swapChainDesc.BufferDesc.Height;
desc2.MipLevels = 1;
desc2.ArraySize = 1;
desc2.Format = DXGI_FORMAT_B8G8R8A8_UNORM;
desc2.BindFlags = D3D10_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;
desc2.SampleDesc.Count = 1;
desc2.Usage = D3D11_USAGE_DEFAULT;
desc2.MiscFlags = 0;
void pixelConvert(ID3D11Texture2D *pTexture1, ID3D11Texture2D *pTexture2)
{
//
// Code....
//
}
I do not understand this solution: DX11 convert pixel format BGRA to RGBA It is not complete