Jump to content


getsurfacelevel() performance


  • You cannot reply to this topic
3 replies to this topic

#1 starstutter

    Senior Member

  • Members
  • PipPipPipPip
  • 1039 posts

Posted 22 December 2008 - 09:45 PM

Hey, quick question. Is there some kind of preformance penalty for using the getsurfacelevel() function for a render target?

As in I create a render target as a texture (say, myTexture)

then during runtime I call:
myTexture->getsurfacelevel(mySurface);

is there a preformance penalty or slowdown for this?

Btw, just to let you know, I can't use nVidia perf-hud for these things unfortunatley. My laptop has some kind of compatability problem with the driver and it keeps stalling everything I run (even when perf-hud is off).

thanks in advance
(\__/)
(='.'=)
This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!

#2 Nick

    Senior Member

  • Members
  • PipPipPipPip
  • 1225 posts

Posted 23 December 2008 - 12:55 AM

No, there shouldn't be any slowdown for calling GetSurfaceLevel() itself. This function really doesn't do much. It just returns an interface to the surface (the meaning of the 'I' in front of IDirect3DSurface9).

Things do start getting complicated when you actually do something with this surface interface though. If you lock it for reading the data then it will stall till the GPU is completely done rendering to the texture. And if automatic mipmap generation is enabled then you'll have to wait for that too. What should be fast though (in theory) is copying the data to another surface that is in graphics memory, or setting it as a texture, as this merely gets stored into the command buffer and executes later when the data is ready (neither GPU or CPU is stalled).

#3 Reedbeta

    DevMaster Staff

  • Administrators
  • 4968 posts
  • LocationBellevue, WA

Posted 23 December 2008 - 03:30 AM

BTW just a heads-up: it's "performance" not "preformance". :)
reedbeta.com - developer blog, OpenGL demos, and other projects

#4 starstutter

    Senior Member

  • Members
  • PipPipPipPip
  • 1039 posts

Posted 23 December 2008 - 04:57 AM

Nick said:

No, there shouldn't be any slowdown for calling GetSurfaceLevel() itself. This function really doesn't do much. It just returns an interface to the surface (the meaning of the 'I' in front of IDirect3DSurface9).
Ok, that makes sense, thank you. I do know about the other problems you mentioned, and I do rigorously avoid doing those. My main concern was if its possible (as in not performance straining to use one surface for 2 textures within the same frame. Thanks though :)

Reedbeta said:

BTW just a heads-up: it's "performance" not "preformance".
you are converting me into one of those people that uses google toolbar as a spellchecker -_______-
(\__/)
(='.'=)
This is Bunny. Copy and paste bunny into
(")_(") your signature to help him gain world domination.
bunny also wants to fight spam: Click Here Bots!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users