From 527080ff03ce4541a12c2648b6a44e53a1d6384e Mon Sep 17 00:00:00 2001 From: Xinghua Cao Date: Wed, 10 Jun 2020 03:29:34 +0000 Subject: [PATCH] Check FP16 support on Metal backend Metal supports FP16 on both macOS and iOS, so we can unconditionally enable this extension on Metal backend. BUG=dawn:426 TEST=dawn_end2end_tests Change-Id: I16c9c907bb112a66e76506ede9bc89a04313d7b3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/22882 Reviewed-by: Jiawei Shao Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Xinghua Cao --- src/dawn_native/metal/BackendMTL.mm | 2 ++ src/tests/end2end/ShaderFloat16Tests.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dawn_native/metal/BackendMTL.mm b/src/dawn_native/metal/BackendMTL.mm index 093cceb5af..a5e7c474fb 100644 --- a/src/dawn_native/metal/BackendMTL.mm +++ b/src/dawn_native/metal/BackendMTL.mm @@ -220,6 +220,8 @@ namespace dawn_native { namespace metal { mSupportedExtensions.EnableExtension(Extension::TimestampQuery); } #endif + + mSupportedExtensions.EnableExtension(Extension::ShaderFloat16); } id mDevice = nil; diff --git a/src/tests/end2end/ShaderFloat16Tests.cpp b/src/tests/end2end/ShaderFloat16Tests.cpp index 57d94beae2..fa0fd4784c 100644 --- a/src/tests/end2end/ShaderFloat16Tests.cpp +++ b/src/tests/end2end/ShaderFloat16Tests.cpp @@ -108,4 +108,4 @@ TEST_P(ShaderFloat16Tests, Basic16BitFloatFeaturesTest) { EXPECT_BUFFER_U16_RANGE_EQ(expected, bufferOut, 0, 2); } -DAWN_INSTANTIATE_TEST(ShaderFloat16Tests, VulkanBackend()); \ No newline at end of file +DAWN_INSTANTIATE_TEST(ShaderFloat16Tests, MetalBackend(), VulkanBackend());