Open
Conversation
|
pkg.pr.new packages benchmark commit |
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:
Dynamic test results:
|
| Test | tsdown |
|---|---|
| Void from typegpudata.ts | 700 B ( |
| sampler from typegpudata.ts | 708 B ( |
| isPtr from typegpudata.ts | 718 B ( |
| comparisonSampler from typegpudata.ts | 719 B ( |
| isSizeAttrib from typegpudata.ts | 720 B ( |
| isWgslArray from typegpudata.ts | 720 B ( |
| isAlignAttrib from typegpudata.ts | 721 B ( |
| isAtomic from typegpudata.ts | 721 B ( |
| isWgslStruct from typegpudata.ts | 721 B ( |
| isBuiltinAttrib from typegpudata.ts | 723 B ( |
| isDecorated from typegpudata.ts | 724 B ( |
| isLocationAttrib from typegpudata.ts | 724 B ( |
| isInterpolateAttrib from typegpudata.ts | 727 B ( |
| isTgpuFn from typegpu.ts | 731 B ( |
| atomic from typegpudata.ts | 739 B ( |
| ptrHandle from typegpudata.ts | 817 B ( |
| ptrUniform from typegpudata.ts | 818 B ( |
| ptrStorage from typegpudata.ts | 822 B ( |
| ptrPrivate from typegpudata.ts | 824 B ( |
| ptrFn from typegpudata.ts | 825 B ( |
| ptrWorkgroup from typegpudata.ts | 826 B ( |
| textureExternal from typegpudata.ts | 839 B ( |
| isUsableAsVertex from typegpu.ts | 84.93 kB ( |
| isBuffer from typegpu.ts | 84.93 kB ( |
| textureStorage1d from typegpudata.ts | 1003 B ( |
| textureStorage2d from typegpudata.ts | 1003 B ( |
| textureStorage3d from typegpudata.ts | 1003 B ( |
| textureStorage2dArray from typegpudata.ts | 1021 B ( |
| NotUniformError from typegpu.ts | 1.27 kB ( |
| isWgslData from typegpudata.ts | 1.28 kB ( |
| MissingBindGroupsError from typegpu.ts | 1.31 kB ( |
| MissingVertexBuffersError from typegpu.ts | 1.32 kB ( |
| ResolutionError from typegpu.ts | 1.51 kB ( |
| isBufferShorthand from typegpu.ts | 1.73 kB ( |
| unstruct from typegpudata.ts | 1.61 kB ( |
| isDisarray from typegpudata.ts | 1.66 kB ( |
| isUnstruct from typegpudata.ts | 1.66 kB ( |
| isLooseDecorated from typegpudata.ts | 1.67 kB ( |
| isLooseData from typegpudata.ts | 1.70 kB ( |
| ShaderGenerator from typegpu.ts | 1.80 kB ( |
| isData from typegpudata.ts | 2.35 kB ( |
| deepEqual from typegpudata.ts | 2.74 kB ( |
| struct from typegpudata.ts | 3.34 kB ( |
| ref from typegpudata.ts | 4.12 kB ( |
| tgpu from typegpu.ts | 246.17 kB ( |
| tgpu.fn from typegpu.ts | 246.17 kB ( |
| tgpu.init from typegpu.ts | 246.17 kB ( |
| tgpu.lazy from typegpu.ts | 246.17 kB ( |
| tgpu.slot from typegpu.ts | 246.17 kB ( |
| tgpu.const from typegpu.ts | 246.17 kB ( |
| tgpu.unroll from typegpu.ts | 246.17 kB ( |
| tgpu.resolve from typegpu.ts | 246.18 kB ( |
| tgpu.accessor from typegpu.ts | 246.18 kB ( |
| tgpu.comptime from typegpu.ts | 246.18 kB ( |
| tgpu.vertexFn from typegpu.ts | 246.18 kB ( |
| tgpu.computeFn from typegpu.ts | 246.18 kB ( |
| tgpu.fragmentFn from typegpu.ts | 246.18 kB ( |
| tgpu.privateVar from typegpu.ts | 246.18 kB ( |
| tgpu.vertexLayout from typegpu.ts | 246.18 kB ( |
| tgpu.workgroupVar from typegpu.ts | 246.18 kB ( |
| tgpu.initFromDevice from typegpu.ts | 246.18 kB ( |
| tgpu.bindGroupLayout from typegpu.ts | 246.18 kB ( |
| tgpu.mutableAccessor from typegpu.ts | 246.18 kB ( |
| tgpu.resolveWithContext from typegpu.ts | 246.19 kB ( |
📋 All results
Click to reveal the results table (348 entries).
| Test | tsdown |
|---|---|
| Void from typegpudata.ts | 700 B ( |
| sampler from typegpudata.ts | 708 B ( |
| isPtr from typegpudata.ts | 718 B ( |
| comparisonSampler from typegpudata.ts | 719 B ( |
| isSizeAttrib from typegpudata.ts | 720 B ( |
| isWgslArray from typegpudata.ts | 720 B ( |
| isAlignAttrib from typegpudata.ts | 721 B ( |
| isAtomic from typegpudata.ts | 721 B ( |
| isWgslStruct from typegpudata.ts | 721 B ( |
| isBuiltinAttrib from typegpudata.ts | 723 B ( |
| isDecorated from typegpudata.ts | 724 B ( |
| isLocationAttrib from typegpudata.ts | 724 B ( |
| isInterpolateAttrib from typegpudata.ts | 727 B ( |
| isTgpuFn from typegpu.ts | 731 B ( |
| atomic from typegpudata.ts | 739 B ( |
| ptrHandle from typegpudata.ts | 817 B ( |
| ptrUniform from typegpudata.ts | 818 B ( |
| ptrStorage from typegpudata.ts | 822 B ( |
| ptrPrivate from typegpudata.ts | 824 B ( |
| ptrFn from typegpudata.ts | 825 B ( |
| ptrWorkgroup from typegpudata.ts | 826 B ( |
| textureExternal from typegpudata.ts | 839 B ( |
| isUsableAsVertex from typegpu.ts | 84.93 kB ( |
| isBuffer from typegpu.ts | 84.93 kB ( |
| textureStorage1d from typegpudata.ts | 1003 B ( |
| textureStorage2d from typegpudata.ts | 1003 B ( |
| textureStorage3d from typegpudata.ts | 1003 B ( |
| textureStorage2dArray from typegpudata.ts | 1021 B ( |
| NotUniformError from typegpu.ts | 1.27 kB ( |
| isWgslData from typegpudata.ts | 1.28 kB ( |
| MissingBindGroupsError from typegpu.ts | 1.31 kB ( |
| MissingVertexBuffersError from typegpu.ts | 1.32 kB ( |
| ResolutionError from typegpu.ts | 1.51 kB ( |
| isBufferShorthand from typegpu.ts | 1.73 kB ( |
| unstruct from typegpudata.ts | 1.61 kB ( |
| isDisarray from typegpudata.ts | 1.66 kB ( |
| isUnstruct from typegpudata.ts | 1.66 kB ( |
| isLooseDecorated from typegpudata.ts | 1.67 kB ( |
| isLooseData from typegpudata.ts | 1.70 kB ( |
| ShaderGenerator from typegpu.ts | 1.80 kB ( |
| isData from typegpudata.ts | 2.35 kB ( |
| deepEqual from typegpudata.ts | 2.74 kB ( |
| struct from typegpudata.ts | 3.34 kB ( |
| ref from typegpudata.ts | 4.12 kB ( |
| tgpuImportEverything.ts | 246.17 kB ( |
| tgpu from typegpu.ts | 246.17 kB ( |
| tgpu.fn from typegpu.ts | 246.17 kB ( |
| tgpu.init from typegpu.ts | 246.17 kB ( |
| tgpu.lazy from typegpu.ts | 246.17 kB ( |
| tgpu.slot from typegpu.ts | 246.17 kB ( |
| tgpu.const from typegpu.ts | 246.17 kB ( |
| tgpu.unroll from typegpu.ts | 246.17 kB ( |
| tgpu.resolve from typegpu.ts | 246.18 kB ( |
| tgpu.accessor from typegpu.ts | 246.18 kB ( |
| tgpu.comptime from typegpu.ts | 246.18 kB ( |
| tgpu.vertexFn from typegpu.ts | 246.18 kB ( |
| tgpu.computeFn from typegpu.ts | 246.18 kB ( |
| tgpu.fragmentFn from typegpu.ts | 246.18 kB ( |
| tgpu.privateVar from typegpu.ts | 246.18 kB ( |
| tgpuImportOne.ts | 246.18 kB ( |
| tgpu.vertexLayout from typegpu.ts | 246.18 kB ( |
| tgpu.workgroupVar from typegpu.ts | 246.18 kB ( |
| tgpu.initFromDevice from typegpu.ts | 246.18 kB ( |
| tgpu.bindGroupLayout from typegpu.ts | 246.18 kB ( |
| tgpu.mutableAccessor from typegpu.ts | 246.18 kB ( |
| tgpu.resolveWithContext from typegpu.ts | 246.19 kB ( |
| importEntireLibrary.ts | 273.00 kB ( |
| memoryLayoutOf from typegpudata.ts | 39.56 kB ( |
| bool from typegpudata.ts | 10.57 kB ( |
| f16 from typegpudata.ts | 10.57 kB ( |
| f32 from typegpudata.ts | 10.57 kB ( |
| i32 from typegpudata.ts | 10.57 kB ( |
| u32 from typegpudata.ts | 10.57 kB ( |
| u16 from typegpudata.ts | 10.59 kB ( |
| textureDepth2d from typegpudata.ts | 11.01 kB ( |
| textureDepthCube from typegpudata.ts | 11.02 kB ( |
| texture1d from typegpudata.ts | 11.03 kB ( |
| texture2d from typegpudata.ts | 11.03 kB ( |
| texture3d from typegpudata.ts | 11.03 kB ( |
| textureCube from typegpudata.ts | 11.03 kB ( |
| textureDepth2dArray from typegpudata.ts | 11.03 kB ( |
| textureDepthCubeArray from typegpudata.ts | 11.04 kB ( |
| textureDepthMultisampled2d from typegpudata.ts | 11.04 kB ( |
| texture2dArray from typegpudata.ts | 11.04 kB ( |
| textureCubeArray from typegpudata.ts | 11.05 kB ( |
| textureMultisampled2d from typegpudata.ts | 11.05 kB ( |
| discard from typegpustd.ts | 11.78 kB ( |
| arrayLength from typegpustd.ts | 12.01 kB ( |
| extensionEnabled from typegpustd.ts | 12.09 kB ( |
| disarrayOf from typegpudata.ts | 12.53 kB ( |
| dpdx from typegpustd.ts | 12.62 kB ( |
| dpdxCoarse from typegpustd.ts | 12.63 kB ( |
| dpdxFine from typegpustd.ts | 12.63 kB ( |
| dpdyCoarse from typegpustd.ts | 12.63 kB ( |
| dpdyFine from typegpustd.ts | 12.63 kB ( |
| dpdy from typegpustd.ts | 12.63 kB ( |
| fwidthCoarse from typegpustd.ts | 12.63 kB ( |
| fwidthFine from typegpustd.ts | 12.63 kB ( |
| fwidth from typegpustd.ts | 12.63 kB ( |
| atomicLoad from typegpustd.ts | 13.38 kB ( |
| atomicStore from typegpustd.ts | 13.38 kB ( |
| textureBarrier from typegpustd.ts | 13.38 kB ( |
| atomicAdd from typegpustd.ts | 13.39 kB ( |
| atomicAnd from typegpustd.ts | 13.39 kB ( |
| atomicMax from typegpustd.ts | 13.39 kB ( |
| atomicMin from typegpustd.ts | 13.39 kB ( |
| atomicOr from typegpustd.ts | 13.39 kB ( |
| atomicSub from typegpustd.ts | 13.39 kB ( |
| atomicXor from typegpustd.ts | 13.39 kB ( |
| storageBarrier from typegpustd.ts | 13.39 kB ( |
| workgroupBarrier from typegpustd.ts | 13.39 kB ( |
| vec2b from typegpudata.ts | 16.96 kB ( |
| vec2f from typegpudata.ts | 16.96 kB ( |
| vec2h from typegpudata.ts | 16.96 kB ( |
| vec2i from typegpudata.ts | 16.96 kB ( |
| vec2u from typegpudata.ts | 16.96 kB ( |
| vec3b from typegpudata.ts | 16.96 kB ( |
| vec3f from typegpudata.ts | 16.96 kB ( |
| vec3h from typegpudata.ts | 16.96 kB ( |
| vec3i from typegpudata.ts | 16.96 kB ( |
| vec3u from typegpudata.ts | 16.96 kB ( |
| vec4b from typegpudata.ts | 16.96 kB ( |
| vec4f from typegpudata.ts | 16.96 kB ( |
| vec4h from typegpudata.ts | 16.96 kB ( |
| vec4i from typegpudata.ts | 16.96 kB ( |
| vec4u from typegpudata.ts | 16.96 kB ( |
| formatToWGSLType from typegpudata.ts | 18.44 kB ( |
| uint8 from typegpudata.ts | 18.44 kB ( |
| float16 from typegpudata.ts | 18.45 kB ( |
| float16x2 from typegpudata.ts | 18.45 kB ( |
| float16x4 from typegpudata.ts | 18.45 kB ( |
| float32 from typegpudata.ts | 18.45 kB ( |
| float32x2 from typegpudata.ts | 18.45 kB ( |
| float32x3 from typegpudata.ts | 18.45 kB ( |
| float32x4 from typegpudata.ts | 18.45 kB ( |
| sint16 from typegpudata.ts | 18.45 kB ( |
| sint16x2 from typegpudata.ts | 18.45 kB ( |
| sint16x4 from typegpudata.ts | 18.45 kB ( |
| sint32 from typegpudata.ts | 18.45 kB ( |
| sint32x2 from typegpudata.ts | 18.45 kB ( |
| sint32x3 from typegpudata.ts | 18.45 kB ( |
| sint32x4 from typegpudata.ts | 18.45 kB ( |
| sint8 from typegpudata.ts | 18.45 kB ( |
| sint8x2 from typegpudata.ts | 18.45 kB ( |
| sint8x4 from typegpudata.ts | 18.45 kB ( |
| snorm16 from typegpudata.ts | 18.45 kB ( |
| snorm16x2 from typegpudata.ts | 18.45 kB ( |
| snorm16x4 from typegpudata.ts | 18.45 kB ( |
| snorm8 from typegpudata.ts | 18.45 kB ( |
| snorm8x2 from typegpudata.ts | 18.45 kB ( |
| snorm8x4 from typegpudata.ts | 18.45 kB ( |
| uint16 from typegpudata.ts | 18.45 kB ( |
| uint16x2 from typegpudata.ts | 18.45 kB ( |
| uint16x4 from typegpudata.ts | 18.45 kB ( |
| uint32 from typegpudata.ts | 18.45 kB ( |
| uint32x2 from typegpudata.ts | 18.45 kB ( |
| uint32x3 from typegpudata.ts | 18.45 kB ( |
| uint32x4 from typegpudata.ts | 18.45 kB ( |
| uint8x2 from typegpudata.ts | 18.45 kB ( |
| uint8x4 from typegpudata.ts | 18.45 kB ( |
| unorm10 10 10 2 from typegpudata.ts | 18.45 kB ( |
| unorm16 from typegpudata.ts | 18.45 kB ( |
| unorm16x2 from typegpudata.ts | 18.45 kB ( |
| unorm16x4 from typegpudata.ts | 18.45 kB ( |
| unorm8 from typegpudata.ts | 18.45 kB ( |
| unorm8x2 from typegpudata.ts | 18.45 kB ( |
| unorm8x4 bgra from typegpudata.ts | 18.45 kB ( |
| unorm8x4 from typegpudata.ts | 18.45 kB ( |
| packedFormats from typegpudata.ts | 18.47 kB ( |
| isPackedData from typegpudata.ts | 18.51 kB ( |
| alignmentOf from typegpudata.ts | 19.49 kB ( |
| d from typegpu.ts | 84.39 kB ( |
| subgroupAdd from typegpustd.ts | 21.52 kB ( |
| subgroupAll from typegpustd.ts | 21.53 kB ( |
| subgroupAnd from typegpustd.ts | 21.53 kB ( |
| subgroupAny from typegpustd.ts | 21.53 kB ( |
| subgroupBallot from typegpustd.ts | 21.53 kB ( |
| subgroupBroadcastFirst from typegpustd.ts | 21.53 kB ( |
| subgroupBroadcast from typegpustd.ts | 21.53 kB ( |
| subgroupElect from typegpustd.ts | 21.53 kB ( |
| subgroupExclusiveAdd from typegpustd.ts | 21.53 kB ( |
| subgroupExclusiveMul from typegpustd.ts | 21.53 kB ( |
| subgroupInclusiveAdd from typegpustd.ts | 21.53 kB ( |
| subgroupInclusiveMul from typegpustd.ts | 21.53 kB ( |
| subgroupMax from typegpustd.ts | 21.53 kB ( |
| subgroupMin from typegpustd.ts | 21.53 kB ( |
| subgroupMul from typegpustd.ts | 21.53 kB ( |
| subgroupOr from typegpustd.ts | 21.53 kB ( |
| subgroupShuffleDown from typegpustd.ts | 21.53 kB ( |
| subgroupShuffleUp from typegpustd.ts | 21.53 kB ( |
| subgroupShuffleXor from typegpustd.ts | 21.53 kB ( |
| subgroupShuffle from typegpustd.ts | 21.53 kB ( |
| subgroupXor from typegpustd.ts | 21.53 kB ( |
| dataImportEverything.ts | 86.70 kB ( |
| isBuiltin from typegpudata.ts | 22.21 kB ( |
| dataImportOneDirect.ts | 22.26 kB ( |
| dataImportOneStar.ts | 22.26 kB ( |
| sizeOf from typegpudata.ts | 22.26 kB ( |
| isContiguous from typegpudata.ts | 22.27 kB ( |
| getLongestContiguousPrefix from typegpudata.ts | 22.28 kB ( |
| textureDimensions from typegpustd.ts | 23.01 kB ( |
| textureGather from typegpustd.ts | 23.01 kB ( |
| textureLoad from typegpustd.ts | 23.01 kB ( |
| textureSampleBaseClampToEdge from typegpustd.ts | 23.01 kB ( |
| textureSampleBias from typegpustd.ts | 23.01 kB ( |
| textureSampleCompareLevel from typegpustd.ts | 23.01 kB ( |
| textureSampleCompare from typegpustd.ts | 23.01 kB ( |
| textureSampleLevel from typegpustd.ts | 23.01 kB ( |
| textureSample from typegpustd.ts | 23.01 kB ( |
| textureStore from typegpustd.ts | 23.01 kB ( |
| arrayOf from typegpudata.ts | 23.75 kB ( |
| size from typegpudata.ts | 23.94 kB ( |
| align from typegpudata.ts | 23.94 kB ( |
| location from typegpudata.ts | 23.94 kB ( |
| interpolate from typegpudata.ts | 23.94 kB ( |
| invariant from typegpudata.ts | 24.31 kB ( |
| mat4x4f from typegpudata.ts | 24.48 kB ( |
| identity2 from typegpustd.ts | 24.48 kB ( |
| identity3 from typegpustd.ts | 24.48 kB ( |
| identity4 from typegpustd.ts | 24.48 kB ( |
| mat2x2f from typegpudata.ts | 24.48 kB ( |
| mat3x3f from typegpudata.ts | 24.48 kB ( |
| rotationX4 from typegpustd.ts | 24.48 kB ( |
| rotationY4 from typegpustd.ts | 24.48 kB ( |
| rotationZ4 from typegpustd.ts | 24.48 kB ( |
| scaling4 from typegpustd.ts | 24.48 kB ( |
| translation4 from typegpustd.ts | 24.48 kB ( |
| matToArray from typegpudata.ts | 24.61 kB ( |
| builtin from typegpudata.ts | 26.11 kB ( |
| pack2x16float from typegpustd.ts | 33.47 kB ( |
| pack4x8unorm from typegpustd.ts | 33.47 kB ( |
| unpack2x16float from typegpustd.ts | 33.47 kB ( |
| unpack4x8unorm from typegpustd.ts | 33.47 kB ( |
| common from typegpu.ts | 36.15 kB ( |
| bitcastU32toF32 from typegpustd.ts | 41.67 kB ( |
| bitcastU32toI32 from typegpustd.ts | 41.68 kB ( |
| neg from typegpustd.ts | 45.84 kB ( |
| add from typegpustd.ts | 45.85 kB ( |
| bitShiftLeft from typegpustd.ts | 45.85 kB ( |
| bitShiftRight from typegpustd.ts | 45.85 kB ( |
| div from typegpustd.ts | 45.85 kB ( |
| mod from typegpustd.ts | 45.85 kB ( |
| mul from typegpustd.ts | 45.85 kB ( |
| sub from typegpustd.ts | 45.85 kB ( |
| stdImportOneDirect.ts | 45.85 kB ( |
| stdImportOneStar.ts | 45.85 kB ( |
| rotateX4 from typegpustd.ts | 46.61 kB ( |
| scale4 from typegpustd.ts | 46.61 kB ( |
| translate4 from typegpustd.ts | 46.61 kB ( |
| rotateY4 from typegpustd.ts | 46.61 kB ( |
| rotateZ4 from typegpustd.ts | 46.61 kB ( |
| and from typegpustd.ts | 48.37 kB ( |
| not from typegpustd.ts | 48.37 kB ( |
| or from typegpustd.ts | 48.37 kB ( |
| allEq from typegpustd.ts | 48.37 kB ( |
| all from typegpustd.ts | 48.37 kB ( |
| eq from typegpustd.ts | 48.37 kB ( |
| ge from typegpustd.ts | 48.37 kB ( |
| lt from typegpustd.ts | 48.37 kB ( |
| ne from typegpustd.ts | 48.37 kB ( |
| any from typegpustd.ts | 48.38 kB ( |
| gt from typegpustd.ts | 48.38 kB ( |
| isCloseTo from typegpustd.ts | 48.38 kB ( |
| le from typegpustd.ts | 48.38 kB ( |
| select from typegpustd.ts | 48.38 kB ( |
| isUsableAsUniform from typegpu.ts | 59.64 kB ( |
| isTexture from typegpu.ts | 59.65 kB ( |
| isSampler from typegpu.ts | 59.66 kB ( |
| isComparisonSampler from typegpu.ts | 59.67 kB ( |
| isVariable from typegpu.ts | 61.44 kB ( |
| dot from typegpustd.ts | 63.15 kB ( |
| length from typegpustd.ts | 63.15 kB ( |
| distance from typegpustd.ts | 63.15 kB ( |
| dot4U8Packed from typegpustd.ts | 63.15 kB ( |
| fract from typegpustd.ts | 63.15 kB ( |
| frexp from typegpustd.ts | 63.15 kB ( |
| mix from typegpustd.ts | 63.15 kB ( |
| modf from typegpustd.ts | 63.15 kB ( |
| abs from typegpustd.ts | 63.16 kB ( |
| acos from typegpustd.ts | 63.16 kB ( |
| acosh from typegpustd.ts | 63.16 kB ( |
| asin from typegpustd.ts | 63.16 kB ( |
| asinh from typegpustd.ts | 63.16 kB ( |
| atan2 from typegpustd.ts | 63.16 kB ( |
| atan from typegpustd.ts | 63.16 kB ( |
| atanh from typegpustd.ts | 63.16 kB ( |
| ceil from typegpustd.ts | 63.16 kB ( |
| clamp from typegpustd.ts | 63.16 kB ( |
| cos from typegpustd.ts | 63.16 kB ( |
| cosh from typegpustd.ts | 63.16 kB ( |
| countLeadingZeros from typegpustd.ts | 63.16 kB ( |
| countOneBits from typegpustd.ts | 63.16 kB ( |
| countTrailingZeros from typegpustd.ts | 63.16 kB ( |
| cross from typegpustd.ts | 63.16 kB ( |
| degrees from typegpustd.ts | 63.16 kB ( |
| determinant from typegpustd.ts | 63.16 kB ( |
| dot4I8Packed from typegpustd.ts | 63.16 kB ( |
| exp2 from typegpustd.ts | 63.16 kB ( |
| exp from typegpustd.ts | 63.16 kB ( |
| extractBits from typegpustd.ts | 63.16 kB ( |
| faceForward from typegpustd.ts | 63.16 kB ( |
| firstLeadingBit from typegpustd.ts | 63.16 kB ( |
| firstTrailingBit from typegpustd.ts | 63.16 kB ( |
| floor from typegpustd.ts | 63.16 kB ( |
| fma from typegpustd.ts | 63.16 kB ( |
| insertBits from typegpustd.ts | 63.16 kB ( |
| inverseSqrt from typegpustd.ts | 63.16 kB ( |
| ldexp from typegpustd.ts | 63.16 kB ( |
| log2 from typegpustd.ts | 63.16 kB ( |
| log from typegpustd.ts | 63.16 kB ( |
| max from typegpustd.ts | 63.16 kB ( |
| min from typegpustd.ts | 63.16 kB ( |
| normalize from typegpustd.ts | 63.16 kB ( |
| pow from typegpustd.ts | 63.16 kB ( |
| quantizeToF16 from typegpustd.ts | 63.16 kB ( |
| radians from typegpustd.ts | 63.16 kB ( |
| reflect from typegpustd.ts | 63.16 kB ( |
| refract from typegpustd.ts | 63.16 kB ( |
| reverseBits from typegpustd.ts | 63.16 kB ( |
| round from typegpustd.ts | 63.16 kB ( |
| saturate from typegpustd.ts | 63.16 kB ( |
| sign from typegpustd.ts | 63.16 kB ( |
| sin from typegpustd.ts | 63.16 kB ( |
| sinh from typegpustd.ts | 63.16 kB ( |
| smoothstep from typegpustd.ts | 63.16 kB ( |
| sqrt from typegpustd.ts | 63.16 kB ( |
| step from typegpustd.ts | 63.16 kB ( |
| tan from typegpustd.ts | 63.16 kB ( |
| tanh from typegpustd.ts | 63.16 kB ( |
| transpose from typegpustd.ts | 63.16 kB ( |
| trunc from typegpustd.ts | 63.16 kB ( |
| std from typegpu.ts | 98.13 kB ( |
| WgslGenerator from typegpu.ts | 98.93 kB ( |
| stdImportEverything.ts | 100.84 kB ( |
| functionWithUseGpu.ts | 282 B (➖) |
| functionWithoutUseGpu.ts | 24 B (➖) |
| MissingLinksError from typegpu.ts | 201 B (➖) |
| MissingSlotValueError from typegpu.ts | 146 B (➖) |
| isAccessor from typegpu.ts | 65 B (➖) |
| isLazy from typegpu.ts | 61 B (➖) |
| isMutableAccessor from typegpu.ts | 73 B (➖) |
| isSlot from typegpu.ts | 61 B (➖) |
| isTgpuComputeFn from typegpu.ts | 69 B (➖) |
| isTgpuFragmentFn from typegpu.ts | 70 B (➖) |
| isTgpuVertexFn from typegpu.ts | 68 B (➖) |
| isUsableAsRender from typegpu.ts | 55 B (➖) |
| isUsableAsSampled from typegpu.ts | 56 B (➖) |
| isUsableAsStorage from typegpu.ts | 56 B (➖) |
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.
3941b59 to
a75db15
Compare
Introduce InferInput and $inRepr to accept plain arrays and TypedArrays for vector/array write-side representations. Add BufferWriteOptions (startOffset/endOffset) and improve memoryLayoutOf accessor errors. Update compiled/data writers to index into array-like vector inputs and adjust tests and docs accordingly
Add runtime validation for write offsets in TgpuBuffer.write: startOffset must be a non-negative integer; endOffset must be >= startOffset and <= buffer size. Forward BufferWriteOptions through the buffer shorthand write API and add unit tests for the new checks. Clarify docs about TypeGPU wrapper allocation and byte-based endOffset behavior (partial-element writes).
Use actual primitive/component size when generating compiled writers instead of assuming 4-byte components. Add a runtime guard in the buffer implementation to reject flat TypedArray inputs for arrays of vectors when the compiled writer is unavailable (e.g. no-eval environments), and add tests covering float16 vec writers and array stride/offset behavior.
7aea73d to
e51409a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
350
to
+367
| const gpuBuffer = this.buffer; | ||
| const bufferSize = sizeOf(this.dataType); | ||
| const startOffset = options?.startOffset ?? 0; | ||
| const endOffset = options?.endOffset ?? bufferSize; | ||
| const size = endOffset - startOffset; | ||
|
|
||
| if (gpuBuffer.mapState === 'mapped') { | ||
| const mapped = gpuBuffer.getMappedRange(); | ||
| this._writeToTarget(mapped, data); | ||
| this._writeToTarget(mapped, data, options); | ||
| return; | ||
| } | ||
|
|
||
| const size = sizeOf(this.dataType); | ||
| if (!this._hostBuffer) { | ||
| this._hostBuffer = new ArrayBuffer(size); | ||
| this._hostBuffer = new ArrayBuffer(sizeOf(this.dataType)); | ||
| } | ||
|
|
||
| this._writeToTarget(this._hostBuffer, data); | ||
| this.#device.queue.writeBuffer(gpuBuffer, 0, this._hostBuffer, 0, size); | ||
| this._writeToTarget(this._hostBuffer, data, options); | ||
| this.#device.queue.writeBuffer(gpuBuffer, startOffset, this._hostBuffer, startOffset, size); |
| ? Int32Array | ||
| : T extends Vec2u | Vec3u | Vec4u | U32 | ||
| ? Uint32Array | ||
| : never; |
| Combined with `startOffset` and `d.memoryLayoutOf`, this lets you write to a precise region of the buffer. | ||
|
|
||
| :::note | ||
| Both offsets are **byte-based**. Any component whose byte position falls at or beyond `endOffset` is not written, which means offsets that do not align to schema element boundaries can result in partial elements being written. Use `d.memoryLayoutOf` to target whole elements safely. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce InferInput and
$inReprto accept plain arrays andTypedArraysfor vector/array write-side representations. AddBufferWriteOptions(startOffset/endOffset) and improvememoryLayoutOfaccessor errors. Update compiled/data writers to index into array-like vector inputs and adjust tests and docs accordingly