Slow 16 bit Blit with large bitmaps
Hi folks!
I was developing a simple blitting test. Then I tried a 640x480x16 blitting. If I run only this Blt I''ll get 15 fps!
what is going on ?
Note : The image is in Video Memory...
My computer is a PII 400 - 64 MB - Savage4+ Card
How exactly would u do a Blt with memcpy? I''ve tried but can''t seem to get it to work.
memcpy(ddsdDest.lpSurface, ddsdSrc.lpSurface, ???);
What would u put in the size field? ddsdSrc.lPitch * ddsdSrc.dwHeight?
Thanks
memcpy(ddsdDest.lpSurface, ddsdSrc.lpSurface, ???);
What would u put in the size field? ddsdSrc.lPitch * ddsdSrc.dwHeight?
Thanks
That one line memcpy would only work if your surfaces are guaranteed linear. This is not always true for the primary display. A looping line-by-line copy would work, I think.
for(int i=0; i < ddsdSrc.dwHeight; i++)
memcpy(ddsdDst.lpSurface[i*ddsdDst.lPitch], ddsdSrc.lpSurface[i*ddsdSrc.lPitch], ddsdSrc.dwWidth);
Radhil Trebors
Persona Under Construction
for(int i=0; i < ddsdSrc.dwHeight; i++)
memcpy(ddsdDst.lpSurface[i*ddsdDst.lPitch], ddsdSrc.lpSurface[i*ddsdSrc.lPitch], ddsdSrc.dwWidth);
Radhil Trebors
Persona Under Construction
Radhil TreborsPersona Under Construction
I''m using BltFast. However I''ll try a memcpy method or even a "Assembly" method with MMX instructions...
BTW I''m developing in Delphi... Which language did you use ?
Thanks for the advice!!
BTW I''m developing in Delphi... Which language did you use ?
Thanks for the advice!!
I don''t think you can make the blitting any faster with you own functions even if you do it with assembly and MMX routines. Even if you could you would have to implement the function for every card you want to support, so it is not recommended. Let the driver programmers do that work for you.
As to your original question:
Do you get the same performance with Blt()? I know BltFast should be faster, but this only true for software blitting (It''s only 10% anyways).
Are both surfaces in the same pixelformat, i.e. 16bit RGB565?
It might have something to do with caching too, but I doubt it. Try breaking up the image into smaller pieces and blit them separately.
As to your original question:
Do you get the same performance with Blt()? I know BltFast should be faster, but this only true for software blitting (It''s only 10% anyways).
Are both surfaces in the same pixelformat, i.e. 16bit RGB565?
It might have something to do with caching too, but I doubt it. Try breaking up the image into smaller pieces and blit them separately.
Both surfaces are 16 bit, RGB565...
SpellBound : I have a little problem. This blt is supposed to draw a background image on my demo...
Anyway I''ll test your ideia... thanks!
SpellBound : I have a little problem. This blt is supposed to draw a background image on my demo...
Anyway I''ll test your ideia... thanks!
Both surfaces are 16 bit, RGB565...
SpellBound : I have a little problem. This blt is supposed to draw a background image on my demo...
Anyway I''ll test your ideia... thanks!
SpellBound : I have a little problem. This blt is supposed to draw a background image on my demo...
Anyway I''ll test your ideia... thanks!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement