Commit d29d4c6b by Tim Van Patten Committed by Commit Bot

Vulkan: Avoid linking to SPIR-V validation if possible

We unconditionally link to $angle_spirv_tools_dir:spvtools_val, but we only use SPIR-V validation with ASSERTs. This CL removes this dependency when ASSERTs are disabled. Bug: angleproject:4887 Test: CQ Change-Id: Ic403b78196ecd895e4a0cdefb54ab4497651ccac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2375872 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
parent 65dcbe12
......@@ -902,6 +902,7 @@ constexpr gl::ShaderMap<EShLanguage> kShLanguageMap = {
{gl::ShaderType::Compute, EShLangCompute},
};
#if defined(ANGLE_ENABLE_ASSERTS)
void ValidateSpirvMessage(spv_message_level_t level,
const char *source,
const spv_position_t &position,
......@@ -926,6 +927,14 @@ bool ValidateSpirv(const std::vector<uint32_t> &spirvBlob)
return result;
}
#else // ANGLE_ENABLE_ASSERTS
bool ValidateSpirv(const std::vector<uint32_t> &spirvBlob)
{
// Placeholder implementation since this is only used inside an ASSERT().
// Return false to indicate an error in case this is ever accidentally used somewhere else.
return false;
}
#endif // ANGLE_ENABLE_ASSERTS
// A SPIR-V transformer. It walks the instructions and modifies them as necessary, for example to
// assign bindings or locations.
......
......@@ -4,6 +4,7 @@
#
# This file houses the build configuration for the ANGLE Vulkan back-end.
import("//build/config/dcheck_always_on.gni")
import("//build_overrides/swiftshader.gni")
import("../../../../gni/angle.gni")
......@@ -198,8 +199,12 @@ angle_source_set("angle_vulkan_backend") {
"$angle_root:angle_compression",
"$angle_root:angle_gpu_info_util",
"$angle_root:angle_image_util",
"$angle_spirv_tools_dir:spvtools_val",
]
if (dcheck_always_on || is_debug) {
deps += [ "$angle_spirv_tools_dir:spvtools_val" ]
}
public_deps = [
"$angle_root:angle_glslang_wrapper",
"$angle_root:libANGLE_headers",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment