Render target description as below, my app crashed when CreateTexture2D is called, but nothing wrong with shader resource.
CD3D11_TEXTURE2D_DESC renderTargetDesc(
DXGI_FORMAT_R8_UNORM,
static_cast<UINT>(m_renderTargetSize.Width),
static_cast<UINT>(m_renderTargetSize.Height),
1,
1,
D3D11_BIND_RENDER_TARGET
);
m_d3dDevice->CreateTexture2D(
&renderTargetDesc,
nullptr,
&m_renderTarget
);
But I found that DXGI_FORMAT_R8_UNORM format is supported by render target: http://msdn.microsoft.com/en-us/library/windows/desktop/hh404483(v=vs.85).aspx
Can anyone tell me where the problem is? Thanks very much!