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 <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
This commit is contained in:
Xinghua Cao 2020-06-10 03:29:34 +00:00 committed by Commit Bot service account
parent 14f20b0ab3
commit 527080ff03
2 changed files with 3 additions and 1 deletions

View File

@ -220,6 +220,8 @@ namespace dawn_native { namespace metal {
mSupportedExtensions.EnableExtension(Extension::TimestampQuery); mSupportedExtensions.EnableExtension(Extension::TimestampQuery);
} }
#endif #endif
mSupportedExtensions.EnableExtension(Extension::ShaderFloat16);
} }
id<MTLDevice> mDevice = nil; id<MTLDevice> mDevice = nil;

View File

@ -108,4 +108,4 @@ TEST_P(ShaderFloat16Tests, Basic16BitFloatFeaturesTest) {
EXPECT_BUFFER_U16_RANGE_EQ(expected, bufferOut, 0, 2); EXPECT_BUFFER_U16_RANGE_EQ(expected, bufferOut, 0, 2);
} }
DAWN_INSTANTIATE_TEST(ShaderFloat16Tests, VulkanBackend()); DAWN_INSTANTIATE_TEST(ShaderFloat16Tests, MetalBackend(), VulkanBackend());