We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 36 - Problems with Altivec alpha-blitting code
Summary: Problems with Altivec alpha-blitting code
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 1.2.9
Hardware: PowerPC Mac OS X (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-07 07:47 UTC by Richard Drummond
Modified: 2006-01-27 11:23 UTC (History)
0 users

See Also:


Attachments
Fix for altivec alpha-blitting (2.15 KB, patch)
2006-01-07 07:48 UTC, Richard Drummond
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Drummond 2006-01-07 07:47:08 UTC
There are a couple of issues with the selection of Altivec alpha-blitting routines in CalculateAlphaBlit() in src/video/SDL_Blit_A.c.

1) There's no check for the presence of Altivec when checking if the Blit32to565PixelAlphaAltivec() routine can be selected.

2) Altivec cannot be used in video memory, and there's no check if the destination surface is a hardware surface. (Alpha-blitting to a hardware surface with GPU support is a bad idea, but somebody's bound to do it anyway.)

Patch to fix these attached.
Comment 1 Richard Drummond 2006-01-07 07:48:23 UTC
Created attachment 18 [details]
Fix for altivec alpha-blitting
Comment 2 Ryan C. Gordon 2006-01-07 09:46:46 UTC
Are you sure Altivec can't be used in video memory? I would think it would just look like regular address space to the CPU, but I've never tried.

--ryan.

Comment 3 Richard Drummond 2006-01-07 10:05:01 UTC
> Are you sure Altivec can't be used in video memory?

Fairly sure. I get a alignment exception here on AmigaOS when trying to do a load to an Altivec register from video memory (even when the address to load from is 16-byte-aligned). I've been told that Altivec only works in cacheable memory (video memory is cache inhibited).

Comment 4 Ryan C. Gordon 2006-01-08 16:19:08 UTC
Sounds reasonable. Patch applied.

Thanks!

--ryan.
Comment 5 Ryan C. Gordon 2006-01-27 11:23:10 UTC
Setting Sam as "QA Contact" on all bugs (even resolved ones) so he'll definitely be in the loop to any further discussion here about SDL.

--ryan.