| author | |
| committer | |
| log | af1046aca464a5cf4c0c4f8e5dde1852a528c837 |
| tree | c7361012558f65ae326a33d6e3ab03216b5309e0 |
| parent | e0e145048d4b7b80bdbf15c78b33dea06edadc0a |
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 | ... | @@ -3087,7 +3087,10 @@ pub fn validateExtern(ty: Type, position: ExternPosition, zcu: *const Zcu) bool |
| 3087 | .frame, | 3087 | .frame, |
| 3088 | => false, | 3088 | => false, |
| 3089 | 3089 | ||
| 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 | }, | ||
| 3091 | 3094 | ||
| 3092 | .void => switch (position) { | 3095 | .void => switch (position) { |
| 3093 | .ret_ty, | 3096 | .ret_ty, |