Blitters

Writing optimized blitters for every combination of N bpp + colorkeying

  • alpha value + alpha channel is impractical.

I counted over 90 blitters before I gave up.

Any suggestions on what would be most useful?
I’ll write a few general blitters and a few optimized blitters based
on what people think would be really handy.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Writing optimized blitters for every combination of N bpp + colorkeying

  • alpha value + alpha channel is impractical.

I counted over 90 blitters before I gave up.

Could we build a blitter compiler which takes a set of params and builds a
routing specific for the task at run time? This would prolly be better
than a general blitter.

Could be good for people who like optimising asm routines :slight_smile:

njhOn Tue, 14 Apr 1998, Sam Lantinga wrote:

Could we build a blitter compiler which takes a set of params and builds a
routing specific for the task at run time? This would prolly be better
than a general blitter.

I started doing that, but it’s almost as much work to get right than
writing the blitters anyway. I’ve settled on writing a few general
blitters, but leaving switch statements open so as people want them,
they can plug their own optimized blitters into the source.

This isn’t a framework for specialized blitters, just N1xN2 + mapping
though adding new blitter types will be relatively easy.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Sam Lantinga wrote:

Writing optimized blitters for every combination of N bpp + colorkeying

  • alpha value + alpha channel is impractical.

I counted over 90 blitters before I gave up.

Any suggestions on what would be most useful?
I’ll write a few general blitters and a few optimized blitters based
on what people think would be really handy.

What about just two cases. One where the dest and source does not match
in their
pixel format, and two where they do match. Or am I missing
something…

Oh yeah a question :slight_smile: OpenGL??? I believe SGI’s implementation auto
calls the
hardware if support is found. SGI’s comes in a dll. I don’t know windows
too well, but
should be possible to use it in sdl. A thorn in the sid ethough is that
DirectX surfaces
and OpenGL don’t mix AFAIK.–
Hasse Schougaard
@Hasse_Schougaard
Men are self-confident because they grow up identifying with superheros.
Women have bad self-images because they grow up identifying with Barbie.
- Unknown (certainly not me:)

Could we build a blitter compiler which takes a set of params and builds a
routing specific for the task at run time? This would prolly be better
than a general blitter.

I started doing that, but it’s almost as much work to get right than
writing the blitters anyway. I’ve settled on writing a few general
blitters, but leaving switch statements open so as people want them,
they can plug their own optimized blitters into the source.

This isn’t a framework for specialized blitters, just N1xN2 + mapping
though adding new blitter types will be relatively easy.

Yeah, and there’s nothing more relaxing that sitting down and writing a
couple of blitter to pass the time :wink:

BTW, that SDL lib you sent me works a treat, I’ll look into the egcs
problem tonight.

njhOn Tue, 14 Apr 1998, Sam Lantinga wrote:

What about just two cases. One where the dest and source does not match
in their pixel format, and two where they do match. Or am I missing
something…

You can optimize even further:

8bit palette --> 8bit direct
8bit colorkey --> 8bit direct
8bit palette --> 8bit mapped
8bit colorkey --> 8bit mapped
8bit palette --> Nbit mapped
8bit colorkey --> Nbit mapped
8bit palette --> Nbit mapped
8bit colorkey --> Nbit mapped

16bit --> 8bit direct
16bit colorkey --> 8bit direct
16bit alpha value --> 8bit direct
16bit alpha channel --> 8bit direct
same --> 8bit mapped
16bit --> 16bit
16bit colorkey --> 16bit
16bit alpha value --> 16bit
16bit alpha channel --> 16bit
16bit colorkey + alpha value --> 16bit
16bit colorkey + alpha channel --> 16bit

… ad naseum.

Oh yeah a question :slight_smile: OpenGL??? I believe SGI’s implementation auto
calls the hardware if support is found. SGI’s comes in a dll. I don’t
know windows too well, but should be possible to use it in sdl. A thorn
in the sid ethough is that DirectX surfaces and OpenGL don’t mix AFAIK.

I don’t know what you mean by a thorn in the side, but I wouldn’t recommend
running OpenGL over SDL except on a very fast machine. You’re much better
off using the native video card acceleration. That’s what it’s there for,
and SDL can’t take advantage of any 3D acceleration at the moment.
It’s not designed for 3D.

A simple framebuffer driver for base OpenGL isn’t a bad idea, but I would’t
want to implement it myself at the moment. Mesa, which would be a good base,
is natively implemented by MGL, BeOS, Linux+Voodoo1, etc.
It’s not worth it. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Yeah, and there’s nothing more relaxing that sitting down and writing a
couple of blitter to pass the time :wink:

Actually, with a lot of practice it becomes almost routine. :slight_smile:

BTW, that SDL lib you sent me works a treat, I’ll look into the egcs
problem tonight.

Great. :slight_smile:

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/