Re: [AD] C/Asm integration (was [AD] Improvement on alphablending...)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]



Matthew Smith wrote:
[snip]
In other words, I would always copy a line into normal, cacheable memory
before perfoming pixel operations on it anyway, regardless of the addressing
problem.

That would be true for a lot of operations. However, IMHO most operations are done on memory bitmaps. In that case, having a buffer isn't necessary.
I think the idea is good.

[code]
if (is_video_bitmap(dest))
  dst_buffer = malloc();
  copy_dst_in_buffer();
else
  dst_buffer = dest->line[0];

if (is_video_bitmap(src))
  src_buffer = malloc();
  copy_src_in_buffer();
else
  src_buffer = src->line[0];

blend(src_buf, dst_buf);

write dst_buf if needed.
[/code]

That's what I'm currently using in 2xSaI's C code. The asm part will be trickyer to write though.

--
- Robert J Ohannessian
"Microsoft code is probably O(n^20)" (my CS prof)
http://pages.infinit.net/voidstar/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/