Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

softimage

why does uploading of texture cost so much cpu?

This topic is 5238 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 used lockrect and memcpy to write something to a MANAGED texture. It''s 720*576 an I wrote on it 25 times per second. But this costs 5% of the cpu usage on my pentium4 3G hyper thread. Compared to the 6% of video decoding time, it''s too high. And the DXLoadSurfaceFromMemory costs 50%! I''ve tested different flags of these two functions, but it''s about the same. How do game developers deal with it?

Share this post


Link to post
Share on other sites
Advertisement
You''ll probably find it''s more a bandwidth / waiting problem - that the CPU is waiting on the AGP bus (3D->CPU is v.slow, CPU->3D is v.fast) to provide it with data rather than the "complexity" of any operations you do on/with the data.

quote:
How do game developers deal with it?


avoid it! quite simple really. Use these techniques only when necessary, use texture blending, render to texture, and/or pixel shaders if you want to do this sort of stuff.

hth
Jack

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
How about creating that texture as dynamic, instead of managed?

Share this post


Link to post
Share on other sites
Dynamic texture costs fewer cpu time. thanks.
But it just came down from 11% to 8%,
and the one with no uploading costs only 5%.

Besides, the decoding and texture uploading done by
directx vmrallocator9 costs in total 5%, how can microsoft
achieve this? by some kernal function?

Share this post


Link to post
Share on other sites
I think VMR tries to avoid using CPU altogether, and instead use the graphics accelerator all the way if possible.
Most display cards nowadays have a video accelerator (MPEG hardware assist is common).

-Nik

Share this post


Link to post
Share on other sites
PCI-Express will alliviate this problem

But until then, there isn''t much we can do about it. The AGP bus just isn''t made to transfer data from the video card to system memory very fast.

neneboricua

Share this post


Link to post
Share on other sites
quote:
Original post by neneboricua19
PCI-Express will alliviate this problem

But until then, there isn''t much we can do about it. The AGP bus just isn''t made to transfer data from the video card to system memory very fast.

neneboricua


Sorry that maybe I''ve mistaken uploading and downloading.
What I want to do is write something from system memory to
video memory.
The opposite way is slow, but this way should be fast and cheap, I think. Because that''s what game develpers usually do.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by softimage
Besides, the decoding and texture uploading done by
directx vmrallocator9 costs in total 5%, how can microsoft
achieve this? by some kernal function?


Maybe they have their code optimized with MMX etc.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!