Skip to content

Commit 0921e36

Browse files
damyanpCopilotgithub-actions[bot]
authored
Fix building when SPIRV is disabled (#8408)
Fixes build break introduced by ec9d97a (#8365), which referenced hlsl::GetVKBufferPointerAlignment and m_vkBufferPointerTemplateDecl unconditionally. --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 8dfd263 commit 0921e36

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7443,6 +7443,7 @@ bool HLSLExternalSource::MatchArguments(
74437443
if (i == 0 &&
74447444
(builtinOp == hlsl::IntrinsicOp::IOP_Vkreinterpret_pointer_cast ||
74457445
builtinOp == hlsl::IntrinsicOp::IOP_Vkstatic_pointer_cast)) {
7446+
#ifdef ENABLE_SPIRV_CODEGEN
74467447
if (functionTemplateTypeArg.isNull()) {
74477448
badArgIdx = std::min(badArgIdx, i);
74487449
continue;
@@ -7482,6 +7483,11 @@ bool HLSLExternalSource::MatchArguments(
74827483
pNewType = m_context->getTemplateSpecializationType(
74837484
TemplateName(m_vkBufferPointerTemplateDecl), TemplateArgs, 2,
74847485
m_context->getTypeDeclType(Spec));
7486+
#else
7487+
// The IOP_Vk* opcodes are only reachable when ENABLE_SPIRV_CODEGEN is
7488+
// defined.
7489+
llvm_unreachable("vk:: pointer cast intrinsics require SPIR-V codegen");
7490+
#endif // ENABLE_SPIRV_CODEGEN
74857491
} else {
74867492
badArgIdx = std::min(badArgIdx, i);
74877493
}

0 commit comments

Comments
 (0)