Skip to content

CrossTL 3.7.0

Latest

Choose a tag to compare

@NripeshN NripeshN released this 13 Nov 00:05
· 75 commits to main since this release
e17978d

The full 3.7.0 notes describe each of the release's 117 changes.

Breaking Changes

  • Every target refuses a function body that reads or writes a name it never declares, with UndeclaredIdentifierError, and a call to a function that neither the program nor any language CrossTL reads declares, with UndeclaredFunctionError. Both used to be copied into the output.
  • GLSL, HLSL and Metal output refuse what they have no spelling for instead of writing it unchanged, such as built-in types and functions of other languages and, in GLSL output, members, semantics and functions nothing declares. GLSL, SPIR-V, HLSL and Metal output refuse an HLSL system value they do not know.
  • A storage image format CrossGL does not know is refused with UnsupportedImageFormatError.
  • Metal and Slang output refuse a constant-buffer member that @offset or @align places where their declaration would not, with MemberPlacementError, and HLSL and GLSL output refuse such placements in the structure of a ConstantBuffer<T> that declares no layout. HLSL input refuses a [[vk::push_constant]] struct whose DXC layout CrossGL cannot record.
  • A helper's buffer T name[] parameter takes the form of the buffer its caller passes, and one whose elements have no common stride across std430, HLSL structured buffers and MSL is refused with StorageBufferParameterUnsupportedError. HLSL, GLSL, SPIR-V and Slang output used to write an unsized array parameter that their compilers reject.
  • The CrossGL output of a Metal, GLSL, HLSL or SPIR-V import starts with #pragma cgl_rules(...), which names the semantic rules of the source language, so the saved CrossGL translates the same as the source.

Added

  • HLSL input translates function and struct templates, including template value parameters, to CrossGL generics, and resolves namespaces by C++ lookup rules.
  • CrossGL generic functions take value parameters, as in generic<T, N> called as scale<float, 3>(x), and generic structures such as Box<float> translate to SPIR-V as well as the other targets.
  • Storage images take the packed formats rgb10_a2, rgb10_a2ui and r11f_g11f_b10f.
  • Metal input keeps a declaration-only function template that explicit specializations complete.

Improved

  • The Metal importer reads more template-heavy MSL, including member templates selected by a library tag, default template arguments of deduced calls and body-local aliases of dependent types.
  • More MLX kernels translate to DirectX and OpenGL. OpenGL output proves index bounds from the comparisons that guard a read, and DirectX and OpenGL output write through 32-bit storage word views.
  • Translating large programs to HLSL is faster, with unchanged output.

Fixed

  • 97 fixes, mainly to Metal, Slang, HLSL, SPIR-V and GLSL output and to Metal and HLSL input. Many concern the layout of constant buffers, push-constant blocks and storage buffers, arrays and inout arguments passed to functions, matrix order, memory qualifiers, and tessellation and workgroup sizes.