1 # -*- Mode:text; tab-width:4; electric-indent-mode: nil; indent-line-function:insert-tab; -*-
3 # types for structs and unions
5 # ###################################################################### #
7 #accessor=code template
16 # ###################################################################### #
21 public {type} get{Name}() {
27 public void set{Name}({type} {name}) {
32 public {type} get{Name}AtIndex(long i$) {
37 public void set{Name}AtIndex(long i$, {type} {name}) {
42 # Initialise the sType field if it has one, also include sub-
44 if ($tempname =~ m/write/) {
45 my $init = "{name}\$VH.set(self\$.segment, Vulkan.{values});\n";
46 foreach my $x (@{$s->{items}}) {
47 if ($x->{deref} eq 'struct') {
48 my $y = $api->{types}->{$x->{baseType}};
49 if ($#{$y->{items}} >= 0 && $y->{items}->[0]->{values}) {
50 my $z = $y->{items}->[0];
51 $init .= "self\$.get$x->{Name}().set$z->{Name}(Vulkan.$z->{values});\n";
62 if ($tempname =~ m/write.*array/n) {
63 my $init = "{name}\$AH.set(self\$.segment, i, Vulkan.{values});\n";
64 foreach my $x (@{$s->{items}}) {
65 if ($x->{deref} eq 'struct') {
66 my $y = $api->{types}->{$x->{baseType}};
67 if ($#{$y->{items}} >= 0 && $y->{items}->[0]->{values}) {
68 my $z = $y->{items}->[0];
69 $init .= "self\$.get$x->{Name}AtIndex(i).set$z->{Name}(Vulkan.$z->{values});\n";
74 "for (long i=0; i<length; i++) {\n\t$init\n\t}\n";
80 # for complex constructors
81 #setall-arg {{ {type} {name} }}
82 setall-arg {{ {type} {name} }}
83 setall {{ self$.set{Name}({name}); }}
84 setallat {{ self$.set{Name}AtIndex(index$, {name}); }}
87 # ###################################################################### #
91 /* value-array {deref} */
92 public {type} get{Name}() {
95 } catch (Throwable t) {
96 throw new RuntimeException(t);
99 public {typei} get{Name}Element(int i$) {
102 public void set{Name}Element(int i$, {typei} {name}) {
108 if ($m->{len1} <= 4) {
109 join ", ", map { '{typei} {name}$'.$_ } (0 .. $m->{len1}-1);
111 "{typei}[] {name} /* $m->{deref} $m->{len1} */";
115 if ($m->{len1} <= 4) {
116 join "\n\t", map { "self\$.set{Name}Element($_, {name}\$$_);" } (0 .. $m->{len1}-1);
119 if ({name} != null) {
121 ((MemorySegment){name}\$SH.invokeExact(self\$.segment)).copyFrom(MemorySegment.ofArray({name}));
122 } catch (Throwable t) {
123 System.err.println("Copy error: " + t.getLocalizedMessage());
131 # ###################################################################### #
132 # don't like having to pass scope here, not sure what else to do though
135 /* value-array {deref} */
136 public {type} get{Name}(VkInstance instance$, ResourceScope scope$) {
139 } catch (Throwable t) {
140 throw new RuntimeException(t);
143 public {typei} get{Name}Element(int i$, VkInstance instance$, ResourceScope scope$) {
146 public void set{Name}Element(int i$, {typei} {name}) {
152 # ###################################################################### #
156 /* value-array2d {deref} */
157 public {type} get{Name}() {
160 } catch (Throwable t) {
161 throw new RuntimeException(t);
164 public {typei} get{Name}Element(int i$, int j$) {
167 public void set{Name}Element(int i$, int j$, {typei} {name}) {
173 # ###################################################################### #
178 public {type} get{Name}() {
181 } catch (Throwable t) {
182 throw new RuntimeException(t);
188 public {type} get{Name}AtIndex(long i$) {
191 } catch (Throwable t) {
192 throw new RuntimeException(t);
198 # ###################################################################### #
199 # inline type that we also want to include expanded in initialiser
200 # We also create expanded setters and a getter for each simple embedded field.
204 # These are basic object based accessors
208 public {type} get{Name}() {
211 } catch (Throwable t) {
212 throw new RuntimeException(t);
219 public {type} get{Name}AtIndex(long i$) {
222 } catch (Throwable t) {
223 throw new RuntimeException(t);
228 # subroutine to the all-args info, only eval if len1 == 0
229 # this will also include it's own inline struct's fields
234 foreach my $a (@{$api->{data}->{$m->{baseType}}->{items}}) {
235 my $name = "$m->{name}\$$a->{name}";
236 my $offset = ($m->{bitOffset} + $a->{bitOffset}) / 8;
237 my $atype = $primitiveMap{$a->{baseType}};
246 my $as = $api->{data}->{$a->{baseType}};
247 foreach my $b (@{$as->{items}}) {
248 my $btype = $primitiveMap{$b->{baseType}};
251 name => "$name\$$b->{name}",
253 offset => $offset + $b->{bitOffset} / 8
262 # setBlah(all-simple-blah-fields)
264 return 0 if $m->{len1};
265 my $setall_arg = eval($type->{accessor}->{'setall-arg'});
266 my $setall = eval($type->{accessor}->{setall});
268 public void set{Name}($setall_arg) {
275 # getBlah$field0(), getBlah$field1() etc.
279 return 0 if $m->{len1};
281 my $list = eval($type->{accessor}->{'analyse-args'}); die "$@" if !defined $list;
284 my $tname = uc($_->{type});
285 my $fname = ucfirst($_->{name});
287 public $_->{type} get$fname() {
288 return this.segment.get(Memory.$tname, $_->{offset});
294 # setBlahAtIndex(index, all-simple-blah-fields)
296 return 0 if $m->{len1};
297 my $setall_arg = eval($type->{accessor}->{'setall-arg'});
298 my $setallat = eval($type->{accessor}->{setallat});
300 public void set{Name}AtIndex(long index\$, $setall_arg) {
307 # create arg-list for setall template
309 return 0 if $m->{len1};
311 my $list = eval($type->{accessor}->{'analyse-args'}); die "$@" if !defined $list;
313 join(', ', map { "$_->{type} $_->{name}" } @$list);
317 return 0 if $m->{len1};
319 my $list = eval($type->{accessor}->{'analyse-args'}); die "$@" if !defined $list;
321 join("\n\t", map { 'self$.segment.set(Memory.'.uc($_->{type}).", $_->{offset}, $_->{name});" } @$list);
327 return 0 if $m->{len1};
329 my $list = eval($type->{accessor}->{'analyse-args'}); die "$@" if !defined $list;
330 my $stride = $s->{bitSize} / 8;
332 join("\n\t", map { 'self$.segment.set(Memory.'.uc($_->{type}).", index\$ * $stride + $_->{offset}, $_->{name});" } @$list);
336 # ###################################################################### #
338 # value with a SegmentAllocator passed to set()
339 code value-alloc value {
342 public void set{Name}({type} {name}, SegmentAllocator alloc$) {
348 public void set{Name}AtIndex(long i$, {type} {name}, SegmentAllocator alloc$) {
353 setall {{ self$.set{Name}({name}, alloc$); }}
356 # ###################################################################### #
361 public class Vulkan {
363 public static int VK_MAKE_API_VERSION(int variant, int major, int minor, int patch) {
364 return (variant << 29) | (major << 22) | (minor << 12) | patch;
372 VK_API_VERSION_1_0 {{ public final static int VK_API_VERSION_1_0 = VK_MAKE_API_VERSION(0, 1, 0, 0); }}
373 VK_API_VERSION_1_1 {{ public final static int VK_API_VERSION_1_1 = VK_MAKE_API_VERSION(0, 1, 1, 0); }}
374 VK_API_VERSION_1_2 {{ public final static int VK_API_VERSION_1_2 = VK_MAKE_API_VERSION(0, 1, 2, 0); }}
375 VK_API_VERSION_1_3 {{ public final static int VK_API_VERSION_1_3 = VK_MAKE_API_VERSION(0, 1, 3, 0); }}
380 // template: dispatch:class
382 import jdk.incubator.foreign.*;
383 import java.lang.invoke.*;
384 import au.notzed.nativez.*;
389 {Name}(VkInstance instance$, ResourceScope scope$) {
394 field-init {{ final NativeSymbol {name}$NS; }}
395 init {{ {name}$NS = instance$.vkGetInstanceProcAddr("{name}", scope$); }}
399 # non-dispatchable handle
402 // template: handle:class
404 import jdk.incubator.foreign.*;
405 import java.lang.invoke.*;
406 import au.notzed.nativez.*;
408 public class {name} implements Pointer {
409 final NativeSymbol self;
411 private {name}(MemoryAddress address, ResourceScope scope) {
412 this.self = NativeSymbol.ofAddress("{name}", address, scope);
416 public static {name} create(MemoryAddress address, ResourceScope scope) {
417 return new {name}(address, scope);
420 public static HandleArray<{name}> createArray(long length, SegmentAllocator alloc) {
421 return HandleArray.createArray(length, alloc, {name}::create);
424 public MemoryAddress address() {
425 return self.address();
428 public ResourceScope scope() {
436 code handle-instance {
438 // template: handle-instance:class
440 import jdk.incubator.foreign.*;
441 import java.lang.invoke.*;
442 import au.notzed.nativez.*;
444 public class {name} implements Pointer {
445 final NativeSymbol self;
446 final DispatchInstance dispatch;
448 private {name}(MemoryAddress address, ResourceScope scope) {
449 this.self = NativeSymbol.ofAddress("{name}", address, scope);
450 this.dispatch = new DispatchInstance(this, scope);
454 public static {name} create(MemoryAddress address, ResourceScope scope) {
455 return new {name}(address, scope);
458 public MemoryAddress address() {
459 return self.address();
462 public ResourceScope scope() {
471 # dispatchable handle
472 code handle-dispatch {
474 // template: handle-dispatch:class
476 import jdk.incubator.foreign.*;
477 import java.lang.invoke.*;
478 import au.notzed.nativez.*;
480 public class {name} implements Pointer {
481 final NativeSymbol self;
482 final DispatchInstance dispatch;
484 private {name}(MemoryAddress address, DispatchInstance dispatch, ResourceScope scope) {
485 this.self = NativeSymbol.ofAddress("{name}", address, scope);
486 this.dispatch = dispatch;
490 public static {name} create(MemoryAddress address, DispatchInstance dispatch, ResourceScope scope) {
491 return new {name}(address, dispatch, scope);
494 // TODO: evaluate how scope fits here
495 public static HandleArray<{name}> createArray(long length, SegmentAllocator alloc, DispatchInstance dispatch, ResourceScope scope) {
496 return HandleArray.createArray(length, alloc, (a, s) -> create(a, dispatch, s), scope);
499 public static HandleArray<{name}> createArray(long length, SegmentAllocator alloc, VkInstance instance, ResourceScope scope) {
500 return HandleArray.createArray(length, alloc, (a, s) -> create(a, instance.dispatch, s), scope);
503 public MemoryAddress address() {
504 return self.address();
507 public ResourceScope scope() {
516 # ###################################################################### #
518 # shared struct components
521 public MemorySegment segment;
523 public static final GroupLayout LAYOUT = {layout};
525 private {Name}(MemorySegment segment) {
526 this.segment = segment;
529 public static {Name} create(MemorySegment segment) {
530 return new {Name}(segment);
533 public static {Name} create(MemoryAddress address, ResourceScope scope) {
534 return create(MemorySegment.ofAddress(address, LAYOUT.byteSize(), scope));
537 public static {Name} create(SegmentAllocator alloc) {
538 var self$ = create(alloc.allocate(LAYOUT));
545 public MemoryAddress address() {
546 return segment.address();
551 public ResourceScope scope() {
552 return segment.scope();
556 public String toString() {
557 return Memory.toString(segment, LAYOUT);
561 public static {Name} {create}({java-setall-arguments}, SegmentAllocator alloc$) {
562 {Name} self$ = create(alloc$);
570 public void {set}({java-setall-arguments}) {
577 public void {set}AtIndex(long index$, {java-setall-arguments}) {
584 static {Name} createArray(MemoryAddress addr, long length, ResourceScope scope) {
585 return create(MemorySegment.ofAddress(addr, length * LAYOUT.byteSize(), scope));
588 public static {Name} createArray(long length, SegmentAllocator alloc) {
589 var self$ = create(alloc.allocateArray(LAYOUT, length));
594 public final static MethodHandle LAYOUT$SH = MemoryLayout.sequenceLayout(LAYOUT).sliceHandle(MemoryLayout.PathElement.sequenceElement());
598 public long length() {
599 return segment.byteSize() / LAYOUT.byteSize();
604 public {Name} getAtIndex(long index$) {
606 return create((MemorySegment)LAYOUT$SH.invokeExact(this.segment, index$));
607 } catch (Throwable t) {
608 throw new RuntimeException(t);
614 # default - writeonly struct
615 code struct-writeonly insert=struct:header,struct:create-all
616 fields=init,set,getorset,handle,java-setall {
618 // template: struct-writeonly:class
620 import jdk.incubator.foreign.*;
621 import java.lang.invoke.*;
622 import au.notzed.nativez.*;
624 public class {Name} implements Pointer {
637 code struct-writeonly-array insert=struct:header,struct:create-all,struct:array
638 fields=init,init-array,set,getorset,setat,getorsetat,handle,handleat,java-setall {
640 // template: struct-writeonly-array:class
642 import jdk.incubator.foreign.*;
643 import java.lang.invoke.*;
644 import au.notzed.nativez.*;
646 public class {Name} implements Pointer, Array<{Name}> {
664 code struct-readonly insert=struct:header
665 fields=init,get,getorset,handle {
667 // template: struct-readonly:class
669 import jdk.incubator.foreign.*;
670 import java.lang.invoke.*;
671 import au.notzed.nativez.*;
673 public class {Name} implements Pointer {
684 code struct-readonly-array insert=struct:header,struct:array
685 fields=init,init-array,get,getorset,getat,getorsetat,handle,handleat {
687 // template: struct-readonly-array:class
689 import jdk.incubator.foreign.*;
690 import java.lang.invoke.*;
691 import au.notzed.nativez.*;
693 public class {Name} implements Pointer, Array<{Name}> {
709 code struct-readwrite insert=struct:header,struct:create-all
710 fields=init,get,set,getorset,handle,java-setall {
712 // template: struct-readwrite:class
714 import jdk.incubator.foreign.*;
715 import java.lang.invoke.*;
716 import au.notzed.nativez.*;
718 public class {Name} implements Pointer {
732 code struct-readwrite-array insert=struct:header,struct:create-all,struct:array
733 fields=init,init-array,get,getat,set,setat,getorset,getorsetat,handle,handleat,java-setall {
735 // template: struct-readwrite-array:class
737 import jdk.incubator.foreign.*;
738 import java.lang.invoke.*;
739 import au.notzed.nativez.*;
741 public class {Name} implements Pointer,Array<{Name}> {
761 # read-write with a 'set' method for all members
762 code struct-readwrite-all insert=struct:header,struct:create-all,struct:set-all
763 fields=init,get,set,getorset,handle,java-setall {
765 // template: struct-readwrite-all:class
767 import jdk.incubator.foreign.*;
768 import java.lang.invoke.*;
769 import au.notzed.nativez.*;
771 public class {Name} implements Pointer {
785 code struct-readwrite-array-all insert=struct:header,struct:create-all,struct:array,struct:set-all,struct:setat-all
786 fields=init,init-array,get,getat,set,setat,setallat,getorset,getorsetat,handle,handleat,java-setall,java-setallat {
788 // template: struct-readwrite-array-all:class
790 import jdk.incubator.foreign.*;
791 import java.lang.invoke.*;
792 import au.notzed.nativez.*;
794 public class {Name} implements Pointer,Array<{Name}> {
814 # ###################################################################### #
816 # Basic value-based accessor
817 type value accessor=value {
818 native-value {{ {name} }}
820 native-get {{ ({type}){name}$VH.get(this.segment) }}
821 handle {{ final static VarHandle {name}$VH = LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("{name}")); }}
823 java-get {{ {native-get} }}
824 java-set {{ {name}$VH.set(this.segment, {native-value}) }}
826 native-getat {{ ({type}){name}$AH.get(this.segment, i$) }}
827 native-setat {{ {name}$AH.set(this.segment, i$, {native-value}) }}
828 handleat {{ final static VarHandle {name}$AH = MemoryLayout.sequenceLayout(LAYOUT).varHandle(MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.groupElement("{name}")); }}
830 java-getat {{ {native-getat} }}
831 java-setat {{ {native-setat} }}
834 type value-array accessor=value-array {
835 native-get {{ (MemorySegment){name}$SH.invokeExact(this.segment) }}
836 java-get {{ {type}.create({native-get}) }}
838 native-geti {{ {name}$EH.get(this.segment, i$) }}
840 java-geti {{ ({typei}){native-geti} }}
841 java-seti {{ {name}$EH.set(this.segment, i$, {name}) }}
843 final static MethodHandle {name}$SH = LAYOUT.sliceHandle(MemoryLayout.PathElement.groupElement("{name}"));
844 final static VarHandle {name}$EH = LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("{name}"), MemoryLayout.PathElement.sequenceElement());
848 type value-array2d accessor=value-array2d {
849 native-get {{ (MemorySegment){name}$SH.invokeExact(this.segment) }}
850 java-get {{ {type}.create({native-get}) }}
851 java-geti {{ ({typei}){name}$EH.get(this.segment, i$, j$) }}
852 java-seti {{ {name}$EH.set(this.segment, i$, j$, {name}) }}
854 final static MethodHandle {name}$SH = LAYOUT.sliceHandle(MemoryLayout.PathElement.groupElement("{name}"));
855 final static VarHandle {name}$EH = LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("{name}"), MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.sequenceElement());
859 type inline accessor=inline {
860 native-get {{ (MemorySegment){name}$SH.invokeExact(this.segment) }}
861 java-get {{ {type}.create({native-get}) }}
862 handle {{ final static MethodHandle {name}$SH = LAYOUT.sliceHandle(MemoryLayout.PathElement.groupElement("{name}")); }}
864 native-getat {{ (MemorySegment){name}$SA.invokeExact(this.segment, i$) }}
865 java-getat {{ {type}.create({native-getat}) }}
866 handleat {{ final static MethodHandle {name}$SA = MemoryLayout.sequenceLayout(LAYOUT).sliceHandle(MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.groupElement("{name}")); }}
869 type inline-array accessor=inline {
870 native-get {{ (MemorySegment){name}$SH.invokeExact(this.segment) }}
871 java-get {{ {type}.create({native-get}) }}
872 handle {{ final static MethodHandle {name}$SH = LAYOUT.sliceHandle(MemoryLayout.PathElement.groupElement("{name}")); }}
874 native-getat {{ (MemorySegment){name}$SA.invokeExact(this.segment, i$) }}
875 java-getat {{ {type}.create({native-getat}) }}
876 handleat {{ final static MethodHandle {name}$SA = MemoryLayout.sequenceLayout(LAYOUT).sliceHandle(MemoryLayout.PathElement.sequenceElement(), MemoryLayout.PathElement.groupElement("{name}")); }}
879 type uint8_t,char value {
881 layout {{ Memory.BYTE }}
884 type uint16_t value {
886 layout {{ Memory.SHORT }}
889 type uint32_t,int,int32_t value {
891 layout {{ Memory.INT }}
894 type uint64_t,int64_t,size_t value {
896 layout {{ Memory.LONG }}
901 layout {{ Memory.FLOAT }}
906 layout {{ Memory.DOUBLE }}
909 # ###################################################################### #
911 type uint8_t[],char[] value-array {
913 layout {{ MemoryLayout.sequenceLayout({len1}, Memory.BYTE) }}
917 type uint32_t[],int32_t[] value-array {
919 layout {{ MemoryLayout.sequenceLayout({len1}, Memory.INT) }}
923 type uint64_t[] value-array {
925 layout {{ MemoryLayout.sequenceLayout({len1}, Memory.LONG) }}
929 type float[] value-array {
930 type {{ FloatArray }}
931 layout {{ MemoryLayout.sequenceLayout({len1}, Memory.FLOAT) }}
935 type struct[] inline-array {
936 type {{ {baseType} }}
937 layout {{ MemoryLayout.sequenceLayout({len1}, {baseType}.LAYOUT) }}
940 type struct-expand[] struct[] accessor=inline-expand;
942 type float[][] value-array2d {
943 type {{ FloatArray }}
945 layout {{ MemoryLayout.sequenceLayout({len1}, MemoryLayout.sequenceLayout({len2}, Memory.FLOAT)) }}
948 # select=len? or what?
951 layout {{ Memory.POINTER }}
952 type {{ MemoryAddress }}
954 native-value {{ Memory.address({name}) }}
955 native-get {{ (MemoryAddress){name}$VH.get(this.segment) }}
957 # java-get {{ {native-get} }}
958 # java-set {{ {name}$VH.set(this.segment, Memory.address({name})) }}
963 type value-pointer pointer {
964 java-get {{ {type}.create((MemoryAddress){name}$VH.get(this.segment), segment.scope()) }}
967 type uint8_t* value-pointer {
971 type uint32_t*,int32_t*,int* value-pointer {
975 type uint64_t* value-pointer {
979 type float* value-pointer {
983 type size_t* value-pointer {
987 type pointer-length pointer {
988 java-get {{ {type}.createArray({native-get}, {length}, this.segment.scope()) }}
991 type void*-length pointer-length {
993 java-get {{ MemorySegment.ofAddress({native-get}, {length}, this.segment.scope()) }}
996 type uint8_t*-length pointer-length {
1000 type uint32_t*-length,int32_t*-length pointer-length {
1004 type uint64_t*-length pointer-length {
1008 type float*-length pointer-length {
1012 # special handling for strings, will fail if it isn't
1013 type char* pointer accessor=value-alloc {
1016 java-get {{ ({native-get}).getUtf8String(0) }}
1017 native-value {{ alloc$.allocateUtf8String({name}).address() }}
1019 # this just verifies it's a string type
1021 if ($v->{len} =~ m/null-terminated/) {
1030 type char**-length pointer-length accessor=value-alloc {
1033 java-set {{ {name}$VH.set(this.segment, Memory.copyStringArray({name}, alloc$).address()); }}
1034 java-get {{ Memory.copyStringArray((MemoryAddress){name}$VH.get(this.segment), {length}) }}
1037 type funcpointer pointer {
1038 type {{ FunctionPointer<{baseType}> }}
1039 typei {{ {baseType} }}
1040 java-get {{ {baseType}.downcall({native-get}, this.segment.scope()) }}
1043 type void** pointer {
1046 type void**-length pointer-length {
1050 type handle pointer {
1051 type {{ {baseType} }}
1052 java-get {{ {type}.create({native-get}, this.segment.scope()) }}
1055 type handle[] value-array accessor=handle-array {
1056 type {{ HandleArray<{typei}> }}
1057 typei {{ {baseType} }}
1058 layout {{ MemoryLayout.sequenceLayout({len1}, Memory.POINTER) }}
1059 java-get {{ HandleArray.create({native-get}, (a, s) -> {typei}.create(a, instance$.dispatch, s), scope$) }}
1061 java-geti {{ {typei}.create((MemoryAddress){native-geti}, instance$.dispatch, scope$) }}
1064 type handle* pointer {
1065 type {{ HandleArray<{typei}> }}
1066 typei {{ {baseType} }}
1067 java-get {{ HandleArray.create({native-get}, {typei}::create) }}
1070 type handle*-length pointer-length {
1071 type {{ HandleArray<{baseType}> }}
1072 typei {{ {baseType} }}
1073 java-get {{ HandleArray.createArray({native-get}, {length}, {typei}::create, this.segment.scope()) }}
1074 java-set {{ {name}$VH.set(this.segment, Memory.address({name})); }}
1077 type struct inline {
1078 type {{ {baseType} }}
1079 layout {{ {baseType}.LAYOUT }}
1082 type struct-expand inline accessor=inline-expand {
1083 type {{ {baseType} }}
1084 layout {{ {baseType}.LAYOUT }}
1087 type struct* pointer {
1088 type {{ {baseType} }}
1089 java-get {{ {baseType}.create({native-get}, this.segment.scope()) }}
1092 type struct*-length pointer-length {
1093 type {{ {baseType} }}
1094 typei {{ {baseType} }}
1097 type struct** pointer {
1101 type XID,Window,VisualID uint64_t;
1103 type Display* handle {
1108 type xcb_window_t uint32_t;
1109 type xcb_visualid_t uint32_t;
1110 type xcb_connection_t* handle {
1111 type xcb.Connection;
1115 VkInstance template=handle-instance;
1116 VkPhysicalDevice template=handle-dispatch;
1117 VkDevice template=handle-dispatch;
1118 VkCommandBuffer template=handle-dispatch;
1119 VkQueue template=handle-dispatch;
1121 VkAllocationCallbacks ignore;
1123 # We want 'set(all fields) for these types and to include them expanded if inline
1124 VkOffset2D expand template=struct-readwrite-array-all;
1125 VkOffset3D expand template=struct-readwrite-array-all;
1126 VkExtent2D expand template=struct-readwrite-all;
1127 VkExtent3D expand template=struct-readwrite-all;
1128 VkRect2D expand template=struct-readwrite-array-all;
1130 VkStencilOpState template=struct-readwrite-all;
1131 VkComponentMapping template=struct-readwrite-all;
1132 VkImageSubresourceRange template=struct-readwrite-all;
1134 VkClearColorValue expand template=struct-readwrite-all;
1135 VkClearDepthStencilValue expand template=struct-readwrite-all;
1137 # Override default read/write
1138 VkDebugUtilsMessengerCallbackDataEXT template=struct-readonly;
1139 VkDebugUtilsLabelEXT template=struct-readonly-array;
1140 VkDebugUtilsObjectNameInfoEXT template=struct-readonly-array;
1142 # can't really work out what this is it's a void ** but it stays it's a pointer to uint8_t * in the spec
1143 VkCuLaunchInfoNVX pParams=type:pointer pExtras=type:pointer;