typegpu 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{attributes-DsIdcdq4.d.ts → attributes-B90UjSYb.d.ts} +1 -1
- package/{attributes-BcDZsQCE.d.cts → attributes-zljQ-iA7.d.cts} +1 -1
- package/chunk-KJHEEZQT.js +4 -0
- package/chunk-KJHEEZQT.js.map +1 -0
- package/chunk-LB4TSIPN.cjs +2 -0
- package/chunk-LB4TSIPN.cjs.map +1 -0
- package/chunk-VTUUXD6H.cjs +4 -0
- package/{chunk-VUYQ2ZIK.cjs.map → chunk-VTUUXD6H.cjs.map} +1 -1
- package/chunk-YVK55BVR.js +2 -0
- package/chunk-YVK55BVR.js.map +1 -0
- package/data/index.cjs +1 -1
- package/data/index.cjs.map +1 -1
- package/data/index.d.cts +3 -3
- package/data/index.d.ts +3 -3
- package/data/index.js +1 -1
- package/{dataTypes-ts2Ccted.d.ts → dataTypes-6k4EJeol.d.cts} +65 -42
- package/{dataTypes-ts2Ccted.d.cts → dataTypes-6k4EJeol.d.ts} +65 -42
- package/index.cjs +17 -17
- package/index.cjs.map +1 -1
- package/index.d.cts +14 -14
- package/index.d.ts +14 -14
- package/index.js +17 -17
- package/index.js.map +1 -1
- package/package.json +3 -2
- package/{sampler-CPNwYXSH.d.ts → sampler-ByLNpSxj.d.ts} +1 -1
- package/{sampler-DeX4AnIZ.d.cts → sampler-NRTAYTIW.d.cts} +1 -1
- package/std/index.cjs +1 -1
- package/std/index.d.cts +2 -2
- package/std/index.d.ts +2 -2
- package/std/index.js +1 -1
- package/chunk-A6AAWPBU.cjs +0 -2
- package/chunk-A6AAWPBU.cjs.map +0 -1
- package/chunk-HZAXWB4J.js +0 -2
- package/chunk-HZAXWB4J.js.map +0 -1
- package/chunk-T5Y2EQPZ.js +0 -4
- package/chunk-T5Y2EQPZ.js.map +0 -1
- package/chunk-VUYQ2ZIK.cjs +0 -4
@@ -40,6 +40,8 @@ type MemIdentityRecord<T extends Record<string | number | symbol, unknown>> = {
|
|
40
40
|
[Key in keyof T]: MemIdentity<T[Key]>;
|
41
41
|
};
|
42
42
|
|
43
|
+
declare const $internal: unique symbol;
|
44
|
+
|
43
45
|
type Default<T, TDefault> = unknown extends T ? TDefault : T extends undefined ? TDefault : T;
|
44
46
|
type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
|
45
47
|
type Prettify<T> = {
|
@@ -68,27 +70,28 @@ interface BooleanArrayView {
|
|
68
70
|
[n: number]: boolean;
|
69
71
|
}
|
70
72
|
interface BaseData {
|
71
|
-
|
72
|
-
|
73
|
+
readonly [$internal]: true;
|
74
|
+
readonly type: string;
|
73
75
|
readonly [$repr]: unknown;
|
74
76
|
}
|
75
77
|
/**
|
76
78
|
* Represents a 64-bit integer.
|
77
79
|
*/
|
78
80
|
interface AbstractInt {
|
81
|
+
readonly [$internal]: true;
|
79
82
|
readonly type: 'abstractInt';
|
80
|
-
/** Type-token, not available at runtime */
|
81
83
|
readonly [$repr]: number;
|
82
84
|
}
|
83
85
|
/**
|
84
86
|
* Represents a 64-bit IEEE 754 floating point number.
|
85
87
|
*/
|
86
88
|
interface AbstractFloat {
|
89
|
+
readonly [$internal]: true;
|
87
90
|
readonly type: 'abstractFloat';
|
88
|
-
/** Type-token, not available at runtime */
|
89
91
|
readonly [$repr]: number;
|
90
92
|
}
|
91
93
|
interface Void {
|
94
|
+
readonly [$internal]: true;
|
92
95
|
readonly type: 'void';
|
93
96
|
readonly [$repr]: undefined;
|
94
97
|
}
|
@@ -403,6 +406,7 @@ interface Swizzle4<T2, T3, T4> extends Swizzle3<T2, T3, T4> {
|
|
403
406
|
* A vector with 2 elements of type f32
|
404
407
|
*/
|
405
408
|
interface v2f extends NumberArrayView, Swizzle2<v2f, v3f, v4f> {
|
409
|
+
readonly [$internal]: true;
|
406
410
|
/** use to distinguish between vectors of the same size on the type level */
|
407
411
|
readonly kind: 'vec2f';
|
408
412
|
x: number;
|
@@ -413,6 +417,7 @@ interface v2f extends NumberArrayView, Swizzle2<v2f, v3f, v4f> {
|
|
413
417
|
* A vector with 2 elements of type f16
|
414
418
|
*/
|
415
419
|
interface v2h extends NumberArrayView, Swizzle2<v2h, v3h, v4h> {
|
420
|
+
readonly [$internal]: true;
|
416
421
|
/** use to distinguish between vectors of the same size on the type level */
|
417
422
|
readonly kind: 'vec2h';
|
418
423
|
x: number;
|
@@ -423,6 +428,7 @@ interface v2h extends NumberArrayView, Swizzle2<v2h, v3h, v4h> {
|
|
423
428
|
* A vector with 2 elements of type i32
|
424
429
|
*/
|
425
430
|
interface v2i extends NumberArrayView, Swizzle2<v2i, v3i, v4i> {
|
431
|
+
readonly [$internal]: true;
|
426
432
|
/** use to distinguish between vectors of the same size on the type level */
|
427
433
|
readonly kind: 'vec2i';
|
428
434
|
x: number;
|
@@ -433,6 +439,7 @@ interface v2i extends NumberArrayView, Swizzle2<v2i, v3i, v4i> {
|
|
433
439
|
* A vector with 2 elements of type u32
|
434
440
|
*/
|
435
441
|
interface v2u extends NumberArrayView, Swizzle2<v2u, v3u, v4u> {
|
442
|
+
readonly [$internal]: true;
|
436
443
|
/** use to distinguish between vectors of the same size on the type level */
|
437
444
|
readonly kind: 'vec2u';
|
438
445
|
x: number;
|
@@ -443,6 +450,7 @@ interface v2u extends NumberArrayView, Swizzle2<v2u, v3u, v4u> {
|
|
443
450
|
* A vector with 2 elements of type `bool`
|
444
451
|
*/
|
445
452
|
interface v2b extends BooleanArrayView, Swizzle2<v2b, v3b, v4b> {
|
453
|
+
readonly [$internal]: true;
|
446
454
|
/** use to distinguish between vectors of the same size on the type level */
|
447
455
|
readonly kind: 'vec2<bool>';
|
448
456
|
x: boolean;
|
@@ -453,6 +461,7 @@ interface v2b extends BooleanArrayView, Swizzle2<v2b, v3b, v4b> {
|
|
453
461
|
* A vector with 3 elements of type f32
|
454
462
|
*/
|
455
463
|
interface v3f extends NumberArrayView, Swizzle3<v2f, v3f, v4f> {
|
464
|
+
readonly [$internal]: true;
|
456
465
|
/** use to distinguish between vectors of the same size on the type level */
|
457
466
|
readonly kind: 'vec3f';
|
458
467
|
x: number;
|
@@ -464,6 +473,7 @@ interface v3f extends NumberArrayView, Swizzle3<v2f, v3f, v4f> {
|
|
464
473
|
* A vector with 3 elements of type f16
|
465
474
|
*/
|
466
475
|
interface v3h extends NumberArrayView, Swizzle3<v2h, v3h, v4h> {
|
476
|
+
readonly [$internal]: true;
|
467
477
|
/** use to distinguish between vectors of the same size on the type level */
|
468
478
|
readonly kind: 'vec3h';
|
469
479
|
x: number;
|
@@ -475,6 +485,7 @@ interface v3h extends NumberArrayView, Swizzle3<v2h, v3h, v4h> {
|
|
475
485
|
* A vector with 3 elements of type i32
|
476
486
|
*/
|
477
487
|
interface v3i extends NumberArrayView, Swizzle3<v2i, v3i, v4i> {
|
488
|
+
readonly [$internal]: true;
|
478
489
|
/** use to distinguish between vectors of the same size on the type level */
|
479
490
|
readonly kind: 'vec3i';
|
480
491
|
x: number;
|
@@ -486,6 +497,7 @@ interface v3i extends NumberArrayView, Swizzle3<v2i, v3i, v4i> {
|
|
486
497
|
* A vector with 3 elements of type u32
|
487
498
|
*/
|
488
499
|
interface v3u extends NumberArrayView, Swizzle3<v2u, v3u, v4u> {
|
500
|
+
readonly [$internal]: true;
|
489
501
|
/** use to distinguish between vectors of the same size on the type level */
|
490
502
|
readonly kind: 'vec3u';
|
491
503
|
x: number;
|
@@ -497,6 +509,7 @@ interface v3u extends NumberArrayView, Swizzle3<v2u, v3u, v4u> {
|
|
497
509
|
* A vector with 3 elements of type `bool`
|
498
510
|
*/
|
499
511
|
interface v3b extends BooleanArrayView, Swizzle3<v2b, v3b, v4b> {
|
512
|
+
readonly [$internal]: true;
|
500
513
|
/** use to distinguish between vectors of the same size on the type level */
|
501
514
|
readonly kind: 'vec3<bool>';
|
502
515
|
x: boolean;
|
@@ -508,6 +521,7 @@ interface v3b extends BooleanArrayView, Swizzle3<v2b, v3b, v4b> {
|
|
508
521
|
* A vector with 4 elements of type f32
|
509
522
|
*/
|
510
523
|
interface v4f extends NumberArrayView, Swizzle4<v2f, v3f, v4f> {
|
524
|
+
readonly [$internal]: true;
|
511
525
|
/** use to distinguish between vectors of the same size on the type level */
|
512
526
|
readonly kind: 'vec4f';
|
513
527
|
x: number;
|
@@ -520,6 +534,7 @@ interface v4f extends NumberArrayView, Swizzle4<v2f, v3f, v4f> {
|
|
520
534
|
* A vector with 4 elements of type f16
|
521
535
|
*/
|
522
536
|
interface v4h extends NumberArrayView, Swizzle4<v2h, v3h, v4h> {
|
537
|
+
readonly [$internal]: true;
|
523
538
|
/** use to distinguish between vectors of the same size on the type level */
|
524
539
|
readonly kind: 'vec4h';
|
525
540
|
x: number;
|
@@ -532,6 +547,7 @@ interface v4h extends NumberArrayView, Swizzle4<v2h, v3h, v4h> {
|
|
532
547
|
* A vector with 4 elements of type i32
|
533
548
|
*/
|
534
549
|
interface v4i extends NumberArrayView, Swizzle4<v2i, v3i, v4i> {
|
550
|
+
readonly [$internal]: true;
|
535
551
|
/** use to distinguish between vectors of the same size on the type level */
|
536
552
|
readonly kind: 'vec4i';
|
537
553
|
x: number;
|
@@ -544,6 +560,7 @@ interface v4i extends NumberArrayView, Swizzle4<v2i, v3i, v4i> {
|
|
544
560
|
* A vector with 4 elements of type u32
|
545
561
|
*/
|
546
562
|
interface v4u extends NumberArrayView, Swizzle4<v2u, v3u, v4u> {
|
563
|
+
readonly [$internal]: true;
|
547
564
|
/** use to distinguish between vectors of the same size on the type level */
|
548
565
|
readonly kind: 'vec4u';
|
549
566
|
x: number;
|
@@ -556,6 +573,7 @@ interface v4u extends NumberArrayView, Swizzle4<v2u, v3u, v4u> {
|
|
556
573
|
* A vector with 4 elements of type `bool`
|
557
574
|
*/
|
558
575
|
interface v4b extends BooleanArrayView, Swizzle4<v2b, v3b, v4b> {
|
576
|
+
readonly [$internal]: true;
|
559
577
|
/** use to distinguish between vectors of the same size on the type level */
|
560
578
|
readonly kind: 'vec4<bool>';
|
561
579
|
x: boolean;
|
@@ -574,6 +592,7 @@ type AnyVec3Instance = v3f | v3h | v3i | v3u | v3b;
|
|
574
592
|
type AnyVec4Instance = v4f | v4h | v4i | v4u | v4b;
|
575
593
|
type AnyVecInstance = AnyVec2Instance | AnyVec3Instance | AnyVec4Instance;
|
576
594
|
interface matBase<TColumn> extends NumberArrayView {
|
595
|
+
readonly [$internal]: true;
|
577
596
|
readonly columns: readonly TColumn[];
|
578
597
|
}
|
579
598
|
/**
|
@@ -631,6 +650,7 @@ type vBaseForMat<T extends AnyMatInstance> = T extends m2x2f ? v2f : T extends m
|
|
631
650
|
* Cannot be used inside buffers as it is not host-shareable.
|
632
651
|
*/
|
633
652
|
interface Bool {
|
653
|
+
readonly [$internal]: true;
|
634
654
|
readonly type: 'bool';
|
635
655
|
readonly [$repr]: boolean;
|
636
656
|
}
|
@@ -638,8 +658,8 @@ interface Bool {
|
|
638
658
|
* 32-bit float schema representing a single WGSL f32 value.
|
639
659
|
*/
|
640
660
|
interface F32 {
|
661
|
+
readonly [$internal]: true;
|
641
662
|
readonly type: 'f32';
|
642
|
-
/** Type-token, not available at runtime */
|
643
663
|
readonly [$repr]: number;
|
644
664
|
(v: number | boolean): number;
|
645
665
|
}
|
@@ -647,8 +667,8 @@ interface F32 {
|
|
647
667
|
* 16-bit float schema representing a single WGSL f16 value.
|
648
668
|
*/
|
649
669
|
interface F16 {
|
670
|
+
readonly [$internal]: true;
|
650
671
|
readonly type: 'f16';
|
651
|
-
/** Type-token, not available at runtime */
|
652
672
|
readonly [$repr]: number;
|
653
673
|
(v: number | boolean): number;
|
654
674
|
}
|
@@ -656,8 +676,8 @@ interface F16 {
|
|
656
676
|
* Signed 32-bit integer schema representing a single WGSL i32 value.
|
657
677
|
*/
|
658
678
|
interface I32 {
|
679
|
+
readonly [$internal]: true;
|
659
680
|
readonly type: 'i32';
|
660
|
-
/** Type-token, not available at runtime */
|
661
681
|
readonly [$repr]: number;
|
662
682
|
readonly '~memIdent': I32 | Atomic<I32> | DecoratedLocation<I32>;
|
663
683
|
(v: number | boolean): number;
|
@@ -666,8 +686,8 @@ interface I32 {
|
|
666
686
|
* Unsigned 32-bit integer schema representing a single WGSL u32 value.
|
667
687
|
*/
|
668
688
|
interface U32 {
|
689
|
+
readonly [$internal]: true;
|
669
690
|
readonly type: 'u32';
|
670
|
-
/** Type-token, not available at runtime */
|
671
691
|
readonly [$repr]: number;
|
672
692
|
readonly '~memIdent': U32 | Atomic<U32> | DecoratedLocation<U32>;
|
673
693
|
(v: number | boolean): number;
|
@@ -676,8 +696,8 @@ interface U32 {
|
|
676
696
|
* Type of the `d.vec2f` object/function: vector data type schema/constructor
|
677
697
|
*/
|
678
698
|
interface Vec2f {
|
699
|
+
readonly [$internal]: true;
|
679
700
|
readonly type: 'vec2f';
|
680
|
-
/** Type-token, not available at runtime */
|
681
701
|
readonly [$repr]: v2f;
|
682
702
|
(x: number, y: number): v2f;
|
683
703
|
(xy: number): v2f;
|
@@ -688,8 +708,8 @@ interface Vec2f {
|
|
688
708
|
* Type of the `d.vec2h` object/function: vector data type schema/constructor
|
689
709
|
*/
|
690
710
|
interface Vec2h {
|
711
|
+
readonly [$internal]: true;
|
691
712
|
readonly type: 'vec2h';
|
692
|
-
/** Type-token, not available at runtime */
|
693
713
|
readonly [$repr]: v2h;
|
694
714
|
(x: number, y: number): v2h;
|
695
715
|
(xy: number): v2h;
|
@@ -700,8 +720,8 @@ interface Vec2h {
|
|
700
720
|
* Type of the `d.vec2i` object/function: vector data type schema/constructor
|
701
721
|
*/
|
702
722
|
interface Vec2i {
|
723
|
+
readonly [$internal]: true;
|
703
724
|
readonly type: 'vec2i';
|
704
|
-
/** Type-token, not available at runtime */
|
705
725
|
readonly [$repr]: v2i;
|
706
726
|
(x: number, y: number): v2i;
|
707
727
|
(xy: number): v2i;
|
@@ -712,8 +732,8 @@ interface Vec2i {
|
|
712
732
|
* Type of the `d.vec2u` object/function: vector data type schema/constructor
|
713
733
|
*/
|
714
734
|
interface Vec2u {
|
735
|
+
readonly [$internal]: true;
|
715
736
|
readonly type: 'vec2u';
|
716
|
-
/** Type-token, not available at runtime */
|
717
737
|
readonly [$repr]: v2u;
|
718
738
|
(x: number, y: number): v2u;
|
719
739
|
(xy: number): v2u;
|
@@ -725,8 +745,8 @@ interface Vec2u {
|
|
725
745
|
* Cannot be used inside buffers as it is not host-shareable.
|
726
746
|
*/
|
727
747
|
interface Vec2b {
|
748
|
+
readonly [$internal]: true;
|
728
749
|
readonly type: 'vec2<bool>';
|
729
|
-
/** Type-token, not available at runtime */
|
730
750
|
readonly [$repr]: v2b;
|
731
751
|
(x: boolean, y: boolean): v2b;
|
732
752
|
(xy: boolean): v2b;
|
@@ -737,8 +757,8 @@ interface Vec2b {
|
|
737
757
|
* Type of the `d.vec3f` object/function: vector data type schema/constructor
|
738
758
|
*/
|
739
759
|
interface Vec3f {
|
760
|
+
readonly [$internal]: true;
|
740
761
|
readonly type: 'vec3f';
|
741
|
-
/** Type-token, not available at runtime */
|
742
762
|
readonly [$repr]: v3f;
|
743
763
|
(x: number, y: number, z: number): v3f;
|
744
764
|
(xyz: number): v3f;
|
@@ -751,8 +771,8 @@ interface Vec3f {
|
|
751
771
|
* Type of the `d.vec3h` object/function: vector data type schema/constructor
|
752
772
|
*/
|
753
773
|
interface Vec3h {
|
774
|
+
readonly [$internal]: true;
|
754
775
|
readonly type: 'vec3h';
|
755
|
-
/** Type-token, not available at runtime */
|
756
776
|
readonly [$repr]: v3h;
|
757
777
|
(x: number, y: number, z: number): v3h;
|
758
778
|
(xyz: number): v3h;
|
@@ -765,8 +785,8 @@ interface Vec3h {
|
|
765
785
|
* Type of the `d.vec3i` object/function: vector data type schema/constructor
|
766
786
|
*/
|
767
787
|
interface Vec3i {
|
788
|
+
readonly [$internal]: true;
|
768
789
|
readonly type: 'vec3i';
|
769
|
-
/** Type-token, not available at runtime */
|
770
790
|
readonly [$repr]: v3i;
|
771
791
|
(x: number, y: number, z: number): v3i;
|
772
792
|
(xyz: number): v3i;
|
@@ -779,8 +799,8 @@ interface Vec3i {
|
|
779
799
|
* Type of the `d.vec3u` object/function: vector data type schema/constructor
|
780
800
|
*/
|
781
801
|
interface Vec3u {
|
802
|
+
readonly [$internal]: true;
|
782
803
|
readonly type: 'vec3u';
|
783
|
-
/** Type-token, not available at runtime */
|
784
804
|
readonly [$repr]: v3u;
|
785
805
|
(x: number, y: number, z: number): v3u;
|
786
806
|
(xyz: number): v3u;
|
@@ -794,8 +814,8 @@ interface Vec3u {
|
|
794
814
|
* Cannot be used inside buffers as it is not host-shareable.
|
795
815
|
*/
|
796
816
|
interface Vec3b {
|
817
|
+
readonly [$internal]: true;
|
797
818
|
readonly type: 'vec3<bool>';
|
798
|
-
/** Type-token, not available at runtime */
|
799
819
|
readonly [$repr]: v3b;
|
800
820
|
(x: boolean, y: boolean, z: boolean): v3b;
|
801
821
|
(xyz: boolean): v3b;
|
@@ -808,8 +828,8 @@ interface Vec3b {
|
|
808
828
|
* Type of the `d.vec4f` object/function: vector data type schema/constructor
|
809
829
|
*/
|
810
830
|
interface Vec4f {
|
831
|
+
readonly [$internal]: true;
|
811
832
|
readonly type: 'vec4f';
|
812
|
-
/** Type-token, not available at runtime */
|
813
833
|
readonly [$repr]: v4f;
|
814
834
|
(x: number, y: number, z: number, w: number): v4f;
|
815
835
|
(xyzw: number): v4f;
|
@@ -826,8 +846,8 @@ interface Vec4f {
|
|
826
846
|
* Type of the `d.vec4h` object/function: vector data type schema/constructor
|
827
847
|
*/
|
828
848
|
interface Vec4h {
|
849
|
+
readonly [$internal]: true;
|
829
850
|
readonly type: 'vec4h';
|
830
|
-
/** Type-token, not available at runtime */
|
831
851
|
readonly [$repr]: v4h;
|
832
852
|
(x: number, y: number, z: number, w: number): v4h;
|
833
853
|
(xyzw: number): v4h;
|
@@ -844,8 +864,8 @@ interface Vec4h {
|
|
844
864
|
* Type of the `d.vec4i` object/function: vector data type schema/constructor
|
845
865
|
*/
|
846
866
|
interface Vec4i {
|
867
|
+
readonly [$internal]: true;
|
847
868
|
readonly type: 'vec4i';
|
848
|
-
/** Type-token, not available at runtime */
|
849
869
|
readonly [$repr]: v4i;
|
850
870
|
(x: number, y: number, z: number, w: number): v4i;
|
851
871
|
(xyzw: number): v4i;
|
@@ -862,8 +882,8 @@ interface Vec4i {
|
|
862
882
|
* Type of the `d.vec4u` object/function: vector data type schema/constructor
|
863
883
|
*/
|
864
884
|
interface Vec4u {
|
885
|
+
readonly [$internal]: true;
|
865
886
|
readonly type: 'vec4u';
|
866
|
-
/** Type-token, not available at runtime */
|
867
887
|
readonly [$repr]: v4u;
|
868
888
|
(x: number, y: number, z: number, w: number): v4u;
|
869
889
|
(xyzw: number): v4u;
|
@@ -881,8 +901,8 @@ interface Vec4u {
|
|
881
901
|
* Cannot be used inside buffers as it is not host-shareable.
|
882
902
|
*/
|
883
903
|
interface Vec4b {
|
904
|
+
readonly [$internal]: true;
|
884
905
|
readonly type: 'vec4<bool>';
|
885
|
-
/** Type-token, not available at runtime */
|
886
906
|
readonly [$repr]: v4b;
|
887
907
|
(x: boolean, y: boolean, z: boolean, w: boolean): v4b;
|
888
908
|
(xyzw: boolean): v4b;
|
@@ -899,8 +919,8 @@ interface Vec4b {
|
|
899
919
|
* Type of the `d.mat2x2f` object/function: matrix data type schema/constructor
|
900
920
|
*/
|
901
921
|
interface Mat2x2f {
|
922
|
+
readonly [$internal]: true;
|
902
923
|
readonly type: 'mat2x2f';
|
903
|
-
/** Type-token, not available at runtime */
|
904
924
|
readonly [$repr]: m2x2f;
|
905
925
|
(...elements: number[]): m2x2f;
|
906
926
|
(...columns: v2f[]): m2x2f;
|
@@ -910,8 +930,8 @@ interface Mat2x2f {
|
|
910
930
|
* Type of the `d.mat3x3f` object/function: matrix data type schema/constructor
|
911
931
|
*/
|
912
932
|
interface Mat3x3f {
|
933
|
+
readonly [$internal]: true;
|
913
934
|
readonly type: 'mat3x3f';
|
914
|
-
/** Type-token, not available at runtime */
|
915
935
|
readonly [$repr]: m3x3f;
|
916
936
|
(...elements: number[]): m3x3f;
|
917
937
|
(...columns: v3f[]): m3x3f;
|
@@ -921,8 +941,8 @@ interface Mat3x3f {
|
|
921
941
|
* Type of the `d.mat4x4f` object/function: matrix data type schema/constructor
|
922
942
|
*/
|
923
943
|
interface Mat4x4f {
|
944
|
+
readonly [$internal]: true;
|
924
945
|
readonly type: 'mat4x4f';
|
925
|
-
/** Type-token, not available at runtime */
|
926
946
|
readonly [$repr]: m4x4f;
|
927
947
|
(...elements: number[]): m4x4f;
|
928
948
|
(...columns: v4f[]): m4x4f;
|
@@ -936,10 +956,10 @@ interface Mat4x4f {
|
|
936
956
|
* the `byteAlignment` requirement of its elementType.
|
937
957
|
*/
|
938
958
|
interface WgslArray<TElement extends BaseData = BaseData> {
|
959
|
+
readonly [$internal]: true;
|
939
960
|
readonly type: 'array';
|
940
961
|
readonly elementCount: number;
|
941
962
|
readonly elementType: TElement;
|
942
|
-
/** Type-token, not available at runtime */
|
943
963
|
readonly [$repr]: Infer<TElement>[];
|
944
964
|
readonly '~gpuRepr': InferGPU<TElement>[];
|
945
965
|
readonly '~reprPartial': {
|
@@ -948,7 +968,6 @@ interface WgslArray<TElement extends BaseData = BaseData> {
|
|
948
968
|
}[];
|
949
969
|
readonly '~memIdent': WgslArray<MemIdentity<TElement>>;
|
950
970
|
}
|
951
|
-
declare const $structTag: unique symbol;
|
952
971
|
/**
|
953
972
|
* Struct schema constructed via `d.struct` function.
|
954
973
|
*
|
@@ -958,12 +977,10 @@ declare const $structTag: unique symbol;
|
|
958
977
|
*/
|
959
978
|
interface WgslStruct<TProps extends Record<string, BaseData> = Record<string, BaseData>> extends TgpuNamable {
|
960
979
|
(props: Prettify<InferRecord<TProps>>): Prettify<InferRecord<TProps>>;
|
961
|
-
|
980
|
+
readonly [$internal]: true;
|
962
981
|
readonly type: 'struct';
|
963
982
|
readonly label?: string | undefined;
|
964
983
|
readonly propTypes: TProps;
|
965
|
-
readonly [$structTag]: true;
|
966
|
-
/** Type-token, not available at runtime */
|
967
984
|
readonly [$repr]: Prettify<InferRecord<TProps>>;
|
968
985
|
/** Type-token, not available at runtime */
|
969
986
|
readonly '~gpuRepr': Prettify<InferGPURecord<TProps>>;
|
@@ -977,39 +994,44 @@ type AddressSpace = 'uniform' | 'storage' | 'workgroup' | 'private' | 'function'
|
|
977
994
|
type Access = 'read' | 'write' | 'read-write';
|
978
995
|
interface Ptr<TAddr extends AddressSpace = AddressSpace, TInner extends BaseData = BaseData, // can also be sampler or texture (╯'□')╯︵ ┻━┻
|
979
996
|
TAccess extends Access = Access> {
|
997
|
+
readonly [$internal]: true;
|
980
998
|
readonly type: 'ptr';
|
981
999
|
readonly inner: TInner;
|
982
1000
|
readonly addressSpace: TAddr;
|
983
1001
|
readonly access: TAccess;
|
984
|
-
/** Type-token, not available at runtime */
|
985
1002
|
readonly [$repr]: Infer<TInner>;
|
986
1003
|
}
|
987
1004
|
/**
|
988
1005
|
* Schema representing the `atomic<...>` WGSL data type.
|
989
1006
|
*/
|
990
1007
|
interface Atomic<TInner extends U32 | I32 = U32 | I32> {
|
1008
|
+
readonly [$internal]: true;
|
991
1009
|
readonly type: 'atomic';
|
992
1010
|
readonly inner: TInner;
|
993
|
-
/** Type-token, not available at runtime */
|
994
1011
|
readonly [$repr]: Infer<TInner>;
|
995
1012
|
readonly '~gpuRepr': TInner extends U32 ? atomicU32 : atomicI32;
|
996
1013
|
readonly '~memIdent': MemIdentity<TInner>;
|
997
1014
|
}
|
998
1015
|
interface atomicU32 {
|
999
|
-
|
1016
|
+
readonly [$internal]: true;
|
1017
|
+
readonly type: 'atomicU32';
|
1000
1018
|
}
|
1001
1019
|
interface atomicI32 {
|
1002
|
-
|
1020
|
+
readonly [$internal]: true;
|
1021
|
+
readonly type: 'atomicI32';
|
1003
1022
|
}
|
1004
1023
|
interface Align<T extends number> {
|
1024
|
+
readonly [$internal]: true;
|
1005
1025
|
readonly type: '@align';
|
1006
1026
|
readonly value: T;
|
1007
1027
|
}
|
1008
1028
|
interface Size<T extends number> {
|
1029
|
+
readonly [$internal]: true;
|
1009
1030
|
readonly type: '@size';
|
1010
1031
|
readonly value: T;
|
1011
1032
|
}
|
1012
1033
|
interface Location<T extends number> {
|
1034
|
+
readonly [$internal]: true;
|
1013
1035
|
readonly type: '@location';
|
1014
1036
|
readonly value: T;
|
1015
1037
|
}
|
@@ -1017,18 +1039,20 @@ type PerspectiveOrLinearInterpolationType = `${'perspective' | 'linear'}${'' | '
|
|
1017
1039
|
type FlatInterpolationType = `flat${'' | ', first' | ', either'}`;
|
1018
1040
|
type InterpolationType = PerspectiveOrLinearInterpolationType | FlatInterpolationType;
|
1019
1041
|
interface Interpolate<T extends InterpolationType> {
|
1042
|
+
readonly [$internal]: true;
|
1020
1043
|
readonly type: '@interpolate';
|
1021
1044
|
readonly value: T;
|
1022
1045
|
}
|
1023
1046
|
interface Builtin<T extends string> {
|
1047
|
+
readonly [$internal]: true;
|
1024
1048
|
readonly type: '@builtin';
|
1025
1049
|
readonly value: T;
|
1026
1050
|
}
|
1027
1051
|
interface Decorated<TInner extends BaseData = BaseData, TAttribs extends unknown[] = unknown[]> {
|
1052
|
+
readonly [$internal]: true;
|
1028
1053
|
readonly type: 'decorated';
|
1029
1054
|
readonly inner: TInner;
|
1030
1055
|
readonly attribs: TAttribs;
|
1031
|
-
/** Type-token, not available at runtime */
|
1032
1056
|
readonly [$repr]: Infer<TInner>;
|
1033
1057
|
readonly '~gpuRepr': InferGPU<TInner>;
|
1034
1058
|
readonly '~reprPartial': InferPartial<TInner>;
|
@@ -1092,8 +1116,6 @@ declare function isInterpolateAttrib<T extends Interpolate<InterpolationType>>(v
|
|
1092
1116
|
declare function isBuiltinAttrib<T extends Builtin<string>>(value: unknown | T): value is T;
|
1093
1117
|
declare function isDecorated<T extends Decorated>(value: unknown | T): value is T;
|
1094
1118
|
|
1095
|
-
declare const $internal: unique symbol;
|
1096
|
-
|
1097
1119
|
declare const vertexFormats: readonly ["uint8", "uint8x2", "uint8x4", "sint8", "sint8x2", "sint8x4", "unorm8", "unorm8x2", "unorm8x4", "snorm8", "snorm8x2", "snorm8x4", "uint16", "uint16x2", "uint16x4", "sint16", "sint16x2", "sint16x4", "unorm16", "unorm16x2", "unorm16x4", "snorm16", "snorm16x2", "snorm16x4", "float16", "float16x2", "float16x4", "float32", "float32x2", "float32x3", "float32x4", "uint32", "uint32x2", "uint32x3", "uint32x4", "sint32", "sint32x2", "sint32x3", "sint32x4", "unorm10-10-10-2", "unorm8x4-bgra"];
|
1098
1120
|
type VertexFormat = (typeof vertexFormats)[number];
|
1099
1121
|
declare const kindToDefaultFormatMap: {
|
@@ -1163,8 +1185,8 @@ type KindToAcceptedAttribMap = {
|
|
1163
1185
|
|
1164
1186
|
type FormatToWGSLType<T extends VertexFormat> = (typeof formatToWGSLType)[T];
|
1165
1187
|
interface TgpuVertexFormatData<T extends VertexFormat> {
|
1188
|
+
readonly [$internal]: true;
|
1166
1189
|
readonly type: T;
|
1167
|
-
/** Type-token, not available at runtime */
|
1168
1190
|
readonly [$repr]: Infer<FormatToWGSLType<T>>;
|
1169
1191
|
}
|
1170
1192
|
declare const formatToWGSLType: {
|
@@ -1296,9 +1318,7 @@ declare const unorm8x4_bgra: unorm8x4_bgra;
|
|
1296
1318
|
type PackedData = uint8 | uint8x2 | uint8x4 | sint8 | sint8x2 | sint8x4 | unorm8 | unorm8x2 | unorm8x4 | snorm8 | snorm8x2 | snorm8x4 | uint16 | uint16x2 | uint16x4 | sint16 | sint16x2 | sint16x4 | unorm16 | unorm16x2 | unorm16x4 | snorm16 | snorm16x2 | snorm16x4 | float16 | float16x2 | float16x4 | float32 | float32x2 | float32x3 | float32x4 | uint32 | uint32x2 | uint32x3 | uint32x4 | sint32 | sint32x2 | sint32x3 | sint32x4 | unorm10_10_10_2 | unorm8x4_bgra;
|
1297
1319
|
|
1298
1320
|
type TgpuDualFn<TImpl extends (...args: unknown[]) => unknown> = TImpl & {
|
1299
|
-
[$internal]:
|
1300
|
-
implementation: TImpl | string;
|
1301
|
-
};
|
1321
|
+
[$internal]: true;
|
1302
1322
|
};
|
1303
1323
|
/**
|
1304
1324
|
* Array schema constructed via `d.disarrayOf` function.
|
@@ -1309,6 +1329,7 @@ type TgpuDualFn<TImpl extends (...args: unknown[]) => unknown> = TImpl & {
|
|
1309
1329
|
* via `d.align` function.
|
1310
1330
|
*/
|
1311
1331
|
interface Disarray<TElement extends BaseData = BaseData> {
|
1332
|
+
readonly [$internal]: true;
|
1312
1333
|
readonly type: 'disarray';
|
1313
1334
|
readonly elementCount: number;
|
1314
1335
|
readonly elementType: TElement;
|
@@ -1327,6 +1348,7 @@ interface Disarray<TElement extends BaseData = BaseData> {
|
|
1327
1348
|
* via `d.align` function.
|
1328
1349
|
*/
|
1329
1350
|
interface Unstruct<TProps extends Record<string, BaseData> = Record<string, BaseData>> extends TgpuNamable {
|
1351
|
+
readonly [$internal]: true;
|
1330
1352
|
(props: Prettify<InferRecord<TProps>>): Prettify<InferRecord<TProps>>;
|
1331
1353
|
readonly label?: string | undefined;
|
1332
1354
|
readonly type: 'unstruct';
|
@@ -1338,6 +1360,7 @@ interface Unstruct<TProps extends Record<string, BaseData> = Record<string, Base
|
|
1338
1360
|
}
|
1339
1361
|
type AnyUnstruct = Unstruct<any>;
|
1340
1362
|
interface LooseDecorated<TInner extends BaseData = BaseData, TAttribs extends unknown[] = unknown[]> {
|
1363
|
+
readonly [$internal]: true;
|
1341
1364
|
readonly type: 'loose-decorated';
|
1342
1365
|
readonly inner: TInner;
|
1343
1366
|
readonly attribs: TAttribs;
|