Un-ifdef vulkan code in impellerc (flutter/engine#40797)
[Impeller] Un-ifdef vulkan code in impellerc
This commit is contained in:
@@ -463,9 +463,10 @@ Compiler::Compiler(const fml::Mapping& source_mapping,
|
||||
}
|
||||
|
||||
spirv_options.SetAutoBindUniforms(true);
|
||||
#ifdef IMPELLER_ENABLE_VULKAN
|
||||
SetBindingBase(spirv_options);
|
||||
#endif
|
||||
if (source_options.target_platform == TargetPlatform::kVulkan ||
|
||||
source_options.target_platform == TargetPlatform::kRuntimeStageVulkan) {
|
||||
SetBindingBase(spirv_options);
|
||||
}
|
||||
spirv_options.SetAutoMapLocations(true);
|
||||
|
||||
std::vector<std::string> included_file_names;
|
||||
|
||||
@@ -78,9 +78,9 @@ TEST_P(CompilerTest, MustFailDueToMultipleLocationPerStructMember) {
|
||||
}
|
||||
|
||||
TEST_P(CompilerTest, BindingBaseForFragShader) {
|
||||
#ifndef IMPELLER_ENABLE_VULKAN
|
||||
GTEST_SKIP();
|
||||
#endif
|
||||
if (!TargetPlatformIsVulkan(GetParam())) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
|
||||
ASSERT_TRUE(CanCompileAndReflect("sample.vert", SourceType::kVertexShader));
|
||||
ASSERT_TRUE(CanCompileAndReflect("sample.frag", SourceType::kFragmentShader));
|
||||
|
||||
@@ -314,6 +314,24 @@ bool TargetPlatformIsMetal(TargetPlatform platform) {
|
||||
FML_UNREACHABLE();
|
||||
}
|
||||
|
||||
bool TargetPlatformIsVulkan(TargetPlatform platform) {
|
||||
switch (platform) {
|
||||
case TargetPlatform::kRuntimeStageVulkan:
|
||||
case TargetPlatform::kVulkan:
|
||||
return true;
|
||||
case TargetPlatform::kMetalDesktop:
|
||||
case TargetPlatform::kMetalIOS:
|
||||
case TargetPlatform::kRuntimeStageMetal:
|
||||
case TargetPlatform::kUnknown:
|
||||
case TargetPlatform::kSkSL:
|
||||
case TargetPlatform::kOpenGLES:
|
||||
case TargetPlatform::kOpenGLDesktop:
|
||||
case TargetPlatform::kRuntimeStageGLES:
|
||||
return false;
|
||||
}
|
||||
FML_UNREACHABLE();
|
||||
}
|
||||
|
||||
bool TargetPlatformBundlesSkSL(TargetPlatform platform) {
|
||||
switch (platform) {
|
||||
case TargetPlatform::kSkSL:
|
||||
|
||||
@@ -48,6 +48,8 @@ bool TargetPlatformIsMetal(TargetPlatform platform);
|
||||
|
||||
bool TargetPlatformIsOpenGL(TargetPlatform platform);
|
||||
|
||||
bool TargetPlatformIsVulkan(TargetPlatform platform);
|
||||
|
||||
SourceType SourceTypeFromFileName(const std::string& file_name);
|
||||
|
||||
std::string SourceTypeToString(SourceType type);
|
||||
|
||||
Reference in New Issue
Block a user