Add support for VK_FORMAT_A2B10G10R10_UINT_PACK32 render targets
Bug: b/131896622
Test: dEQP-VK.*a2b10g10r10*
Change-Id: I0c50b14b007bd86dfaff39cf04938860408157f8
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30529
Tested-by: Chris Forbes <chrisforbes@google.com>
Presubmit-Ready: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Pipeline/Constants.cpp b/src/Pipeline/Constants.cpp
index 45e8b50..ac9d636 100644
--- a/src/Pipeline/Constants.cpp
+++ b/src/Pipeline/Constants.cpp
@@ -262,6 +262,15 @@
maskD01X[i][3] = -(i >> 1 & 1);
}
+ for (int i = 0; i < 16; i++)
+ {
+ mask10Q[i][0] = mask10Q[i][1] =
+ (i & 0x1 ? 0x3FF : 0) |
+ (i & 0x2 ? 0xFFC00 : 0) |
+ (i & 0x4 ? 0x3FF00000 : 0) |
+ (i & 0x8 ? 0xC0000000 : 0);
+ }
+
for(int i = 0; i < 256; i++)
{
sRGBtoLinear8_16[i] = (unsigned short)(sw::sRGBtoLinear((float)i / 0xFF) * 0xFFFF + 0.5f);