Skip to content

Commit 3109939

Browse files
authored
Don't compile shaders to SkSL unless --sksl arg is present (#182519)
The main change of this PR is to make `impellerc_main` no longer use `TargetPlatformBundlesSkSL(switches.SelectDefaultTargetPlatform())` to determine whether to compile to SkSL. Addresses the "sksl unexpectedly compiling when building for ios" mentioned in #182400. `TargetPlatformBundlesSkSL()` returned `true` when running impellerc targeting *any* runtime shaders. So even though https://github.com/flutter/flutter/pull/163144/changes changed iOS runtime shaders to no longer call impellerc with the `--sksl` runtime target, it would still compile to SkSL because of the `--runtime-stage-metal` runtime target. After this PR, impellerc will only compile to SkSL if `--sksl` is explicitly provided when calling impellerc. The rest of the changes in this PR are related changes to improve code organization and to update tests. - `impellerc_main.cc`: - `OutputIPLR()`: Remove the custom logic for compiling to SkSL. SkSL is now treated the same as all the other compile targets in the `for (const auto& platform : switches.PlatformsToCompile())` loop. This is the only change with a behavioral difference in the PR. We no longer use `TargetPlatformBundlesSkSL(switches.SelectDefaultTargetPlatform())` to determine whether to compile to SkSL. Instead, it's treated the same as any other compilation target and will only be targeted when it is specified as an arg to the executable. - Remove the `CompileSkSL()` helper function. This had the exact same logic as what is used for all the other compilation targets in the `for (const auto& platform : switches.PlatformsToCompile())` loop. So it is not needed. - `OutputDepfile()`: Remove the switch/case. The `TargetPlatform::kUnknown` case is unreachable, so this used the other case 100% of the time. - `Main()`: `switches.CreateSourceOptions()` no longer has a default platform target parameter. It doesn't matter which target it's called with here. Arbitrarily call it with `switches.PlatformsToCompile().front()`. - `types.h/cc`: - Remove the `TargetPlatformBundlesSkSL()` function. The only place this was used was for `impellerc_main.cc`'s special case logic for SkSL, which was removed as described above. - `switches.h/cc`: - Remove the optional/default parameter for `CreateSourceOptions()`. This used to fall back to calling `SelectDefaultTargetPlatform()` to determine the default value. I found this to be very unclear behavior. The only place this was actually called with the default parameter is in one function in `shader_bundle.cc` where the selected target platform does not actually matter, so it doesn't even need this somewhat-convoluted logic to select a platform with `SelectDefaultTargetPlatform()`. I changed `CreateSourceOptions()` to require an explicit parameter, which I think makes the function's behavior clearer by removing the confusing default parameter. - Remove the `SelectDefaultTargetPlatform()` function. I think it was a little unclear/nonobvious what this was actually returning. It was only used in 3 places, all of which were kind of confusing/unneeded: 1. In this same file, to pick the default target platform in `switches.CreateSourceOptions()`. As described above, this seems entirely unnecessary. 1. In `impeller_main.cc`, used in `TargetPlatformBundlesSkSL(switches.SelectDefaultTargetPlatform())` to determine whether to compile to SkSL. As described above, we don't want this behavior. I think it was also kind of confusing. 1. In `impeller_main.cc`, used for the switch/case in `OutputDepfile()`. As described above, this switch/case is entirely unnecessary. - Change the `kKnownRuntimeStages` map to be a vector of pairs. This is iterated through to populate the returned `runtime_stages_` list of `Switches::PlatformsToCompile()`. Making it a vector makes the `runtime_stages_` list maintain the ordering of `kKnownRuntimeStages` (previously, iterating through the map would iterate in alphabetical order of the keys). - `impellerc_main.cc`'s `OutputIPLR()` now compiles to targets based on `Switches::PlatformsToCompile()`, without special case logic to always compile to "sksl" first. Changing this to a vector with "sksl" as the first value preserves the original behavior of compiling to "sksl" before any other targets. We do this because certain tests that perform a failed shader compilation check specifically for an SkSL-based error message (e.g. [this one](https://github.com/flutter/flutter/blob/64866862f623ceeb45fd8be4782e8db8b58910c0/packages/flutter_tools/test/integration.shard/shader_compiler_test.dart#L150-L170)). So for these tests, we need to try/fail with the SkSL compiler first, before trying/failing with other compilers which would produce a different error message. - `shader_bundle.cc` - As described above, change the usage of `switches.CreateSourceOptions()` to require an explicit target platform parameter. This particular usage doesn't matter, so use `TargetPlatform::kUnknown` and add an explanatory comment. - `compiler.cc` - In `CreateCompiler()`, Add an `FML_UNREACHABLE` for the `TargetPlatform::kUnknown` case, instead of falling back to using a vulkan compiler. It doesn't make sense to call `CreateCompiler()` with `TargetPlatform::kUnknown`. And currently, it can't happen: The only use of `CreateCompiler()` is in the `Compiler` constructor on [line 432](https://github.com/flutter/flutter/blob/24ce716cfddfef201027c1a5fa2299a8aeffb03e/engine/src/flutter/impeller/compiler/compiler.cc#L432), and there is a check preventing `TargetPlatform::kUnknown` earlier on [line 292](https://github.com/flutter/flutter/blob/24ce716cfddfef201027c1a5fa2299a8aeffb03e/engine/src/flutter/impeller/compiler/compiler.cc#L292). - `compiler_unittests.cc`, `compiler_test.h` - The `INSTANTIATE_{TARGET|RUNTIME_TARGET|SKSL_TARGET}_PLATFORM_TEST_SUITE_P` defines were oddly located in the file in the middle of the tests. Move them to the top of the file. - `INSTANTIATE_TARGET_PLATFORM_TEST_SUITE_P` - Remove the `kSkSL` target. These tests seem to be specifically for non-runtime targets, so SkSL doesn't belong here. All of these tests had a filter to skip for SkSL, so none of them actually ran for SkSL. These skips are now removed. - Add the `kVulkan` target, so all non-runtime platform targets are covered: opengles, openglesdesktop, metaldesktop, metalios, vulkan. - `INSTANTIATE_RUNTIME_TARGET_PLATFORM_TEST_SUITE_P` - This used to only test with `kRuntimeStageMetal`. For better coverage, I added all other runtime stages to this. It now tests on the metal, gles, gles3, vulkan, and sksl runtime targets. - Two tests, `UniformsAppearInJson` and `PositionedUniformsAppearInJson` fail when running with vulkan and with sksl. I added skips for these. I haven't dug deeper, but the failures seem unexpected to me. It's possible that this is revealing a bug with the vulkan and sksl compilers. - `INSTANTIATE_UNKNOWN_TARGET_PLATFORM_TEST_SUITE_P` - Added this new define for running tests with `TargetPlatform::kUnknown`. - Added a `MustFailDueToUnknownPlatform` test for this case. - `fixtures/BUILD.gn`, `runtime_stage_unittests.cc` - For the `impellerc("runtime_stages")` build target, add `--sksl` to the impellerc flags. This preserves the existing behavior of these targets being compiled for SkSL. They used to compile for SkSL because other runtime targets are specified. But now impellerc only compiles to SkSL when `--sksl` is explicitly specified. - Create a new `impellerc("runtime_stages_non_sksl")` target that runs impellerc without `--sksl`. Use this for a new `ContainsExpectedShaderTypesNoSksl` test in the unit test file. That test is the same as the existing `ContainsExpectedShaderTypes` test, but using the non-sksl output from `impellerc("runtime_stages_non_sksl")`. ### Update for commit 2 of the PR: The original PR had an issue that failed CI because a build rule expected an impellerc output to include C++ reflection data, but the reflection data was not output. I added a sizable commit to address this: - Fix compiler.gni logic around when to generate reflection state. - This used to incorrectly generate reflection state whenever the last shader_target_flags is not "--sksl". - Instead, generate reflection state when any non-runtime target is in shader_target_flags. - Consolidate some of the if/else logic to reduce duplicate code. - Remove the TargetPlatformNeedsReflection check in impeller_main.cc. - Instead, whether reflection state is generated depends only on the presence or absense of "reflection_{json|header|cc}_name" flags. - The logic of whether to include these flags is already in compiler.gni. So it's redundant to also have logic for whether to generate the reflection state here. - The TargetPlatformNeedsReflection method had faulty logic. - It returned true for everything except SkSL, even though reflection state isn't needed for runtime targets. - It was called on the target from Switches::SelectDefaultTargetPlatform. When impellerc is used with multiple runtime targets, this would return the runtime target that is first alphabetically by flag name. So if --sksl is provided along with any other --runtime-stage-* target, SelectDefaultTargetPlatform returns the non-sksl runtime target. Effectively this meant that TargetPlatformNeedsReflection returns true except for when --sksl is the only provided runtime target. - Removes the TargetPlatformNeedsReflection function entirely. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent f38a3e0 commit 3109939

14 files changed

Lines changed: 239 additions & 296 deletions

engine/src/flutter/impeller/compiler/compiler.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ static CompilerBackend CreateCompiler(const spirv_cross::ParsedIR& ir,
242242
case TargetPlatform::kRuntimeStageVulkan:
243243
compiler = CreateVulkanCompiler(ir, source_options);
244244
break;
245-
case TargetPlatform::kUnknown:
246245
case TargetPlatform::kOpenGLES:
247246
case TargetPlatform::kOpenGLDesktop:
248247
case TargetPlatform::kRuntimeStageGLES:
@@ -251,6 +250,9 @@ static CompilerBackend CreateCompiler(const spirv_cross::ParsedIR& ir,
251250
break;
252251
case TargetPlatform::kSkSL:
253252
compiler = CreateSkSLCompiler(ir, source_options);
253+
break;
254+
case TargetPlatform::kUnknown:
255+
FML_UNREACHABLE();
254256
}
255257
if (!compiler) {
256258
return {};

engine/src/flutter/impeller/compiler/compiler_test.cc

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -142,53 +142,50 @@ bool CompilerTestBase::CanCompileAndReflect(
142142
return false;
143143
}
144144

145-
if (TargetPlatformNeedsReflection(GetParam())) {
146-
auto reflector = compiler.GetReflector();
147-
if (!reflector) {
148-
VALIDATION_LOG
149-
<< "No reflector was found for target platform SL compiler.";
150-
return false;
151-
}
152-
153-
auto reflection_json = reflector->GetReflectionJSON();
154-
auto reflection_header = reflector->GetReflectionHeader();
155-
auto reflection_source = reflector->GetReflectionCC();
156-
157-
if (!reflection_json) {
158-
VALIDATION_LOG << "Reflection JSON was not found.";
159-
return false;
160-
}
161-
162-
if (!reflection_header) {
163-
VALIDATION_LOG << "Reflection header was not found.";
164-
return false;
165-
}
166-
167-
if (!reflection_source) {
168-
VALIDATION_LOG << "Reflection source was not found.";
169-
return false;
170-
}
171-
172-
if (!fml::WriteAtomically(intermediates_directory_,
173-
ReflectionHeaderName(fixture_name).c_str(),
174-
*reflection_header)) {
175-
VALIDATION_LOG << "Could not write reflection header intermediates.";
176-
return false;
177-
}
178-
179-
if (!fml::WriteAtomically(intermediates_directory_,
180-
ReflectionCCName(fixture_name).c_str(),
181-
*reflection_source)) {
182-
VALIDATION_LOG << "Could not write reflection CC intermediates.";
183-
return false;
184-
}
185-
186-
if (!fml::WriteAtomically(intermediates_directory_,
187-
ReflectionJSONName(fixture_name).c_str(),
188-
*reflection_json)) {
189-
VALIDATION_LOG << "Could not write reflection json intermediates.";
190-
return false;
191-
}
145+
auto reflector = compiler.GetReflector();
146+
if (!reflector) {
147+
VALIDATION_LOG << "No reflector was found for target platform SL compiler.";
148+
return false;
149+
}
150+
151+
auto reflection_json = reflector->GetReflectionJSON();
152+
auto reflection_header = reflector->GetReflectionHeader();
153+
auto reflection_source = reflector->GetReflectionCC();
154+
155+
if (!reflection_json) {
156+
VALIDATION_LOG << "Reflection JSON was not found.";
157+
return false;
158+
}
159+
160+
if (!reflection_header) {
161+
VALIDATION_LOG << "Reflection header was not found.";
162+
return false;
163+
}
164+
165+
if (!reflection_source) {
166+
VALIDATION_LOG << "Reflection source was not found.";
167+
return false;
168+
}
169+
170+
if (!fml::WriteAtomically(intermediates_directory_,
171+
ReflectionHeaderName(fixture_name).c_str(),
172+
*reflection_header)) {
173+
VALIDATION_LOG << "Could not write reflection header intermediates.";
174+
return false;
175+
}
176+
177+
if (!fml::WriteAtomically(intermediates_directory_,
178+
ReflectionCCName(fixture_name).c_str(),
179+
*reflection_source)) {
180+
VALIDATION_LOG << "Could not write reflection CC intermediates.";
181+
return false;
182+
}
183+
184+
if (!fml::WriteAtomically(intermediates_directory_,
185+
ReflectionJSONName(fixture_name).c_str(),
186+
*reflection_json)) {
187+
VALIDATION_LOG << "Could not write reflection json intermediates.";
188+
return false;
192189
}
193190
return true;
194191
}

engine/src/flutter/impeller/compiler/compiler_test.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ class CompilerTestBase : public ::testing::TestWithParam<TargetPlatform> {
4545

4646
class CompilerTest : public CompilerTestBase {};
4747

48+
class CompilerTestRuntime : public CompilerTestBase {};
49+
4850
class CompilerTestSkSL : public CompilerTestBase {};
4951

50-
class CompilerTestRuntime : public CompilerTestBase {};
52+
class CompilerTestUnknownPlatform : public CompilerTestBase {};
5153

5254
} // namespace testing
5355
} // namespace compiler

engine/src/flutter/impeller/compiler/compiler_unittests.cc

Lines changed: 61 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,46 @@ namespace impeller {
1515
namespace compiler {
1616
namespace testing {
1717

18+
INSTANTIATE_TEST_SUITE_P(
19+
CompilerSuite,
20+
CompilerTest,
21+
::testing::Values(TargetPlatform::kOpenGLES,
22+
TargetPlatform::kOpenGLDesktop,
23+
TargetPlatform::kMetalDesktop,
24+
TargetPlatform::kMetalIOS,
25+
TargetPlatform::kVulkan),
26+
[](const ::testing::TestParamInfo<CompilerTest::ParamType>& info) {
27+
return TargetPlatformToString(info.param);
28+
});
29+
30+
INSTANTIATE_TEST_SUITE_P(
31+
CompilerSuite,
32+
CompilerTestRuntime,
33+
::testing::Values(TargetPlatform::kRuntimeStageMetal,
34+
TargetPlatform::kRuntimeStageGLES,
35+
TargetPlatform::kRuntimeStageGLES3,
36+
TargetPlatform::kRuntimeStageVulkan,
37+
TargetPlatform::kSkSL),
38+
[](const ::testing::TestParamInfo<CompilerTest::ParamType>& info) {
39+
return TargetPlatformToString(info.param);
40+
});
41+
42+
INSTANTIATE_TEST_SUITE_P(
43+
CompilerSuite,
44+
CompilerTestSkSL,
45+
::testing::Values(TargetPlatform::kSkSL),
46+
[](const ::testing::TestParamInfo<CompilerTest::ParamType>& info) {
47+
return TargetPlatformToString(info.param);
48+
});
49+
50+
INSTANTIATE_TEST_SUITE_P(
51+
CompilerSuite,
52+
CompilerTestUnknownPlatform,
53+
::testing::Values(TargetPlatform::kUnknown),
54+
[](const ::testing::TestParamInfo<CompilerTest::ParamType>& info) {
55+
return TargetPlatformToString(info.param);
56+
});
57+
1858
TEST(CompilerTest, Defines) {
1959
std::shared_ptr<const fml::Mapping> fixture =
2060
flutter::testing::OpenFixtureAsMapping("check_gles_definition.frag");
@@ -48,27 +88,18 @@ TEST(CompilerTest, ShaderKindMatchingIsSuccessful) {
4888
}
4989

5090
TEST_P(CompilerTest, CanCompile) {
51-
if (GetParam() == TargetPlatform::kSkSL) {
52-
GTEST_SKIP() << "Not supported with SkSL";
53-
}
5491
ASSERT_TRUE(CanCompileAndReflect("sample.vert"));
5592
ASSERT_TRUE(CanCompileAndReflect("sample.vert", SourceType::kVertexShader));
5693
ASSERT_TRUE(CanCompileAndReflect("sample.vert", SourceType::kVertexShader,
5794
SourceLanguage::kGLSL));
5895
}
5996

6097
TEST_P(CompilerTest, CanCompileHLSL) {
61-
if (GetParam() == TargetPlatform::kSkSL) {
62-
GTEST_SKIP() << "Not supported with SkSL";
63-
}
6498
ASSERT_TRUE(CanCompileAndReflect(
6599
"simple.vert.hlsl", SourceType::kVertexShader, SourceLanguage::kHLSL));
66100
}
67101

68102
TEST_P(CompilerTest, CanCompileHLSLWithMultipleStages) {
69-
if (GetParam() == TargetPlatform::kSkSL) {
70-
GTEST_SKIP() << "Not supported with SkSL";
71-
}
72103
ASSERT_TRUE(CanCompileAndReflect("multiple_stages.hlsl",
73104
SourceType::kVertexShader,
74105
SourceLanguage::kHLSL, "VertexShader"));
@@ -87,18 +118,12 @@ TEST_P(CompilerTest, CanCompileComputeShader) {
87118
}
88119

89120
TEST_P(CompilerTest, MustFailDueToExceedingResourcesLimit) {
90-
if (GetParam() == TargetPlatform::kSkSL) {
91-
GTEST_SKIP() << "Not supported with SkSL";
92-
}
93121
ScopedValidationDisable disable_validation;
94122
ASSERT_FALSE(
95123
CanCompileAndReflect("resources_limit.vert", SourceType::kVertexShader));
96124
}
97125

98126
TEST_P(CompilerTest, MustFailDueToMultipleLocationPerStructMember) {
99-
if (GetParam() == TargetPlatform::kSkSL) {
100-
GTEST_SKIP() << "Not supported with SkSL";
101-
}
102127
ScopedValidationDisable disable_validation;
103128
ASSERT_FALSE(CanCompileAndReflect("struct_def_bug.vert"));
104129
}
@@ -202,6 +227,12 @@ inline std::ostream& operator<<(std::ostream& out, const UniformInfo& info) {
202227
} // namespace
203228

204229
TEST_P(CompilerTestRuntime, UniformsAppearInJson) {
230+
if (GetParam() == TargetPlatform::kRuntimeStageVulkan) {
231+
// TODO(https://github.com/flutter/flutter/issues/182578): Investigate why
232+
// this does not pass.
233+
GTEST_SKIP() << "Not supported with Vulkan";
234+
}
235+
205236
ASSERT_TRUE(CanCompileAndReflect("sample_with_uniforms.frag",
206237
SourceType::kFragmentShader,
207238
SourceLanguage::kGLSL));
@@ -248,6 +279,12 @@ TEST_P(CompilerTestRuntime, UniformsAppearInJson) {
248279
}
249280

250281
TEST_P(CompilerTestRuntime, PositionedUniformsAppearInJson) {
282+
if (GetParam() == TargetPlatform::kRuntimeStageVulkan) {
283+
// TODO(https://github.com/flutter/flutter/issues/182578): Investigate why
284+
// this does not pass.
285+
GTEST_SKIP() << "Not supported with Vulkan";
286+
}
287+
251288
ASSERT_TRUE(CanCompileAndReflect("sample_with_positioned_uniforms.frag",
252289
SourceType::kFragmentShader,
253290
SourceLanguage::kGLSL));
@@ -377,39 +414,11 @@ TEST_P(CompilerTestSkSL, CompilesWithValidArrayInitialization) {
377414
SourceType::kFragmentShader));
378415
}
379416

380-
#define INSTANTIATE_TARGET_PLATFORM_TEST_SUITE_P(suite_name) \
381-
INSTANTIATE_TEST_SUITE_P( \
382-
suite_name, CompilerTest, \
383-
::testing::Values(TargetPlatform::kOpenGLES, \
384-
TargetPlatform::kOpenGLDesktop, \
385-
TargetPlatform::kMetalDesktop, \
386-
TargetPlatform::kMetalIOS, TargetPlatform::kSkSL), \
387-
[](const ::testing::TestParamInfo<CompilerTest::ParamType>& info) { \
388-
return TargetPlatformToString(info.param); \
389-
});
390-
391-
INSTANTIATE_TARGET_PLATFORM_TEST_SUITE_P(CompilerSuite);
392-
393-
#define INSTANTIATE_RUNTIME_TARGET_PLATFORM_TEST_SUITE_P(suite_name) \
394-
INSTANTIATE_TEST_SUITE_P( \
395-
suite_name, CompilerTestRuntime, \
396-
::testing::Values(TargetPlatform::kRuntimeStageMetal), \
397-
[](const ::testing::TestParamInfo<CompilerTest::ParamType>& info) { \
398-
return TargetPlatformToString(info.param); \
399-
});
400-
401-
INSTANTIATE_RUNTIME_TARGET_PLATFORM_TEST_SUITE_P(CompilerSuite);
402-
403-
#define INSTANTIATE_SKSL_TARGET_PLATFORM_TEST_SUITE_P(suite_name) \
404-
INSTANTIATE_TEST_SUITE_P( \
405-
suite_name, CompilerTestSkSL, ::testing::Values(TargetPlatform::kSkSL), \
406-
[](const ::testing::TestParamInfo<CompilerTest::ParamType>& info) { \
407-
return TargetPlatformToString(info.param); \
408-
});
409-
410-
INSTANTIATE_SKSL_TARGET_PLATFORM_TEST_SUITE_P(CompilerSuite);
411-
412417
TEST_P(CompilerTestRuntime, Mat2Reflection) {
418+
if (GetParam() == TargetPlatform::kSkSL) {
419+
GTEST_SKIP() << "Not supported with SkSL";
420+
}
421+
413422
ASSERT_TRUE(CanCompileAndReflect(
414423
"mat2_test.frag", SourceType::kFragmentShader, SourceLanguage::kGLSL));
415424

@@ -448,6 +457,11 @@ TEST_P(CompilerTestRuntime, Mat2Reflection) {
448457
EXPECT_EQ(mat2Member["offset"], 0u);
449458
}
450459

460+
TEST_P(CompilerTestUnknownPlatform, MustFailDueToUnknownPlatform) {
461+
ASSERT_FALSE(
462+
CanCompileAndReflect("sample.frag", SourceType::kFragmentShader));
463+
}
464+
451465
} // namespace testing
452466
} // namespace compiler
453467
} // namespace impeller

0 commit comments

Comments
 (0)