I have a strange problem with mapping texture for reading.
My texture is R32_SINT format. When mapping, I obtained pData, RowPitch and DepthPitch.
My texture is 800 x 600 in size. Graphics debugger says, It's 800x600 and its size is 1920000. That's correct.
Unfortunately, RowPitch is 3328 ( which is about 128 more then it should be ) and DepthPitch is 1996800 ( and it should be 1920000 ).
Creating texture code
ZeroMemory(&textureDesc, sizeof(D3D11_TEXTURE2D_DESC)); textureDesc.BindFlags = 0; textureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; textureDesc.Width = width; textureDesc.Height = height; textureDesc.Format = dxformat; textureDesc.Usage = D3D11_USAGE_STAGING; textureDesc.SampleDesc.Quality = 0; textureDesc.SampleDesc.Count = 1; textureDesc.ArraySize = 1; textureDesc.MipLevels = 1; _device->CreateTexture2D(&textureDesc, 0, &resource->_resourceRead);
where width = 800, height = 600, dxformat = DXGI_FORMAT_R32_SINT.
Why it happend ? What's going on ?
Thank you very much for answers.