I am working in DirectX 11 via C++ and I am getting an error when creating a raserizer state. First, here is the code:
// set up rasterizer
D3D11_RASTERIZER_DESC1 rasterizerStateDescription;
::ZeroMemory(&rasterizerStateDescription, sizeof(D3D11_RASTERIZER_DESC1));
rasterizerStateDescription.FillMode = D3D11_FILL_WIREFRAME;
ID3D11RasterizerState1* rasterizerState;
DX::ThrowIfFailed(m_d3dDevice->CreateRasterizerState1(&rasterizerStateDescription, &rasterizerState));
m_d3dContext->RSSetState(rasterizerState);
Setting FillMode there doesn't really matter - that's just included to illustrate my usage. I've tried setting all of the members, and none of them. In the debugger I can see that all of the other members have their default values.
The error is thrown at CreateRaserizerState1, and is:
First-chance exception at 0x75EC4B32 in my.exe:
Microsoft C++ exception:
Platform::InvalidArgumentException ^ at memory location 0x028DE2CC.
HRESULT:0x80070057
As far as I can tell, raserizerStateDescription and rasterizerState are both valid, so I'm not clear as to why I am getting an invalid argumet exception here.
Commenting out the CreateRasterizerState1 and RSSetState calls allow the application to run normally.
Any suggestions as to how this can be resolved?