From af1046aca464a5cf4c0c4f8e5dde1852a528c837 Mon Sep 17 00:00:00 2001 From: Ali Cheraghi Date: Sat, 27 Jun 2026 11:54:00 +0330 Subject: [PATCH] Type: allow vectors in externs for SPIR-V target Vectors are well-defined in SPIR-V unlike other targets, and they are essential for almost any shader interface because arrays are incompatible with e.g. Vulkan data formats (`gl_Position`, vertex attributes, color outputs, etc.) --- src/Type.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Type.zig b/src/Type.zig index 546953b307df5bcb37e99942655801f6b5910676..7c45eda413906fc41865d3392eba198e73e1cdcf 100644 --- a/src/Type.zig +++ b/src/Type.zig @@ -3087,7 +3087,10 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool .frame, => false, - .vector => position == .param_ty or position == .ret_ty, + .vector => { + if (zcu.getTarget().cpu.arch.isSpirV()) return true; + return position == .param_ty or position == .ret_ty; + }, .void => switch (position) { .ret_ty, -- 2.54.0