Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


is there any difference about the order of clear rendertargetview and setrendertarget in dx11?


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
3 replies to this topic

#1 db123   Members   -  Reputation: 216

Like
0Likes
Like

Posted 14 April 2014 - 01:06 AM

in directx9, if i want to clear a surface, i must set this surface as current rendertarget, and clear it.

but in directx11, there is a render target view. i find that some codes clear all rendertargetview before set them to be current render target:

like this:

void injectRSM( ID3D10Device *device, const ReflectiveShadowMap &rsm ) 
{
			stateBlock->Capture();

			LPVs[0].clear( device );
			LPVs[0].setRenderTarget( device );

			// set the viewport
			D3D10_VIEWPORT viewport;
			viewport.TopLeftX = viewport.TopLeftY = 0;
			viewport.Width = width;
			viewport.Height = height;
			viewport.MinDepth = 0.0f;
			viewport.MaxDepth = 1.0f;

			device->RSSetViewports( 1, &viewport );
}

  is there any difference about this order?



Sponsor:

#2 lomateron   Members   -  Reputation: 363

Like
0Likes
Like

Posted 14 April 2014 - 10:36 AM

I don't know the answer to your question but 

I used it too at the start because tutorials had it, then I realize in my application I didn't really need it and I took the clear method out and gained lots of FPS



#3 MJP   Moderators   -  Reputation: 11786

Like
2Likes
Like

Posted 15 April 2014 - 12:08 AM

In D3D10/D3D11 clear works regardless of whether or not you bind the render target, so it doesn't matter which order you do it.



#4 db123   Members   -  Reputation: 216

Like
0Likes
Like

Posted 15 April 2014 - 12:30 AM

In D3D10/D3D11 clear works regardless of whether or not you bind the render target, so it doesn't matter which order you do it.

 

thank you.






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