Commit cd0ea234 by Nicolas Capens

Fix basing aligned access on stride instead of width.

Change-Id: I8c3600e9bce3e647ccbeb5590744530d43769ea2 Reviewed-on: https://swiftshader-review.googlesource.com/4515Tested-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 68f86947
...@@ -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, width % 4 ? 1 : 16); *Pointer<Int4>(d, 1) = *Pointer<Int4>(s, sStride % 4 ? 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, width % 4 ? 1 : 16); Int4 bgra = *Pointer<Int4>(s, sStride % 4 ? 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, width % 4 ? 1 : 16); *Pointer<Int4>(d, 1) = *Pointer<Int4>(s, sStride % 4 ? 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, width % 4 ? 1 : 16); Int4 bgra = *Pointer<Int4>(s, sStride % 4 ? 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