Jump to content
  • Advertisement
Sign in to follow this  
belfegor

About stateblocks and id3dxeffect

This topic is 1870 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.

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

IDirect3DStateBlock9* pStateBlock = NULL;



pd3dDevice->BeginStateBlock();

pd3dDevice->SetRenderState ( D3DRS_ZENABLE, D3DZB_TRUE );

pd3dDevice->SetRenderState ( D3DRS_ZENABLE, FALSE );

...//other states

pd3dDevice->EndStateBlock ( &pStateBlock );


I don't need to call CreateStateBlock?

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

pd3dDevice->BeginStateBlock();

pd3dDevice->EndStateBlock ( &pStateBlock );


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

effbegin.jpg

effend.jpg

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?

4.
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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!