Skip to main content
GameDev.net gamedev.net
🔒 Locked

GetTexture speed

Started by UriKiller Jan 4, 2007 at 4:48 PM 1 replies 700+ views
Original Post
UriKiller
UriKiller
How fast is IDirect3DDevice::GetTexture ()? Does it just return the last saved texture pointer (of that stage) or does it do some extra unnessacery stuff? If I call SetTexture with the same parameters (stage and texture pointer) will the second call do all the calculations again? Is there any official direct3D document specifying exactly how much time (clocks or whatever..) does it take to execute functions, render states, texture stage states, and so on...?
sirob
sirob
Quote:
Original post by UriKiller
How fast is IDirect3DDevice::GetTexture ()? Does it just return the last saved texture pointer (of that stage) or does it do some extra unnessacery stuff?
If you use a non-pure device, this value is probably cached locally, and should be returned rather quickly. On a pure device, I believe this call isn't available.

Quote:
If I call SetTexture with the same parameters (stage and texture pointer) will the second call do all the calculations again?
What calculations? A SetTexture call is pretty straight forward, it just changes a register in the GPU. Most of the work involved is in stopping all the pipelines and preparing for the switch. If you use a non-pure device, it will likely catch redundant SetTexture calls and ignore them, reducing the penalty you pay for them. On a pure device, this will likely not be caught by D3D, but the drivers still might ignore the change completely. I don't think this kind of behaviour is well defined.

You should be working on minimizing SetTexture calls, regardless of whether they actually get caught or not, but you shouldn't go berzerk about catching every single redundant call.

Quote:
Is there any official direct3D document specifying exactly how much time (clocks or whatever..) does it take to execute functions, render states, texture stage states, and so on...?
Not really. The SDK has a document about it called "Accurately profiling D3D calls", but it only contains estimates.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
UriKiller
UriKiller
Can you please remind me what is a pure device?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.