Skip to content

Commit 1fce934

Browse files
author
Mike Solomon
committed
Adds arity annotations
1 parent 820f11f commit 1fce934

63 files changed

Lines changed: 449 additions & 53 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

spago.dhall

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ to generate this file without the comments in this block.
2121
, "newtype"
2222
, "ordered-collections"
2323
, "prelude"
24-
, "record"
2524
, "unsafe-coerce"
2625
, "web-events"
2726
, "web-html"

src/Web/GPU/BufferSource.purs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
-- @inline export fromArrayBuffer arity=1
2+
-- @inline export fromInt8Array arity=1
3+
-- @inline export fromInt16Array arity=1
4+
-- @inline export fromInt32Array arity=1
5+
-- @inline export fromUint8Array arity=1
6+
-- @inline export fromUint16Array arity=1
7+
-- @inline export fromUint32Array arity=1
8+
-- @inline export fromUint8ClampedArray arity=1
9+
-- @inline export fromFloat32Array arity=1
10+
-- @inline export fromFloat64Array arity=1
11+
-- @inline export fromDataView arity=1
112
module Web.GPU.BufferSource where
213

314
import Data.ArrayBuffer.Types (ArrayBuffer, DataView, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray)
@@ -42,4 +53,4 @@ fromFloat64Array :: Float64Array -> BufferSource
4253
fromFloat64Array = unsafeCoerce
4354

4455
fromDataView :: DataView -> BufferSource
45-
fromDataView = unsafeCoerce
56+
fromDataView = unsafeCoerce

src/Web/GPU/GPU.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export const requestAdapterImpl =
33
gpu.requestAdapter(options).then((o) => (o ? just(o) : nothing));
44

55
export const getPreferredCanvasFormatImpl = (gpu) => () =>
6-
gpu.getPreferredCanvasFormat();
6+
gpu.getPreferredCanvasFormat();

src/Web/GPU/GPU.purs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
-- @inline export requestAdapterImpl arity=1
2+
-- @inline export requestAdapter arity=1
3+
-- @inline export getPreferredCanvasFormatImpl arity=1
4+
-- @inline export getPreferredCanvasFormat arity=1
15
module Web.GPU.GPU
26
( requestAdapter
37
, getPreferredCanvasFormat
@@ -30,4 +34,4 @@ requestAdapter = requestAdapterImpl Just Nothing
3034
foreign import getPreferredCanvasFormatImpl :: GPU -> Effect GPUTextureFormat
3135

3236
getPreferredCanvasFormat :: GPU -> Effect GPUTextureFormat
33-
getPreferredCanvasFormat = getPreferredCanvasFormatImpl
37+
getPreferredCanvasFormat = getPreferredCanvasFormatImpl

src/Web/GPU/GPUAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ export const requestDeviceImpl =
1313
(just) => (nothing) => (adapter) => (options) => () =>
1414
adapter.requestDevice(options).then((o) => (o ? just(o) : nothing));
1515
export const requestAdapterInfoImpl = (adapter) => (unmaskHints) => () =>
16-
adapter.requestAdapterInfo(unmaskHints);
16+
adapter.requestAdapterInfo(unmaskHints);

src/Web/GPU/GPUAdapter.purs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
-- @inline export featuresImpl arity=2
2+
-- @inline export features arity=2
3+
-- @inline export limitsImpl arity=1
4+
-- @inline export limits arity=1
5+
-- @inline export isFallbackAdapterImpl arity=1
6+
-- @inline export isFallbackAdapter arity=1
7+
-- @inline export requestDeviceImpl arity=1
8+
-- @inline export requestDevice arity=1
9+
-- @inline export requestAdapterInfoImpl arity=2
10+
-- @inline export requestAdapterInfo arity=2
111
module Web.GPU.GPUAdapter
212
( GPUAdapterInfo
313
, features
@@ -66,4 +76,4 @@ type GPUAdapterInfo =
6676

6777
requestAdapterInfo
6878
:: GPUAdapter -> Array UnmaskHint -> Effect (Promise GPUAdapterInfo)
69-
requestAdapterInfo = requestAdapterInfoImpl
79+
requestAdapterInfo = requestAdapterInfoImpl

src/Web/GPU/GPUBindGroupLayoutEntry.purs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
-- @inline export gpuBufferBindingLayout arity=3
2+
-- @inline export gpuSamplerBindingLayout arity=3
3+
-- @inline export gpuTextureBindingLayout arity=3
4+
-- @inline export gpuStorageTextureBindingLayout arity=3
5+
-- @inline export gpuExternalTextureBindingLayout arity=3
16
module Web.GPU.GPUBindGroupLayoutEntry where
27

38
import Unsafe.Coerce (unsafeCoerce)
@@ -47,4 +52,4 @@ gpuExternalTextureBindingLayout
4752
-> GPUExternalTextureBindingLayout
4853
-> GPUBindGroupLayoutEntry
4954
gpuExternalTextureBindingLayout binding visibility externalTexture =
50-
unsafeCoerce { binding, visibility, externalTexture }
55+
unsafeCoerce { binding, visibility, externalTexture }

src/Web/GPU/GPUBuffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ export const getMappedRangeWithOffsetAndSizeImpl =
1818
(buffer) => (offset) => (size) => () =>
1919
buffer.getMappedRange(offset, size);
2020
export const unmapImpl = (buffer) => () => buffer.unmap();
21-
export const destroyImpl = (buffer) => () => buffer.destroy();
21+
export const destroyImpl = (buffer) => () => buffer.destroy();

src/Web/GPU/GPUBuffer.purs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
-- @inline export sizeImpl arity=1
2+
-- @inline export size arity=1
3+
-- @inline export usageImpl arity=1
4+
-- @inline export usage arity=1
5+
-- @inline export mapStateImpl arity=1
6+
-- @inline export mapState arity=1
7+
-- @inline export mapAsyncImpl arity=2
8+
-- @inline export mapAsync arity=2
9+
-- @inline export mapAsyncWithOffsetImpl arity=3
10+
-- @inline export mapAsyncWithOffset arity=3
11+
-- @inline export mapAsyncWithSizeImpl arity=3
12+
-- @inline export mapAsyncWithSize arity=3
13+
-- @inline export mapAsyncWithOffsetAndSizeImpl arity=4
14+
-- @inline export mapAsyncWithOffsetAndSize arity=4
15+
-- @inline export getMappedRangeImpl arity=1
16+
-- @inline export getMappedRange arity=1
17+
-- @inline export getMappedRangeWithOffsetImpl arity=2
18+
-- @inline export getMappedRangeWithOffset arity=2
19+
-- @inline export getMappedRangeWithSizeImpl arity=2
20+
-- @inline export getMappedRangeWithSize arity=2
21+
-- @inline export getMappedRangeWithOffsetAndSizeImpl arity=3
22+
-- @inline export getMappedRangeWithOffsetAndSize arity=3
23+
-- @inline export unmapImpl arity=1
24+
-- @inline export unmap arity=1
25+
-- @inline export destroyImpl arity=1
26+
-- @inline export destroy arity=1
127
module Web.GPU.GPUBuffer where
228

329
import Prelude

src/Web/GPU/GPUBufferUsage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ export const indirect = window.GPUBufferUsage
2727
: 0x0000;
2828
export const queryResolve = window.GPUBufferUsage
2929
? window.GPUBufferUsage.QUERY_RESOLVE
30-
: 0x0000;
30+
: 0x0000;

0 commit comments

Comments
 (0)