Commit 8ab4053f by Ben Clayton

Implement Float16 formats and additional blend modes.

The float16 loads and stores are horrendously unoptimized, but this can be addressed as a later pass. Tests: dEQP-VK.renderpass.suballocation.formats.r16_sfloat.* Tests: dEQP-VK.renderpass.suballocation.formats.r16g16_sfloat.* Tests: dEQP-VK.renderpass.suballocation.formats.r16g16b16a16_sfloat.* Tests: dEQP-VK.pipeline.blend.format.r16_sfloat.* Tests: dEQP-VK.pipeline.blend.format.r16g16_sfloat.* Tests: dEQP-VK.pipeline.blend.format.r16g16b16a16_sfloat.* Bug: b/132434966 Bug: b/132433217 Change-Id: Ifa8feaeecefa1926b1f500e6c9d23e6c242a6844 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31113Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com>
parent 2568cf76
...@@ -187,6 +187,9 @@ namespace sw ...@@ -187,6 +187,9 @@ namespace sw
} }
} }
break; break;
case VK_FORMAT_R16_SFLOAT:
case VK_FORMAT_R16G16_SFLOAT:
case VK_FORMAT_R16G16B16A16_SFLOAT:
case VK_FORMAT_R32_SFLOAT: case VK_FORMAT_R32_SFLOAT:
case VK_FORMAT_R32G32_SFLOAT: case VK_FORMAT_R32G32_SFLOAT:
case VK_FORMAT_R32G32B32A32_SFLOAT: case VK_FORMAT_R32G32B32A32_SFLOAT:
...@@ -268,6 +271,9 @@ namespace sw ...@@ -268,6 +271,9 @@ namespace sw
case VK_FORMAT_R32_UINT: case VK_FORMAT_R32_UINT:
case VK_FORMAT_R32G32_UINT: case VK_FORMAT_R32G32_UINT:
case VK_FORMAT_R32G32B32A32_UINT: case VK_FORMAT_R32G32B32A32_UINT:
case VK_FORMAT_R16_SFLOAT:
case VK_FORMAT_R16G16_SFLOAT:
case VK_FORMAT_R16G16B16A16_SFLOAT:
case VK_FORMAT_R16_SINT: case VK_FORMAT_R16_SINT:
case VK_FORMAT_R16G16_SINT: case VK_FORMAT_R16G16_SINT:
case VK_FORMAT_R16G16B16A16_SINT: case VK_FORMAT_R16G16B16A16_SINT:
......
...@@ -3176,6 +3176,16 @@ namespace rr ...@@ -3176,6 +3176,16 @@ namespace rr
return RValue<UInt2>(Nucleus::createNot(val.value)); return RValue<UInt2>(Nucleus::createNot(val.value));
} }
RValue<UInt> Extract(RValue<UInt2> val, int i)
{
return RValue<UInt>(Nucleus::createExtractElement(val.value, UInt::getType(), i));
}
RValue<UInt2> Insert(RValue<UInt2> val, RValue<UInt> element, int i)
{
return RValue<UInt2>(Nucleus::createInsertElement(val.value, element.value, i));
}
Int4::Int4() : XYZW(this) Int4::Int4() : XYZW(this)
{ {
} }
......
...@@ -1399,6 +1399,8 @@ namespace rr ...@@ -1399,6 +1399,8 @@ namespace rr
// RValue<Bool> operator==(RValue<UInt2> lhs, RValue<UInt2> rhs); // RValue<Bool> operator==(RValue<UInt2> lhs, RValue<UInt2> rhs);
// RValue<UInt2> RoundInt(RValue<Float4> cast); // RValue<UInt2> RoundInt(RValue<Float4> cast);
RValue<UInt> Extract(RValue<UInt2> val, int i);
RValue<UInt2> Insert(RValue<UInt2> val, RValue<UInt> element, int i);
template<class T> template<class T>
struct Scalar; struct Scalar;
......
...@@ -2689,16 +2689,6 @@ namespace rr ...@@ -2689,16 +2689,6 @@ namespace rr
return T(Type_v2i32); return T(Type_v2i32);
} }
RValue<UInt> Extract(RValue<UInt2> val, int i)
{
return RValue<UInt>(Nucleus::createExtractElement(val.value, UInt::getType(), i));
}
RValue<UInt2> Insert(RValue<UInt2> val, RValue<UInt> element, int i)
{
return RValue<UInt2>(Nucleus::createInsertElement(val.value, element.value, i));
}
RValue<UInt2> operator<<(RValue<UInt2> lhs, unsigned char rhs) RValue<UInt2> operator<<(RValue<UInt2> lhs, unsigned char rhs)
{ {
if(emulateIntrinsics) if(emulateIntrinsics)
......
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