Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 1 more developer from Canada and 12 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


rasterizer state resets


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 ekba89   Members   -  Reputation: 569

Like
0Likes
Like

Posted 01 April 2014 - 06:06 PM

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?



Sponsor:

#2 L. Spiro   Crossbones+   -  Reputation: 21469

Like
0Likes
Like

Posted 01 April 2014 - 07:20 PM

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



#3 ekba89   Members   -  Reputation: 569

Like
0Likes
Like

Posted 01 April 2014 - 07:39 PM

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);


#4 L. Spiro   Crossbones+   -  Reputation: 21469

Like
0Likes
Like

Posted 01 April 2014 - 07:55 PM

What information did you get from PIX, Visual Studio 2013, or any other graphics debugger?

 

 

L. Spiro



#5 ekba89   Members   -  Reputation: 569

Like
0Likes
Like

Posted 01 April 2014 - 08:04 PM

It was a stupid mistake. I found it when I checked the debugger on VS2012. I was using DirectXTK to write some stuff to screen. And it was changing the rasterizer state. Thanks for the help.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS