Sign in to follow this  

Expense of texture parameter state change

This topic is 4257 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

I'm curious - does anyone know how expensive the state change is to change the parameters of a texture? For instance, changing the addressing mode from repeat to clamp, or changing filtering from nearest to linear? Are they essentially free operations, or is there much time involved? - Nanoprobe

Share this post


Link to post
Share on other sites
They're not free operations. But they don't impact things TOO much.

Just what are you trying to do? If it's just a few dozen calls you're worried about, it's all good. But if you do this per poly, you might be killing your performance.

Share this post


Link to post
Share on other sites
I wouldn't be doing anything like per-poly texture state changes; I was wondering whether or not it's worth the effort of sorting states by texture parameters as well - though if in general usage it's not going to make much of an impact I doubt it's worth doing.

Share this post


Link to post
Share on other sites
Texture parameter settings are stored per texture object - so sorting with respect to them doesn't make sense anyway - you just need to sort by texture object.

Hope that helped [smile]

Share this post


Link to post
Share on other sites
Actually, it does make sense if you want to use the same texture data, but with different parameters.

You could use two texture objects with two sets of parameters and two sets of data, but that would be wasteful. Changing the texture state should be cheap, I just don't know how much so.

Share this post


Link to post
Share on other sites

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this