OSDN Git Service

Fixed R8I and R8UI fragment output formats
authorAlexis Hetu <sugoi@google.com>
Thu, 15 Sep 2016 21:54:05 +0000 (17:54 -0400)
committerAlexis Hétu <sugoi@google.com>
Fri, 16 Sep 2016 12:11:50 +0000 (12:11 +0000)
There was a silly mistake in the code that I just found.
Instead of being ordered (1,2,3,4), the 4 pixels being
outputted were ordered (3,4,1,2), which was within the
tolerance threshold for most of the image, but exhibited
weird sparse diagonal lines of errors (values outside of
threshold). Reordered the pixels properly to fix the issue.

Change-Id: I082463d22e585e5ee98836a87ef60efca05e58f0
Reviewed-on: https://swiftshader-review.googlesource.com/7192
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/Shader/PixelRoutine.cpp

index cc46ab3..715e971 100644 (file)
@@ -2323,9 +2323,9 @@ namespace sw
 
                                UInt xyzw, packedCol;
 
-                               xyzw = UInt(*Pointer<UShort>(buffer)) << 16;
+                               xyzw = UInt(*Pointer<UShort>(buffer)) & 0xFFFF;
                                buffer += *Pointer<Int>(data + OFFSET(DrawData, colorPitchB[index]));
-                               xyzw |= UInt(*Pointer<UShort>(buffer));
+                               xyzw |= UInt(*Pointer<UShort>(buffer)) << 16;
 
                                Short4 tmpCol = Short4(As<Int4>(oC.x));
                                if(state.targetFormat[index] == FORMAT_R8I)