I created a wireframe rasterizer state and it works if I set it everytime I render an object. But if I initialized it one time next frame it resets to default rasterizer state. Is this the default behaviour or there is something wrong with my code?
rasterizer state resets
Search your code for “RSSetState” and ensure you are never calling it with NULL or otherwise unexpectedly.
Direct3D 11 does not reset any states between “frames” (that would assume Direct3D 11 had more than an assumption as to what a frame is) and there is something wrong within your client code.
L. Spiro
Yeah that was the first thing I have checked and there is only one place that I call RSSetState function. So here is how I set it. And as I said this works if I set it everytime before I call draw for my object.
D3D11_RASTERIZER_DESC rd;
ZeroMemory(&rd, sizeof(rd));
rd.AntialiasedLineEnable = false;
rd.CullMode = D3D11_CULL_BACK;
rd.DepthBias = 0;
rd.DepthBiasClamp = 0.0f;
rd.DepthClipEnable = true;
rd.FillMode = D3D11_FILL_WIREFRAME;
rd.FrontCounterClockwise = false;
rd.MultisampleEnable = false;
rd.ScissorEnable = false;
rd.SlopeScaledDepthBias = 0.0f;
d3dDevice->CreateRasterizerState(&rd, &rasterizerStateWireFrame);
deviceContex->RSSetState(rasterizerStateWireFrame);
What information did you get from PIX, Visual Studio 2013, or any other graphics debugger?
L. Spiro
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement