Jump to content
  • Advertisement
Sign in to follow this  

About stateblocks and id3dxeffect

This topic is 2039 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

There is a few things that confuses me, and documentation is not clear enough.
The reason that i am asking this is that i want to switch to idirect3dvertexshader9 and idirect3dpixelshader9 instead of using id3dxeffect interface.

In order to create stateblock i must do something like this:

IDirect3DStateBlock9* pStateBlock = NULL;


pd3dDevice->SetRenderState ( D3DRS_ZENABLE, D3DZB_TRUE );

pd3dDevice->SetRenderState ( D3DRS_ZENABLE, FALSE );

...//other states

pd3dDevice->EndStateBlock ( &pStateBlock );

I don't need to call CreateStateBlock?

This only records states that are explicitly set in between Begin and EndStateBlock?
So, for example, if i set none, nothing is recorded?


pd3dDevice->EndStateBlock ( &pStateBlock );

When i capture a frame with PIX, and when i examined Begin and End methods of id3dxeffect:



I am confused as to why Apply() is called at end, after reading documentation i thought it should be first thing to do before drawing any objects between Begin/EndPass pair?
WTF is going on?

I need to call Capture() only if i want to change some state that are recorded earlier?

Thank you for your time.

Edited by belfegor

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!