Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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: 467

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: 14014

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


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#3 ekba89   Members   -  Reputation: 467

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: 14014

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


It is amazing how often people try to be unique, and yet they are always trying to make others be like them. - L. Spiro 2011
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
I went to my local Subway once to find some guy yelling at the staff. When someone finally came to take my order and asked, “May I help you?”, I replied, “Yeah, I’ll have one asshole to go.”
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums

#5 ekba89   Members   -  Reputation: 467

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