Annotation Interface NativeStruct


@Target(TYPE) @Retention(RUNTIME) public @interface NativeStruct
Marks a record for compile-time metadata and struct layout generation.

The annotation processor generates a <RecordName>_NativeStruct class that registers:

  • Record component metadata in RecordRegistry (replaces Class.getRecordComponents() for TeaVM compatibility)
  • PACKED and STD140 struct layouts in StructLayout

This enables the full engine pipeline (StructLayout, SlangParamsBlock) to work on platforms without reflection support. Implicitly Discoverable — the generated companion class survives TeaVM DCE.