| Summary: | [patch] Alpha blending bug in BlitRGBtoRGBPixelAlphaMMX | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Alex Volkov <codepro> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | vapier |
| Version: | HG 1.2 | ||
| Hardware: | x86 | ||
| OS: | All | ||
|
Description
Alex Volkov
2007-02-04 15:49:42 UTC
It seems Bugzilla fails right now when attempting to create an attachment, so here is the patch:
Index: SDL_blit_A.c
===================================================================
--- SDL_blit_A.c (revision 2952)
+++ SDL_blit_A.c (working copy)
@@ -369,7 +369,9 @@
packsswb_r2r(mm6, mm3); /* 0000FFFF -> mm3 */
pxor_r2r(mm0, mm3); /* 0000F000 -> mm3 (~channel mask) */
/* get alpha channel shift */
- movd_m2r(sf->Ashift, mm5); /* Ashift -> mm5 */
+ __asm__ __volatile__ (
+ "movd %0, %%mm5"
+ : : "rm" ((Uint32) sf->Ashift) ); /* Ashift -> mm5 */
while(height--) {
DUFFS_LOOP4({
@@ -1566,7 +1568,6 @@
int dstskip = info->d_skip >> 2;
SDL_PixelFormat* sf = info->src;
Uint32 amask = sf->Amask;
- Uint32 ashift = sf->Ashift;
__asm__ (
/* make mm6 all zeros. */
@@ -1588,7 +1589,7 @@
/* get alpha channel shift */
"movd %1, %%mm5\n\t" /* Ashift -> mm5 */
- : /* nothing */ : "m" (amask), "m" (ashift) );
+ : /* nothing */ : "rm" (amask), "rm" ((Uint32) sf->Ashift) );
while(height--) {
Fixed in svn revision #3006 for the 1.2 branch and #3007 for the 1.3 branch. Thanks! --ryan. |