[SDL] Generalised BitBlit proposal
jake at waskett.org
Wed Sep 28 07:24:56 PDT 2005
On Tuesday 27 September 2005 13:18, Ryan C. Gordon wrote:
> > I'd be grateful for any comments. Would people find this useful? Would
> > anyone be interested in collaborating on this?
> Are you basically suggesting we add CPU-bound pixel shaders to SDL?
In essence, I guess, though at a higher level of abstraction and - in
principle at least - not necessarily implemented on the CPU.
> There's a reason blits are piles of nasty code, usually using magic
> macros and inline assembly...I don't know that replacing them with
> scripts are a good idea.
Your characterisation of blits as nasty code is absolutely right, and to my
mind this is the best reason for automatically generating them. They're hard
to write, understand, and port, bug-prone, and need to be optimised for
several different architectures. These are exactly the same reasons why
compilers were invented.
A blit compiler is certainly possible to write, and do so efficiently.
Microsoft did so for the GDI blits in Windoze, and the ReactOS developers
have apparently written somewhat better-optimised code for the same task
(I've no idea if they've taken advantage of SIMD facilities). These are less
general-purpose than my proposal, and couldn't for example handle
alpha-blending. But they demonstrate that such a thing can be done.
> SDL mailing list
> SDL at libsdl.org
More information about the SDL