Commit 10b295cd by Nicolas Capens

Implement support for RGBA blitting.

Change-Id: I1ad9fed9aea34cd20f8d78f4d4469c61aeb00ea6 Reviewed-on: https://swiftshader-review.googlesource.com/2753Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent 0c42ee1a
......@@ -104,10 +104,17 @@ namespace sw
case FORMAT_A8R8G8B8:
c = Float4(*Pointer<Byte4>(element)).zyxw;
break;
case FORMAT_A8B8G8R8:
c = Float4(*Pointer<Byte4>(element));
break;
case FORMAT_X8R8G8B8:
c = Float4(*Pointer<Byte4>(element)).zyxw;
c.w = 1.0f;
break;
case FORMAT_X8B8G8R8:
c = Float4(*Pointer<Byte4>(element));
c.w = 1.0f;
break;
case FORMAT_A16B16G16R16:
c = Float4(*Pointer<UShort4>(element));
break;
......@@ -240,7 +247,9 @@ namespace sw
case FORMAT_L8:
case FORMAT_A8:
case FORMAT_A8R8G8B8:
case FORMAT_A8B8G8R8:
case FORMAT_X8R8G8B8:
case FORMAT_X8B8G8R8:
unscale = vector(255, 255, 255, 255);
break;
case FORMAT_A16B16G16R16:
......@@ -263,7 +272,9 @@ namespace sw
case FORMAT_L8:
case FORMAT_A8:
case FORMAT_A8R8G8B8:
case FORMAT_A8B8G8R8:
case FORMAT_X8R8G8B8:
case FORMAT_X8B8G8R8:
scale = vector(255, 255, 255, 255);
break;
case FORMAT_A16B16G16R16:
......@@ -311,6 +322,13 @@ namespace sw
*Pointer<UInt>(d) = UInt(As<Long>(c1));
}
break;
case FORMAT_A8B8G8R8:
{
UShort4 c0 = As<UShort4>(RoundShort4(color));
Byte8 c1 = Pack(c0, c0);
*Pointer<UInt>(d) = UInt(As<Long>(c1));
}
break;
case FORMAT_X8R8G8B8:
{
UShort4 c0 = As<UShort4>(RoundShort4(color.zyxw));
......@@ -318,6 +336,13 @@ namespace sw
*Pointer<UInt>(d) = UInt(As<Long>(c1)) | 0xFF000000;
}
break;
case FORMAT_X8B8G8R8:
{
UShort4 c0 = As<UShort4>(RoundShort4(color));
Byte8 c1 = Pack(c0, c0);
*Pointer<UInt>(d) = UInt(As<Long>(c1)) | 0xFF000000;
}
break;
case FORMAT_A16B16G16R16:
*Pointer<UShort4>(d) = UShort4(RoundInt(color));
break;
......
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