Hardware accelerated blitting

5 posts / 0 new
Last post
Massi
Massi's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2012-03-28 17:16
Hardware accelerated blitting

Hello,
for my work in progress application, I need to rely on fast hardware accelerated blitting operations.

I am currently evaluating the following functions, I wonder which are up to the task:

1) BltBitMapRastPort()
2) BltBitMapTags()
3) CompositeTags()

Any other functions that I am not taking in consideration?

The target is AmigaOS 4.1 Update 1.

Thanks, regards

Hans
Hans's picture
Offline
Last seen: 2 months 3 weeks ago
Joined: 2010-12-09 22:04
@Massi All three functions

@Massi

All three functions are hardware accelerated where possible. If you need to scale, rotate, or perform compositing/alpha-blending, then use CompositeTags(). For straight blitting, use the BltBitMap*() functions.

Please note that BltBitMap*() is only HW accelerated if the source and destination bitmaps have the same pixel format. So, converting from 16-bit to 32-bit and vice versa is done in software.

Also note that graphics cards don't always support every available pixel format.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project.
http://keasigmadelta.co.nz/ - more of my software.

Massi
Massi's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2012-03-28 17:16
@Hans Thanks for the clear

@Hans

Thanks for the clear response.

So I guess some code is needed for ensuring the source-destination bitmaps to have the same pixel format, or?

In my case the source bitmap is got via ObtainBitMapSource() / ObtainBitMapInstance() / BitMapInstanceControl(), while the destination bitmap is created by AllocScreenBuffer(), all methods of Intuition which don' t allow to set any specific pixel format.
Is the pixel format of these bitmaps inherited from the underlying screen?

Hans
Hans's picture
Offline
Last seen: 2 months 3 weeks ago
Joined: 2010-12-09 22:04
@Massi The best way to

@Massi

The best way to ensure that the source and destination bitmaps have the same pixel format, is to open the window/screen first, and get its pixel format. If your source bitmaps are already in the right format, then great. Otherwise, you can allocate new bitmaps with the same pixel format as the window/screen, and copy the image over.

Hans

http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. Home of the RadeonHD driver for Amiga OS 4.x project.
http://keasigmadelta.co.nz/ - more of my software.

Massi
Massi's picture
Offline
Last seen: 3 years 10 months ago
Joined: 2012-03-28 17:16
@Hans Thanks, that sounds

@Hans

Thanks, that sounds like a suitable solution and algorithm.

I personally found the "pixel format" topic a bit messy, whereas overall only few functions explicitily refer to it, in Picasso96 for example, it does exist at mode id / screen / bitmap level.

Log in or register to post comments