What is the best graphics lib for software rendering ?

Started by
16 comments, last by Chuck3d 20 years, 6 months ago
C0D1F1ED: I have dl the memcpy pack of your link . the mem4 function is really fast for 4 bytes ? for videos writing ?
!o)
Advertisement
maybe the best way is to have an off screen and to do memcpy directly in the primary surface without flip and do a memfill to clear the screen. What do you think of that C0D1F1ED ?
!o)
quote:Original post by Chuck3d What is Non-temporary SSE? It seems interresting . I don''t know the things you talk about, can you explain in details please ? Thanx for the article link.

Normal write operations first write the data to the cache, then to main memory. This is done because when the data is soon needed again, it is still in the fast cache. However, filling the frame buffer, you normally don''t read it back very soon. So what you''re actually doing is filling the cache with useless data. That''s not good because when you need other data, it will have to come from main memory because it won''t be in the cache. This can take more than a 100 clock cycles! Non-temporary writes, featured in the MMX and SSE instruction sets, solve this problem. Instead of storing data in the cache and in main memory, it directly writes it to main memory, leaving the cache untouched so the other useful data can stay there. You''ll need to learn assembly to use them though...

quote:Original post by Chuck3d
maybe the best way is to have an off screen and to do memcpy directly in the primary surface without flip and do a memfill to clear the screen. What do you think of that C0D1F1ED ?

If you want to do transparency and other effects which need to read back data from the frame buffer, it''s very advantageous to work in main memory. The graphics card is not optimized for reading back pixels and can decimate performance! So I advise to have three buffers: a front and back buffer in video memory, and a third buffer in system memory. At the end of every frame, fast copy the third buffer to the back buffer, and flip it to the front buffer. This avoids non-synchronised updates (VSync).
quote:Original post by C0D1F1ED

You''ll need to learn assembly to use them though...



I know the assembly language . Must I use the function I have download in your link for do Non-temporary writing ?

My back buffer is in the main memory (I think because I use the SYSTEMMEMMORY flag when I create my back buffer). So must I use the SSE instructions for not write in the cache when I want write in my back buffer ?

Thanx a lot ! Please can you answer my two questions ? Its very important for me

Chuck.





!o)
!o)
quote:Original post by Chuck3d
Must I use the function I have download in your link for do Non-temporary writing ?

No, just write the assembly code yourself. Have a look in the Intel reference for the non-temporary store instructions (movnti, movntq and movntps if I recall correctly).
quote:So must I use the SSE instructions for not write in the cache when I want write in my back buffer ?

If you only want to write 32-bit at a time, the movnti instruction should be used. It''s only featured on Pentium 4 if I recall correctly...
Thank you very much for your help guy ! What do you do for know assembly optimisation on the p4 ? You rulezzz .

next time
ciao
!o)
quote:Original post by Chuck3d
What do you do for know assembly optimisation on the p4 ? You rulezzz .

Thanks. I know almost every instruction by heart because I wrote my own assembler, and I''m still extending it with new features and using it extensively: SoftWire.

This topic is closed to new replies.

Advertisement