typegpu 0.4.2 → 0.4.4
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-Di0A7-Fw.d.cts → attributes-B5bhZAAK.d.cts} +2 -2
- package/{attributes-CkPkK-h9.d.ts → attributes-Cfiq6vud.d.ts} +2 -2
- package/{chunk-DEMK5MOR.cjs → chunk-7X4KDNDZ.cjs} +2 -2
- package/chunk-7X4KDNDZ.cjs.map +1 -0
- package/chunk-C6C35PDM.cjs +2 -0
- package/chunk-C6C35PDM.cjs.map +1 -0
- package/{chunk-C5JKINT2.js → chunk-ZHXAQ2YE.js} +2 -2
- package/{chunk-C5JKINT2.js.map → chunk-ZHXAQ2YE.js.map} +1 -1
- package/chunk-ZJMGYM7L.js +2 -0
- package/chunk-ZJMGYM7L.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/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +126 -113
- package/index.d.ts +126 -113
- package/index.js +10 -10
- package/index.js.map +1 -1
- package/package.json +1 -2
- package/std/index.cjs +1 -1
- package/std/index.cjs.map +1 -1
- package/std/index.d.cts +1 -1
- package/std/index.d.ts +1 -1
- package/std/index.js +1 -1
- package/{wgslTypes-D8LnuOPy.d.cts → wgslTypes-DgaoTc4M.d.cts} +23 -23
- package/{wgslTypes-D8LnuOPy.d.ts → wgslTypes-DgaoTc4M.d.ts} +23 -23
- package/chunk-DEMK5MOR.cjs.map +0 -1
- package/chunk-IHC2SDHN.js +0 -2
- package/chunk-IHC2SDHN.js.map +0 -1
- package/chunk-R4S4YVH4.cjs +0 -2
- package/chunk-R4S4YVH4.cjs.map +0 -1
package/index.d.cts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { A as AnyWgslData, T as TgpuNamable, I as Infer,
|
2
|
-
import { A as AnyAttribute, a as AnyComputeBuiltin, D as Decorate, I as IsBuiltin, H as HasCustomLocation,
|
1
|
+
import { A as AnyWgslData, T as TgpuNamable, I as Infer, F as F32, a as F16, b as I32, U as U32, V as Vec2f, c as Vec3f, d as Vec4f, e as Vec2h, f as Vec3h, g as Vec4h, h as Vec2i, i as Vec3i, j as Vec4i, k as Vec2u, l as Vec3u, m as Vec4u, D as Decorated, n as AnyWgslStruct, B as BaseData, L as Location, W as WgslStruct, o as Default, p as UnionToIntersection, q as WgslArray, r as Disarray, s as Unstruct, t as VertexFormat, u as TgpuVertexAttrib, K as KindToDefaultFormatMap, v as KindToAcceptedAttribMap, w as AnyData, O as OmitProps, P as Prettify, M as Mutable, x as WgslTypeLiteral, y as InferPartial, z as MemIdentity, C as AnyVecInstance, E as AnyMatInstance } from './wgslTypes-DgaoTc4M.cjs';
|
2
|
+
import { A as AnyAttribute, a as AnyComputeBuiltin, D as Decorate, I as IsBuiltin, H as HasCustomLocation, b as AnyFragmentInputBuiltin, c as AnyFragmentOutputBuiltin, O as OmitBuiltins } from './attributes-B5bhZAAK.cjs';
|
3
3
|
import * as smol from 'tinyest';
|
4
4
|
import { Block } from 'tinyest';
|
5
5
|
|
@@ -88,11 +88,14 @@ declare function computeFn<ComputeIn extends Record<string, AnyComputeBuiltin>>(
|
|
88
88
|
workgroupSize: number[];
|
89
89
|
}): TgpuComputeFnShell<ComputeIn>;
|
90
90
|
|
91
|
-
interface
|
91
|
+
interface StorageFlag {
|
92
92
|
usableAsStorage: true;
|
93
93
|
}
|
94
|
-
|
95
|
-
|
94
|
+
/**
|
95
|
+
* @deprecated Use StorageFlag instead.
|
96
|
+
*/
|
97
|
+
type Storage = StorageFlag;
|
98
|
+
declare function isUsableAsStorage<T>(value: T): value is T & StorageFlag;
|
96
99
|
|
97
100
|
/**
|
98
101
|
* Used to transpile JS resources into SMoL on demand.
|
@@ -423,7 +426,7 @@ interface Render {
|
|
423
426
|
usableAsRender: true;
|
424
427
|
}
|
425
428
|
type LiteralToExtensionMap = {
|
426
|
-
storage:
|
429
|
+
storage: StorageFlag;
|
427
430
|
sampled: Sampled;
|
428
431
|
render: Render;
|
429
432
|
};
|
@@ -520,7 +523,7 @@ type DataToContainedAttribs<T> = T extends AnyWgslStruct | Unstruct ? {
|
|
520
523
|
type: VertexFormat;
|
521
524
|
} ? TgpuVertexAttrib<T['type']> : T extends {
|
522
525
|
type: keyof KindToDefaultFormatMap;
|
523
|
-
} ? TgpuVertexAttrib<KindToDefaultFormatMap[T['type']]> : never;
|
526
|
+
} ? TgpuVertexAttrib<KindToDefaultFormatMap[T['type']]> : T extends Decorated<infer TInner> ? DataToContainedAttribs<TInner> : never;
|
524
527
|
/**
|
525
528
|
* Interprets an array as a set of vertex attributes.
|
526
529
|
*/
|
@@ -544,7 +547,7 @@ declare function vertexLayout<TData extends WgslArray | Disarray>(schemaForCount
|
|
544
547
|
interface TgpuRenderPipeline<Output extends IOLayout = IOLayout> extends TgpuNamable {
|
545
548
|
readonly resourceType: 'render-pipeline';
|
546
549
|
readonly label: string | undefined;
|
547
|
-
with<TData extends WgslArray | Disarray>(vertexLayout: TgpuVertexLayout<TData>, buffer: TgpuBuffer<TData> &
|
550
|
+
with<TData extends WgslArray | Disarray>(vertexLayout: TgpuVertexLayout<TData>, buffer: TgpuBuffer<TData> & VertexFlag): TgpuRenderPipeline<IOLayout>;
|
548
551
|
with<Entries extends Record<string, TgpuLayoutEntry | null>>(bindGroupLayout: TgpuBindGroupLayout<Entries>, bindGroup: TgpuBindGroup<Entries>): TgpuRenderPipeline<IOLayout>;
|
549
552
|
withColorAttachment(attachment: FragmentOutToColorAttachment<Output>): TgpuRenderPipeline<IOLayout>;
|
550
553
|
withDepthStencilAttachment(attachment: DepthStencilAttachment): TgpuRenderPipeline<IOLayout>;
|
@@ -648,6 +651,100 @@ interface DepthStencilAttachment {
|
|
648
651
|
stencilReadOnly?: boolean;
|
649
652
|
}
|
650
653
|
|
654
|
+
interface SamplerProps {
|
655
|
+
addressModeU?: GPUAddressMode;
|
656
|
+
addressModeV?: GPUAddressMode;
|
657
|
+
/**
|
658
|
+
* Specifies the address modes for the texture width, height, and depth
|
659
|
+
* coordinates, respectively.
|
660
|
+
*/
|
661
|
+
addressModeW?: GPUAddressMode;
|
662
|
+
/**
|
663
|
+
* Specifies the sampling behavior when the sample footprint is smaller than or equal to one
|
664
|
+
* texel.
|
665
|
+
*/
|
666
|
+
magFilter?: GPUFilterMode;
|
667
|
+
/**
|
668
|
+
* Specifies the sampling behavior when the sample footprint is larger than one texel.
|
669
|
+
*/
|
670
|
+
minFilter?: GPUFilterMode;
|
671
|
+
/**
|
672
|
+
* Specifies behavior for sampling between mipmap levels.
|
673
|
+
*/
|
674
|
+
mipmapFilter?: GPUMipmapFilterMode;
|
675
|
+
lodMinClamp?: number;
|
676
|
+
/**
|
677
|
+
* Specifies the minimum and maximum levels of detail, respectively, used internally when
|
678
|
+
* sampling a texture.
|
679
|
+
*/
|
680
|
+
lodMaxClamp?: number;
|
681
|
+
/**
|
682
|
+
* Specifies the maximum anisotropy value clamp used by the sampler. Anisotropic filtering is
|
683
|
+
* enabled when {@link GPUSamplerDescriptor.maxAnisotropy} is > 1 and the implementation supports it.
|
684
|
+
* Anisotropic filtering improves the image quality of textures sampled at oblique viewing
|
685
|
+
* angles. Higher {@link GPUSamplerDescriptor.maxAnisotropy} values indicate the maximum ratio of
|
686
|
+
* anisotropy supported when filtering.
|
687
|
+
*
|
688
|
+
* Most implementations support {@link GPUSamplerDescriptor.maxAnisotropy} values in range
|
689
|
+
* between 1 and 16, inclusive. The used value of {@link GPUSamplerDescriptor.maxAnisotropy}
|
690
|
+
* will be clamped to the maximum value that the platform supports.
|
691
|
+
* The precise filtering behavior is implementation-dependent.
|
692
|
+
*/
|
693
|
+
maxAnisotropy?: number;
|
694
|
+
}
|
695
|
+
interface ComparisonSamplerProps {
|
696
|
+
compare: GPUCompareFunction;
|
697
|
+
addressModeU?: GPUAddressMode;
|
698
|
+
addressModeV?: GPUAddressMode;
|
699
|
+
/**
|
700
|
+
* Specifies the address modes for the texture width, height, and depth
|
701
|
+
* coordinates, respectively.
|
702
|
+
*/
|
703
|
+
addressModeW?: GPUAddressMode;
|
704
|
+
/**
|
705
|
+
* Specifies the sampling behavior when the sample footprint is smaller than or equal to one
|
706
|
+
* texel.
|
707
|
+
*/
|
708
|
+
magFilter?: GPUFilterMode;
|
709
|
+
/**
|
710
|
+
* Specifies the sampling behavior when the sample footprint is larger than one texel.
|
711
|
+
*/
|
712
|
+
minFilter?: GPUFilterMode;
|
713
|
+
/**
|
714
|
+
* Specifies behavior for sampling between mipmap levels.
|
715
|
+
*/
|
716
|
+
mipmapFilter?: GPUMipmapFilterMode;
|
717
|
+
lodMinClamp?: number;
|
718
|
+
/**
|
719
|
+
* Specifies the minimum and maximum levels of detail, respectively, used internally when
|
720
|
+
* sampling a texture.
|
721
|
+
*/
|
722
|
+
lodMaxClamp?: number;
|
723
|
+
/**
|
724
|
+
* Specifies the maximum anisotropy value clamp used by the sampler. Anisotropic filtering is
|
725
|
+
* enabled when {@link GPUSamplerDescriptor.maxAnisotropy} is > 1 and the implementation supports it.
|
726
|
+
* Anisotropic filtering improves the image quality of textures sampled at oblique viewing
|
727
|
+
* angles. Higher {@link GPUSamplerDescriptor.maxAnisotropy} values indicate the maximum ratio of
|
728
|
+
* anisotropy supported when filtering.
|
729
|
+
*
|
730
|
+
* Most implementations support {@link GPUSamplerDescriptor.maxAnisotropy} values in range
|
731
|
+
* between 1 and 16, inclusive. The used value of {@link GPUSamplerDescriptor.maxAnisotropy}
|
732
|
+
* will be clamped to the maximum value that the platform supports.
|
733
|
+
* The precise filtering behavior is implementation-dependent.
|
734
|
+
*/
|
735
|
+
maxAnisotropy?: number;
|
736
|
+
}
|
737
|
+
interface TgpuSampler {
|
738
|
+
readonly resourceType: 'sampler';
|
739
|
+
}
|
740
|
+
interface TgpuComparisonSampler {
|
741
|
+
readonly resourceType: 'sampler-comparison';
|
742
|
+
}
|
743
|
+
declare function sampler(props: SamplerProps): TgpuSampler;
|
744
|
+
declare function comparisonSampler(props: ComparisonSamplerProps): TgpuComparisonSampler;
|
745
|
+
declare function isSampler(resource: unknown): resource is TgpuSampler;
|
746
|
+
declare function isComparisonSampler(resource: unknown): resource is TgpuComparisonSampler;
|
747
|
+
|
651
748
|
interface Unwrapper {
|
652
749
|
readonly device: GPUDevice;
|
653
750
|
unwrap(resource: TgpuComputePipeline): GPUComputePipeline;
|
@@ -658,6 +755,8 @@ interface Unwrapper {
|
|
658
755
|
unwrap(resource: TgpuTexture): GPUTexture;
|
659
756
|
unwrap(resource: TgpuReadonlyTexture | TgpuWriteonlyTexture | TgpuMutableTexture | TgpuSampledTexture): GPUTextureView;
|
660
757
|
unwrap(resource: TgpuVertexLayout): GPUVertexBufferLayout;
|
758
|
+
unwrap(resource: TgpuSampler): GPUSampler;
|
759
|
+
unwrap(resource: TgpuComparisonSampler): GPUSampler;
|
661
760
|
}
|
662
761
|
|
663
762
|
interface WithCompute {
|
@@ -794,7 +893,7 @@ interface RenderPass {
|
|
794
893
|
* Defaults to the size of the buffer minus the offset.
|
795
894
|
*/
|
796
895
|
setIndexBuffer<TData extends WgslArray | Disarray>(buffer: TgpuBuffer<TData> | GPUBuffer, indexFormat: GPUIndexFormat, offset?: GPUSize64, size?: GPUSize64): void;
|
797
|
-
setVertexBuffer<TData extends WgslArray | Disarray>(vertexLayout: TgpuVertexLayout<TData>, buffer: (TgpuBuffer<TData> &
|
896
|
+
setVertexBuffer<TData extends WgslArray | Disarray>(vertexLayout: TgpuVertexLayout<TData>, buffer: (TgpuBuffer<TData> & VertexFlag) | GPUBuffer, offset?: GPUSize64, size?: GPUSize64): void;
|
798
897
|
setBindGroup<Entries extends Record<string, TgpuLayoutEntry | null>>(bindGroupLayout: TgpuBindGroupLayout<Entries>, bindGroup: TgpuBindGroup<Entries> | GPUBindGroup): void;
|
799
898
|
/**
|
800
899
|
* Draws primitives.
|
@@ -910,13 +1009,21 @@ interface ExperimentalTgpuRoot extends TgpuRoot, WithBinding {
|
|
910
1009
|
flush(): void;
|
911
1010
|
}
|
912
1011
|
|
913
|
-
interface
|
1012
|
+
interface UniformFlag {
|
914
1013
|
usableAsUniform: true;
|
915
1014
|
}
|
916
|
-
|
1015
|
+
/**
|
1016
|
+
* @deprecated Use UniformFlag instead.
|
1017
|
+
*/
|
1018
|
+
type Uniform = UniformFlag;
|
1019
|
+
interface VertexFlag {
|
917
1020
|
usableAsVertex: true;
|
918
1021
|
}
|
919
|
-
|
1022
|
+
/**
|
1023
|
+
* @deprecated Use VertexFlag instead.
|
1024
|
+
*/
|
1025
|
+
type Vertex = VertexFlag;
|
1026
|
+
type LiteralToUsageType<T extends 'uniform' | 'storage' | 'vertex'> = T extends 'uniform' ? UniformFlag : T extends 'storage' ? StorageFlag : T extends 'vertex' ? VertexFlag : never;
|
920
1027
|
type ViewUsages<TBuffer extends TgpuBuffer<BaseData>> = (boolean extends TBuffer['usableAsUniform'] ? never : 'uniform') | (boolean extends TBuffer['usableAsStorage'] ? never : 'readonly' | 'mutable');
|
921
1028
|
type UsageTypeToBufferUsage<TData extends BaseData> = {
|
922
1029
|
uniform: TgpuBufferUniform<TData> & TgpuFixedBufferUsage<TData>;
|
@@ -943,105 +1050,11 @@ interface TgpuBuffer<TData extends BaseData> extends TgpuNamable {
|
|
943
1050
|
destroy(): void;
|
944
1051
|
}
|
945
1052
|
declare function isBuffer<T extends TgpuBuffer<AnyData>>(value: T | unknown): value is T;
|
946
|
-
declare function isUsableAsVertex<T extends TgpuBuffer<AnyData>>(buffer: T): buffer is T &
|
1053
|
+
declare function isUsableAsVertex<T extends TgpuBuffer<AnyData>>(buffer: T): buffer is T & VertexFlag;
|
947
1054
|
type RestrictVertexUsages<TData extends BaseData> = TData extends {
|
948
1055
|
readonly type: WgslTypeLiteral;
|
949
1056
|
} ? ('uniform' | 'storage' | 'vertex')[] : 'vertex'[];
|
950
1057
|
|
951
|
-
interface SamplerProps {
|
952
|
-
addressModeU?: GPUAddressMode;
|
953
|
-
addressModeV?: GPUAddressMode;
|
954
|
-
/**
|
955
|
-
* Specifies the address modes for the texture width, height, and depth
|
956
|
-
* coordinates, respectively.
|
957
|
-
*/
|
958
|
-
addressModeW?: GPUAddressMode;
|
959
|
-
/**
|
960
|
-
* Specifies the sampling behavior when the sample footprint is smaller than or equal to one
|
961
|
-
* texel.
|
962
|
-
*/
|
963
|
-
magFilter?: GPUFilterMode;
|
964
|
-
/**
|
965
|
-
* Specifies the sampling behavior when the sample footprint is larger than one texel.
|
966
|
-
*/
|
967
|
-
minFilter?: GPUFilterMode;
|
968
|
-
/**
|
969
|
-
* Specifies behavior for sampling between mipmap levels.
|
970
|
-
*/
|
971
|
-
mipmapFilter?: GPUMipmapFilterMode;
|
972
|
-
lodMinClamp?: number;
|
973
|
-
/**
|
974
|
-
* Specifies the minimum and maximum levels of detail, respectively, used internally when
|
975
|
-
* sampling a texture.
|
976
|
-
*/
|
977
|
-
lodMaxClamp?: number;
|
978
|
-
/**
|
979
|
-
* Specifies the maximum anisotropy value clamp used by the sampler. Anisotropic filtering is
|
980
|
-
* enabled when {@link GPUSamplerDescriptor.maxAnisotropy} is > 1 and the implementation supports it.
|
981
|
-
* Anisotropic filtering improves the image quality of textures sampled at oblique viewing
|
982
|
-
* angles. Higher {@link GPUSamplerDescriptor.maxAnisotropy} values indicate the maximum ratio of
|
983
|
-
* anisotropy supported when filtering.
|
984
|
-
*
|
985
|
-
* Most implementations support {@link GPUSamplerDescriptor.maxAnisotropy} values in range
|
986
|
-
* between 1 and 16, inclusive. The used value of {@link GPUSamplerDescriptor.maxAnisotropy}
|
987
|
-
* will be clamped to the maximum value that the platform supports.
|
988
|
-
* The precise filtering behavior is implementation-dependent.
|
989
|
-
*/
|
990
|
-
maxAnisotropy?: number;
|
991
|
-
}
|
992
|
-
interface ComparisonSamplerProps {
|
993
|
-
compare: GPUCompareFunction;
|
994
|
-
addressModeU?: GPUAddressMode;
|
995
|
-
addressModeV?: GPUAddressMode;
|
996
|
-
/**
|
997
|
-
* Specifies the address modes for the texture width, height, and depth
|
998
|
-
* coordinates, respectively.
|
999
|
-
*/
|
1000
|
-
addressModeW?: GPUAddressMode;
|
1001
|
-
/**
|
1002
|
-
* Specifies the sampling behavior when the sample footprint is smaller than or equal to one
|
1003
|
-
* texel.
|
1004
|
-
*/
|
1005
|
-
magFilter?: GPUFilterMode;
|
1006
|
-
/**
|
1007
|
-
* Specifies the sampling behavior when the sample footprint is larger than one texel.
|
1008
|
-
*/
|
1009
|
-
minFilter?: GPUFilterMode;
|
1010
|
-
/**
|
1011
|
-
* Specifies behavior for sampling between mipmap levels.
|
1012
|
-
*/
|
1013
|
-
mipmapFilter?: GPUMipmapFilterMode;
|
1014
|
-
lodMinClamp?: number;
|
1015
|
-
/**
|
1016
|
-
* Specifies the minimum and maximum levels of detail, respectively, used internally when
|
1017
|
-
* sampling a texture.
|
1018
|
-
*/
|
1019
|
-
lodMaxClamp?: number;
|
1020
|
-
/**
|
1021
|
-
* Specifies the maximum anisotropy value clamp used by the sampler. Anisotropic filtering is
|
1022
|
-
* enabled when {@link GPUSamplerDescriptor.maxAnisotropy} is > 1 and the implementation supports it.
|
1023
|
-
* Anisotropic filtering improves the image quality of textures sampled at oblique viewing
|
1024
|
-
* angles. Higher {@link GPUSamplerDescriptor.maxAnisotropy} values indicate the maximum ratio of
|
1025
|
-
* anisotropy supported when filtering.
|
1026
|
-
*
|
1027
|
-
* Most implementations support {@link GPUSamplerDescriptor.maxAnisotropy} values in range
|
1028
|
-
* between 1 and 16, inclusive. The used value of {@link GPUSamplerDescriptor.maxAnisotropy}
|
1029
|
-
* will be clamped to the maximum value that the platform supports.
|
1030
|
-
* The precise filtering behavior is implementation-dependent.
|
1031
|
-
*/
|
1032
|
-
maxAnisotropy?: number;
|
1033
|
-
}
|
1034
|
-
interface TgpuSampler {
|
1035
|
-
readonly resourceType: 'sampler';
|
1036
|
-
}
|
1037
|
-
interface TgpuComparisonSampler {
|
1038
|
-
readonly resourceType: 'sampler-comparison';
|
1039
|
-
}
|
1040
|
-
declare function sampler(props: SamplerProps): TgpuSampler;
|
1041
|
-
declare function comparisonSampler(props: ComparisonSamplerProps): TgpuComparisonSampler;
|
1042
|
-
declare function isSampler(resource: unknown): resource is TgpuSampler;
|
1043
|
-
declare function isComparisonSampler(resource: unknown): resource is TgpuComparisonSampler;
|
1044
|
-
|
1045
1058
|
type TgpuLayoutEntryBase = {
|
1046
1059
|
/**
|
1047
1060
|
* Limits this resource's visibility to specific shader stages.
|
@@ -1156,7 +1169,7 @@ type GetStorageTextureRestriction<T extends TgpuLayoutStorageTexture> = Default<
|
|
1156
1169
|
format: T['storageTexture'];
|
1157
1170
|
dimension: Dimension;
|
1158
1171
|
} : never;
|
1159
|
-
type LayoutEntryToInput<T extends TgpuLayoutEntry | null> = T extends TgpuLayoutUniform ? (TgpuBuffer<UnwrapRuntimeConstructor<T['uniform']>> &
|
1172
|
+
type LayoutEntryToInput<T extends TgpuLayoutEntry | null> = T extends TgpuLayoutUniform ? (TgpuBuffer<UnwrapRuntimeConstructor<T['uniform']>> & UniformFlag) | GPUBuffer : T extends TgpuLayoutStorage ? (TgpuBuffer<UnwrapRuntimeConstructor<T['storage']>> & StorageFlag) | GPUBuffer : T extends TgpuLayoutSampler ? TgpuSampler | GPUSampler : T extends TgpuLayoutComparisonSampler ? TgpuComparisonSampler | GPUSampler : T extends TgpuLayoutTexture ? GPUTextureView | (Sampled & TgpuTexture<Prettify<TextureProps & GetTextureRestriction<T>>>) : T extends TgpuLayoutStorageTexture ? GPUTextureView | (StorageFlag & TgpuTexture<Prettify<TextureProps & GetStorageTextureRestriction<T>>>) : T extends TgpuLayoutExternalTexture ? GPUExternalTexture : never;
|
1160
1173
|
type BindLayoutEntry<T extends TgpuLayoutEntry | null> = T extends TgpuLayoutUniform ? TgpuBufferUniform<UnwrapRuntimeConstructor<T['uniform']>> : T extends TgpuLayoutStorage ? StorageUsageForEntry<T> : T extends TgpuLayoutSampler ? TgpuSampler : T extends TgpuLayoutComparisonSampler ? TgpuComparisonSampler : T extends TgpuLayoutTexture ? TgpuSampledTexture<Default<GetDimension<T['viewDimension']>, '2d'>, ChannelFormatToSchema[T['texture']]> : T extends TgpuLayoutStorageTexture ? StorageTextureUsageForEntry<T> : never;
|
1161
1174
|
type TgpuBindGroup<Entries extends Record<string, TgpuLayoutEntry | null> = Record<string, TgpuLayoutEntry | null>> = {
|
1162
1175
|
readonly resourceType: 'bind-group';
|
@@ -1183,19 +1196,19 @@ interface TgpuFixedBufferUsage<TData extends BaseData> extends TgpuNamable {
|
|
1183
1196
|
}
|
1184
1197
|
interface TgpuBufferMutable<TData extends BaseData> extends TgpuBufferUsage<TData, 'mutable'> {
|
1185
1198
|
}
|
1186
|
-
declare function isUsableAsUniform<T extends TgpuBuffer<AnyData>>(buffer: T): buffer is T &
|
1199
|
+
declare function isUsableAsUniform<T extends TgpuBuffer<AnyData>>(buffer: T): buffer is T & UniformFlag;
|
1187
1200
|
/**
|
1188
1201
|
* @deprecated Use buffer.as('mutable') instead.
|
1189
1202
|
*/
|
1190
|
-
declare function asMutable<TData extends AnyWgslData>(buffer: TgpuBuffer<TData> &
|
1203
|
+
declare function asMutable<TData extends AnyWgslData>(buffer: TgpuBuffer<TData> & StorageFlag): TgpuBufferMutable<TData> & TgpuFixedBufferUsage<TData>;
|
1191
1204
|
/**
|
1192
1205
|
* @deprecated Use buffer.as('readonly') instead.
|
1193
1206
|
*/
|
1194
|
-
declare function asReadonly<TData extends AnyWgslData>(buffer: TgpuBuffer<TData> &
|
1207
|
+
declare function asReadonly<TData extends AnyWgslData>(buffer: TgpuBuffer<TData> & StorageFlag): TgpuBufferReadonly<TData> & TgpuFixedBufferUsage<TData>;
|
1195
1208
|
/**
|
1196
1209
|
* @deprecated Use buffer.as('uniform') instead.
|
1197
1210
|
*/
|
1198
|
-
declare function asUniform<TData extends AnyWgslData>(buffer: TgpuBuffer<TData> &
|
1211
|
+
declare function asUniform<TData extends AnyWgslData>(buffer: TgpuBuffer<TData> & UniformFlag): TgpuBufferUniform<TData> & TgpuFixedBufferUsage<TData>;
|
1199
1212
|
|
1200
1213
|
interface TgpuExternalTexture {
|
1201
1214
|
readonly resourceType: 'external-texture';
|
@@ -1500,4 +1513,4 @@ declare const tgpu: {
|
|
1500
1513
|
};
|
1501
1514
|
};
|
1502
1515
|
|
1503
|
-
export { type BindLayoutEntry, type Eventual, type InitFromDeviceOptions, type InitOptions, type LayoutEntryToInput, MissingBindGroupsError, MissingLinksError, MissingSlotValueError, MissingVertexBuffersError, NotUniformError, RandomNameRegistry, type Render, ResolutionError, type Sampled, Storage, StrictNameRegistry, type TextureProps, type TgpuAccessor, type TgpuAnyTextureView, type TgpuBindGroup, type TgpuBindGroupLayout, type TgpuBuffer, type TgpuBufferMutable, type TgpuBufferReadonly, type TgpuBufferUniform, type TgpuComputeFn, type TgpuComputeFnShell, type TgpuComputePipeline, type TgpuConst, type TgpuDeclare, type TgpuDerived, type TgpuFn, type TgpuFnShell, type TgpuFragmentFn, type TgpuFragmentFnShell, type TgpuLayoutComparisonSampler, type TgpuLayoutEntry, type TgpuLayoutExternalTexture, type TgpuLayoutSampler, type TgpuLayoutStorage, type TgpuLayoutStorageTexture, type TgpuLayoutTexture, type TgpuLayoutUniform, type TgpuMutableTexture, type TgpuReadonlyTexture, type TgpuRenderPipeline, type TgpuRoot, type TgpuSampledTexture, type TgpuSampler, type TgpuSlot, type TgpuTexture, type TgpuVar, type TgpuVertexFn, type TgpuVertexFnShell, type TgpuVertexLayout, type TgpuWriteonlyTexture, type Uniform, type VariableScope, type Vertex, type WithBinding, type WithCompute, type WithFragment, type WithVertex, tgpu as default, isBuffer, isComparisonSampler, isDerived, isSampledTextureView, isSampler, isSlot, isStorageTextureView, isTexture, isTgpuFn, isUsableAsRender, isUsableAsSampled, isUsableAsStorage, isUsableAsUniform, isUsableAsVertex, tgpu, asMutable as unstable_asMutable, asReadonly as unstable_asReadonly, asUniform as unstable_asUniform };
|
1516
|
+
export { type BindLayoutEntry, type Eventual, type InitFromDeviceOptions, type InitOptions, type LayoutEntryToInput, MissingBindGroupsError, MissingLinksError, MissingSlotValueError, MissingVertexBuffersError, NotUniformError, RandomNameRegistry, type Render, ResolutionError, type Sampled, type Storage, type StorageFlag, StrictNameRegistry, type TextureProps, type TgpuAccessor, type TgpuAnyTextureView, type TgpuBindGroup, type TgpuBindGroupLayout, type TgpuBuffer, type TgpuBufferMutable, type TgpuBufferReadonly, type TgpuBufferUniform, type TgpuComputeFn, type TgpuComputeFnShell, type TgpuComputePipeline, type TgpuConst, type TgpuDeclare, type TgpuDerived, type TgpuFn, type TgpuFnShell, type TgpuFragmentFn, type TgpuFragmentFnShell, type TgpuLayoutComparisonSampler, type TgpuLayoutEntry, type TgpuLayoutExternalTexture, type TgpuLayoutSampler, type TgpuLayoutStorage, type TgpuLayoutStorageTexture, type TgpuLayoutTexture, type TgpuLayoutUniform, type TgpuMutableTexture, type TgpuReadonlyTexture, type TgpuRenderPipeline, type TgpuRoot, type TgpuSampledTexture, type TgpuSampler, type TgpuSlot, type TgpuTexture, type TgpuVar, type TgpuVertexFn, type TgpuVertexFnShell, type TgpuVertexLayout, type TgpuWriteonlyTexture, type Uniform, type UniformFlag, type VariableScope, type Vertex, type VertexFlag, type WithBinding, type WithCompute, type WithFragment, type WithVertex, tgpu as default, isBuffer, isComparisonSampler, isDerived, isSampledTextureView, isSampler, isSlot, isStorageTextureView, isTexture, isTgpuFn, isUsableAsRender, isUsableAsSampled, isUsableAsStorage, isUsableAsUniform, isUsableAsVertex, tgpu, asMutable as unstable_asMutable, asReadonly as unstable_asReadonly, asUniform as unstable_asUniform };
|