Results 1 to 2 of 2

Thread: Does current state get checked when switching states?

  1. #1

    Does current state get checked when switching states?

    I?¢_~m not sure if OpenGl checks current state variables before changing them (do unnecisery state change functions get passed to graphics card or not), for example, should I keep a variable for witch texture is currently bound and check if it?¢_~s the one I want to switch to before doing glBindTexture?

  2. #2

    Does current state get checked when switching states?

    I think this is a decision for individual graphics card drivers, not OpenGL itself. Therefore, some will handle redundant changes and others won't -- the only way to be sure would be to test it out (I'll do a quick test later to see for myself!).

    I'd err on the side of caution -- after all, your app shouldn't have too many state switches anyway, since you'd use some form of state management in the first place. What's a few more "if" statements versus the real bottleneck (transferring vertex data to video memory, etc.).
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •