Android: Galaxy S23 support

This CL:
* Adds detection of the device
* Adds end2end test support
* end2end test expectations for Vulkan backend
* Works around driver issue with vkCmdSetLogicOpEXT

Test: angle_end2end_tests, angle_trace_tests
Bug: b/277717225, b/281128706
Bug: angleproject:8157
Change-Id: If6caa5b2ba0b9d7f94e1be0841bcff2ea1c34d89
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4509693
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
diff --git a/src/libANGLE/renderer/driver_utils.h b/src/libANGLE/renderer/driver_utils.h
index 744a5b1..a174894 100644
--- a/src/libANGLE/renderer/driver_utils.h
+++ b/src/libANGLE/renderer/driver_utils.h
@@ -45,6 +45,7 @@
     ANDROID_DEVICE_ID_PIXEL2      = 0x5040001,
     ANDROID_DEVICE_ID_PIXEL1XL    = 0x5030004,
     ANDROID_DEVICE_ID_PIXEL4      = 0x6040001,
+    ANDROID_DEVICE_ID_GALAXYS23   = 0x43050A01,
     ANDROID_DEVICE_ID_SWIFTSHADER = 0xC0DE,
 };
 
@@ -138,6 +139,11 @@
     return IsQualcomm(vendorId) && deviceId == ANDROID_DEVICE_ID_PIXEL4;
 }
 
+inline bool IsGalaxyS23(uint32_t vendorId, uint32_t deviceId)
+{
+    return IsQualcomm(vendorId) && deviceId == ANDROID_DEVICE_ID_GALAXYS23;
+}
+
 inline bool IsSwiftshader(uint32_t vendorId, uint32_t deviceId)
 {
     return IsGoogle(vendorId) && deviceId == ANDROID_DEVICE_ID_SWIFTSHADER;
diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp
index 69e2978..db84000 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -3705,6 +3705,9 @@
     // MESA Virtio-GPU Venus driver: https://docs.mesa3d.org/drivers/venus.html
     const bool isVenus = IsVenus(mDriverProperties.driverID, mPhysicalDeviceProperties.deviceName);
 
+    const bool isGalaxyS23 =
+        IsGalaxyS23(mPhysicalDeviceProperties.vendorID, mPhysicalDeviceProperties.deviceID);
+
     // Distinguish between the open source and proprietary Qualcomm drivers
     const bool isQualcommOpenSource =
         IsQualcommOpenSource(mPhysicalDeviceProperties.vendorID, mDriverProperties.driverID,
@@ -4300,12 +4303,14 @@
 
     // Disabled on Intel/Mesa due to driver bug (crbug.com/1379201).  This bug is fixed since Mesa
     // 22.2.0.
-    const bool isAtLeastMesa22_2 =
-        mesaVersion.major >= 22 || (mesaVersion.major == 22 && mesaVersion.minor >= 2);
+    const bool isMesaLessThan22_2 =
+        mesaVersion.major < 22 || (mesaVersion.major == 22 && mesaVersion.minor < 2);
+
     ANGLE_FEATURE_CONDITION(
         &mFeatures, supportsLogicOpDynamicState,
-        mExtendedDynamicState2Features.extendedDynamicState2LogicOp == VK_TRUE &&
-            (!(IsLinux() && isIntel) || isAtLeastMesa22_2));
+        mFeatures.supportsExtendedDynamicState2.enabled &&
+            mExtendedDynamicState2Features.extendedDynamicState2LogicOp == VK_TRUE &&
+            !(IsLinux() && isIntel && isMesaLessThan22_2) && !(IsAndroid() && isGalaxyS23));
 
     // Avoid dynamic state for vertex input binding stride on buggy drivers.
     ANGLE_FEATURE_CONDITION(&mFeatures, forceStaticVertexStrideState,
diff --git a/src/tests/angle_end2end_tests_expectations.txt b/src/tests/angle_end2end_tests_expectations.txt
index 5cf5846..c73c64a 100644
--- a/src/tests/angle_end2end_tests_expectations.txt
+++ b/src/tests/angle_end2end_tests_expectations.txt
@@ -1182,6 +1182,77 @@
 5076 : GLSLTest.VerifyMaxVertexUniformVectors* = TIMEOUT
 5076 : GLSLTest.VerifyMaxFragmentUniformVectors* = TIMEOUT
 6261 : MultithreadingTest* = TIMEOUT
+
+// GalaxyS23 ES2 tests
+8157 GALAXYS23 VULKAN : DepthStencilTest.StencilOnlyDrawThenCopyThenDraw/* = SKIP
+8157 GALAXYS23 VULKAN : DepthStencilTest.StencilOnlyEmulatedWithPacked/* = SKIP
+8157 GALAXYS23 VULKAN : DrawBuffersTest.NoneWithStencil/* = SKIP
+8157 GALAXYS23 VULKAN : EGLQueryContextTest.NotInitialized/ES2_Vulkan_NoFixture = SKIP
+8157 GALAXYS23 VULKAN : EXTBlendFuncExtendedDrawTest.FragData/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest.ConstantFoldedConstantsRetainPrecision/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest.VectorAndMatrixScalarizationDoesNotAffectRendering/* = SKIP
+8157 GALAXYS23 VULKAN : PointSpritesTest.PointSizeAboveMaxIsClamped/* = SKIP
+8157 GALAXYS23 VULKAN : RobustResourceInitTest.MaskedStencilClear/* = SKIP
+
+// GalaxyS23 ES3 tests
+8157 GALAXYS23 VULKAN : BlitFramebufferTest.BlitStencilScissoredScaled/* = SKIP
+8157 GALAXYS23 VULKAN : BlitFramebufferTest.MultisampleStencil/* = SKIP
+8157 GALAXYS23 VULKAN : BlitFramebufferTest.ScissoredMultisampleStencil/* = SKIP
+8157 GALAXYS23 VULKAN : ClearTestES3.RepeatedStencilClearWithBlitInBetween/* = SKIP
+8157 GALAXYS23 VULKAN : DepthStencilTestES3.FramebufferClearThenStencilAttachedThenStencilTestState/* = SKIP
+8157 GALAXYS23 VULKAN : DepthStencilTestES3.FramebufferClearThenStencilTestStateThenStencilAttached/* = SKIP
+8157 GALAXYS23 VULKAN : DepthStencilTestES3.StencilTestStateThenFramebufferClearThenStencilAttached/* = SKIP
+8157 GALAXYS23 VULKAN : EGLBlobCacheTest.ThreadSafety/* = SKIP
+8157 GALAXYS23 VULKAN : EXTBlendFuncExtendedDrawTestES3.FragmentArrayOutputLocationsAPI/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest_ES3.CompareEqualityOfArrayOfMatrices/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest_ES3.CompareInequalityOfArrayOfMatrices/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest_ES3.SequenceOperatorEvaluationOrderDynamicVectorIndexingInLValue/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest_ES3.ValidIndexClampES300/* = SKIP
+8157 GALAXYS23 VULKAN : ImageTestES3.SourceYUVAHBTargetExternalYUVSampleLinearFiltering/* = SKIP
+8157 GALAXYS23 VULKAN : MultithreadingTestES3.MultithreadFenceDraw/* = SKIP
+8157 GALAXYS23 VULKAN : MultithreadingTestES3.MultithreadFenceTexImage/* = SKIP
+8157 GALAXYS23 VULKAN : RobustResourceInitTestES3.MaskedStencilClearBuffer/* = SKIP
+8157 GALAXYS23 VULKAN : SampleVariablesTest.SamplePosition/* = SKIP
+8157 GALAXYS23 VULKAN : SimpleStateChangeTestES3.OutOfBoundsByteAttribute/* = SKIP
+8157 GALAXYS23 VULKAN : StateChangeTestES3.CullFaceAndFrontFace/* = SKIP
+8157 GALAXYS23 VULKAN : StateChangeTestES3.StencilReferenceAndCompareMask/* = SKIP
+8157 GALAXYS23 VULKAN : Texture2DArrayCopy.UnsignedByteFormats/* = SKIP
+8157 GALAXYS23 VULKAN : Texture2DArrayCopy.UnsizedFormats/* = SKIP
+8157 GALAXYS23 VULKAN : Texture2DTestES3.TexImageWithStencilData/* = SKIP
+8157 GALAXYS23 VULKAN : Texture2DTestES3.TexImageWithStencilPBO/* = SKIP
+8157 GALAXYS23 VULKAN : Texture3DCopy.UnsignedByteFormats/* = SKIP
+8157 GALAXYS23 VULKAN : Texture3DCopy.UnsizedFormats/* = SKIP
+8157 GALAXYS23 VULKAN : VulkanPerformanceCounterTest.DepthFuncALWAYSWithDepthMaskDisabledShouldNotLoadStore/* = SKIP
+8157 GALAXYS23 VULKAN : VulkanPerformanceCounterTest.FenceSyncAndColorInvalidate/* = SKIP
+8157 GALAXYS23 VULKAN : VulkanPerformanceCounterTest.InRenderpassFlushShouldNotBreakRenderpass/* = SKIP
+8157 GALAXYS23 VULKAN : WebGL2GLSLTest.InitUninitializedLocals/* = SKIP
+
+8157 GALAXYS23 VULKAN : BlitFramebufferANGLETest.BlitColorToDefault/ES3_Vulkan_EmulatedPrerotation270 = SKIP
+8157 GALAXYS23 VULKAN : BlitFramebufferANGLETest.ReverseScissoredBlit/ES3_Vulkan_EmulatedPrerotation270 = SKIP
+8157 GALAXYS23 VULKAN : FramebufferTest_ES3.ChangeAttachmentThenInvalidateAndDraw/ES3_Vulkan_EmulatedPrerotation180 = SKIP
+8157 GALAXYS23 VULKAN : FramebufferTest_ES3.AttachmentsWithUnequalDimensions/ES3_Vulkan_AsyncCommandQueue = SKIP
+8157 GALAXYS23 VULKAN : PixelLocalStorageTest.DrawStateReset/ES3_Vulkan_AsyncCommandQueue_EmulatePixelLocalStorage = SKIP
+
+// GalaxyS23 ES3_1 tests
+8157 GALAXYS23 VULKAN : FramebufferTest_ES31.ChangeFBOSizeAndAttachmentsCount/* = SKIP
+8157 GALAXYS23 VULKAN : FramebufferTest_ES31.ChangeFBOSizeWithNoAttachments/* = SKIP
+8157 GALAXYS23 VULKAN : FramebufferTest_ES31.CreateNoAttachmentFBOWithDifferentSize/* = SKIP
+8157 GALAXYS23 VULKAN : FramebufferTest_ES31.RenderingLimitToDefaultFBOSizeWithNoAttachments/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest_ES31.ArrayOfArrayOfSamplerDynamicIndex/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest_ES31.ArrayOfArrayOfSamplerInStructDynamicIndex/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest_ES31.ParameterArrayArrayArraySampler/* = SKIP
+8157 GALAXYS23 VULKAN : GLSLTest_ES31.TypesUsedInDifferentBlockStorages/* = SKIP
+8157 GALAXYS23 VULKAN : ProgramPipelineTest31.SampleTextureAThenTextureB/* = SKIP
+8157 GALAXYS23 VULKAN : TransformFeedbackTestIOBlocks.Interleaved/* = SKIP
+
+8157 GALAXYS23 VULKAN : GLSLTest_ES31_InitShaderVariables.InitIOBlockWithComplexTypes/ES3_1_Vulkan_ForceInitShaderVariables = SKIP
+8157 GALAXYS23 VULKAN : PixelLocalStorageTestES31.EarlyFragmentTests/ES3_1_Vulkan_AsyncCommandQueue_EmulatePixelLocalStorage = SKIP
+8157 GALAXYS23 VULKAN : PixelLocalStorageTestES31.EarlyFragmentTests/ES3_1_Vulkan_EmulatePixelLocalStorage_NoSupportsShaderFramebufferFetch_NoSupportsFragmentShaderPixelInterlock = SKIP
+8157 GALAXYS23 VULKAN : PixelLocalStorageTestES31.DrawStateReset/ES3_1_Vulkan_AsyncCommandQueue_EmulatePixelLocalStorage = SKIP
+
+// GalaxyS23 ES3_2 tests
+8157 GALAXYS23 VULKAN : TransformFeedbackTestES32.PrimitivesGeneratedVsIndirectDraw/* = SKIP
+
 // Please do not add expectations below this line,
 // so that TIMEOUT expectations above don't override more precise SKIP expectations
 
diff --git a/src/tests/test_expectations/GPUTestConfig.cpp b/src/tests/test_expectations/GPUTestConfig.cpp
index 2746c33..ab0bf8e 100644
--- a/src/tests/test_expectations/GPUTestConfig.cpp
+++ b/src/tests/test_expectations/GPUTestConfig.cpp
@@ -444,6 +444,11 @@
     return IsAndroidDevice("Pixel 6");
 }
 
+inline bool IsGalaxyS23()
+{
+    return IsAndroidDevice("SM-S911U1");
+}
+
 // Check whether the active GPU is a specific device based on the string device ID.
 inline bool IsDeviceIdGPU(const std::string &gpuDeviceId)
 {
@@ -560,6 +565,7 @@
     mConditions[kConditionPixel2OrXL]       = !isSwiftShader && (IsPixel2() || IsPixel2XL());
     mConditions[kConditionPixel4OrXL]       = !isSwiftShader && (IsPixel4() || IsPixel4XL());
     mConditions[kConditionPixel6]           = !isSwiftShader && (IsPixel6());
+    mConditions[kConditionGalaxyS23]        = !isSwiftShader && (IsGalaxyS23());
     mConditions[kConditionNVIDIAQuadroP400] = !isSwiftShader && IsNVIDIAQuadroP400();
     mConditions[kConditionNVIDIAGTX1660]    = !isSwiftShader && IsNVIDIAGTX1660();
 
diff --git a/src/tests/test_expectations/GPUTestConfig.h b/src/tests/test_expectations/GPUTestConfig.h
index e408d67..839a1a7 100644
--- a/src/tests/test_expectations/GPUTestConfig.h
+++ b/src/tests/test_expectations/GPUTestConfig.h
@@ -67,6 +67,7 @@
         kConditionPixel2OrXL,
         kConditionPixel4OrXL,
         kConditionPixel6,
+        kConditionGalaxyS23,
         kConditionNVIDIAQuadroP400,
         kConditionNVIDIAGTX1660,
         kConditionSwiftShader,
diff --git a/src/tests/test_expectations/GPUTestExpectationsParser.cpp b/src/tests/test_expectations/GPUTestExpectationsParser.cpp
index 4c91384..578c5eb 100644
--- a/src/tests/test_expectations/GPUTestExpectationsParser.cpp
+++ b/src/tests/test_expectations/GPUTestExpectationsParser.cpp
@@ -77,6 +77,7 @@
     kConfigPixel2,
     kConfigPixel4,
     kConfigPixel6,
+    kConfigGalaxyS23,
     // GPU devices
     kConfigNVIDIAQuadroP400,
     kConfigNVIDIAGTX1660,
@@ -184,6 +185,7 @@
     {"pixel2orxl", GPUTestConfig::kConditionPixel2OrXL},
     {"pixel4orxl", GPUTestConfig::kConditionPixel4OrXL},
     {"pixel6", GPUTestConfig::kConditionPixel6},
+    {"galaxys23", GPUTestConfig::kConditionGalaxyS23},
     {"quadrop400", GPUTestConfig::kConditionNVIDIAQuadroP400},
     {"gtx1660", GPUTestConfig::kConditionNVIDIAGTX1660},
     {"prerotation", GPUTestConfig::kConditionPreRotation},
@@ -504,6 +506,7 @@
             case kConfigPixel2:
             case kConfigPixel4:
             case kConfigPixel6:
+            case kConfigGalaxyS23:
             case kConfigNVIDIAQuadroP400:
             case kConfigNVIDIAGTX1660:
             case kConfigPreRotation: