Commit c0fb8a07 by Nicolas Capens

Fix aligned access regression.

This fixes commit cd0ea234. Change-Id: I51c82049fa809f303401b6623dbaa947a50d6d62 Reviewed-on: https://swiftshader-review.googlesource.com/4519Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 7154c1ce
...@@ -272,7 +272,7 @@ namespace sw ...@@ -272,7 +272,7 @@ namespace sw
case FORMAT_A8R8G8B8: case FORMAT_A8R8G8B8:
For(, x < width - 3, x += 4) For(, x < width - 3, x += 4)
{ {
*Pointer<Int4>(d, 1) = *Pointer<Int4>(s, sStride % 4 ? 1 : 16); *Pointer<Int4>(d, 1) = *Pointer<Int4>(s, sStride % 16 ? 1 : 16);
s += 4 * sBytes; s += 4 * sBytes;
d += 4 * dBytes; d += 4 * dBytes;
...@@ -282,7 +282,7 @@ namespace sw ...@@ -282,7 +282,7 @@ namespace sw
case FORMAT_A8B8G8R8: case FORMAT_A8B8G8R8:
For(, x < width - 3, x += 4) For(, x < width - 3, x += 4)
{ {
Int4 bgra = *Pointer<Int4>(s, sStride % 4 ? 1 : 16); Int4 bgra = *Pointer<Int4>(s, sStride % 16 ? 1 : 16);
*Pointer<Int4>(d, 1) = ((bgra & Int4(0x00FF0000)) >> 16) | *Pointer<Int4>(d, 1) = ((bgra & Int4(0x00FF0000)) >> 16) |
((bgra & Int4(0x000000FF)) << 16) | ((bgra & Int4(0x000000FF)) << 16) |
...@@ -379,7 +379,7 @@ namespace sw ...@@ -379,7 +379,7 @@ namespace sw
case FORMAT_A8B8G8R8: case FORMAT_A8B8G8R8:
For(, x < width - 3, x += 4) For(, x < width - 3, x += 4)
{ {
*Pointer<Int4>(d, 1) = *Pointer<Int4>(s, sStride % 4 ? 1 : 16); *Pointer<Int4>(d, 1) = *Pointer<Int4>(s, sStride % 16 ? 1 : 16);
s += 4 * sBytes; s += 4 * sBytes;
d += 4 * dBytes; d += 4 * dBytes;
...@@ -389,7 +389,7 @@ namespace sw ...@@ -389,7 +389,7 @@ namespace sw
case FORMAT_A8R8G8B8: case FORMAT_A8R8G8B8:
For(, x < width - 3, x += 4) For(, x < width - 3, x += 4)
{ {
Int4 bgra = *Pointer<Int4>(s, sStride % 4 ? 1 : 16); Int4 bgra = *Pointer<Int4>(s, sStride % 16 ? 1 : 16);
*Pointer<Int4>(d, 1) = ((bgra & Int4(0x00FF0000)) >> 16) | *Pointer<Int4>(d, 1) = ((bgra & Int4(0x00FF0000)) >> 16) |
((bgra & Int4(0x000000FF)) << 16) | ((bgra & Int4(0x000000FF)) << 16) |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment