authorgravatar for alichraghi@proton.meAli Chraghi <alichraghi@proton.me> 2026-06-27 11:54:00+03:30
committergravatar for alichraghi@noreply.codeberg.orgAli Cheraghi <alichraghi@noreply.codeberg.org> 2026-06-28 18:25:43+02:00
logaf1046aca464a5cf4c0c4f8e5dde1852a528c837
treec7361012558f65ae326a33d6e3ab03216b5309e0
parente0e145048d4b7b80bdbf15c78b33dea06edadc0a

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.)

1 files changed, 4 insertions(+), 1 deletions(-)

src/Type.zig+4-1
......@@ -3087,7 +3087,10 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool
30873087 .frame,
30883088 => false,
30893089
3090 .vector => position == .param_ty or position == .ret_ty,
3090 .vector => {
3091 if (zcu.getTarget().cpu.arch.isSpirV()) return true;
3092 return position == .param_ty or position == .ret_ty;
3093 },
30913094
30923095 .void => switch (position) {
30933096 .ret_ty,