XNA Creators Club Online
Page 1 of 1 (5 items)
Sort Posts: Previous Next

Comparing different states

Last post 07-21-2008 7:11 PM by n3Xus. 4 replies.
  • 07-20-2008 12:03 PM

    Comparing different states

    I want to know if I can compare different states (in my case, blending states) by comparing two ID3D10BlendState-> _DESC structs? Is this fast and/or the correct way to do it?

    (i need this so I can somehow sort objects by their states to minimize state changes).

     


  • 07-20-2008 1:00 PM In reply to

    Re: Comparing different states

    If you only want to minimize state changes you can compare the ID3D10???State pointers. Direct3D 10 guaranteed that if you create two or more state objects with the same desc you get the same state object.

  • 07-20-2008 4:12 PM In reply to

    Re: Comparing different states

    thx :D

    I have one more question:

    when creating constant buffers i saw that there are vs, ps and gs interface functions in the ID3D10Device to set constant buffers. So i must sort them by ps,vs and gs in addition to frequency of use? And would it be very wrong to set a value in a vs cbuffer that is going to be used in ps (will it crash the app or cause any major problems-Im just curious about this last thing :P)?


  • 07-21-2008 6:54 PM In reply to

    Re: Comparing different states

    You can attach the same constant buffer to different shader types. If you always use the same shaders together this can simplify updating the const buffers.

    The constant buffer is just a buffer. The shader will not care about areas it doesn’t use. It will not crash if you attach a buffer that is too short or no buffer at all. But you should not expect right shader results in such cases.

  • 07-21-2008 7:11 PM In reply to

    Re: Comparing different states

    thx a lot :D
Page 1 of 1 (5 items) Previous Next