@@ -26,10 +26,10 @@ module Web.GPU.GPUBuffer
26
26
, size
27
27
, unmap
28
28
, usage
29
- )
30
- where
29
+ ) where
31
30
32
31
import Prelude
32
+ import Effect.Uncurried (EffectFn1 , runEffectFn1 ,EffectFn2 , runEffectFn2 ,EffectFn3 , runEffectFn3 ,EffectFn4 , runEffectFn4 )
33
33
34
34
import Data.ArrayBuffer.Types (ArrayBuffer )
35
35
import Effect (Effect )
@@ -40,77 +40,59 @@ import Web.GPU.Internal.Types (GPUSize64)
40
40
import Web.Promise (Promise )
41
41
42
42
data GPUBuffer
43
- foreign import sizeImpl :: GPUBuffer -> Effect GPUSize64
44
43
44
+ foreign import sizeImpl :: EffectFn1 GPUBuffer GPUSize64
45
45
size :: GPUBuffer -> Effect GPUSize64
46
- size = sizeImpl
47
-
48
- foreign import usageImpl :: GPUBuffer -> Effect GPUBufferUsage
46
+ size a = runEffectFn1 sizeImpl a
49
47
48
+ foreign import usageImpl :: EffectFn1 GPUBuffer GPUBufferUsage
50
49
usage :: GPUBuffer -> Effect GPUBufferUsage
51
- usage = usageImpl
52
-
53
- foreign import mapStateImpl :: GPUBuffer -> Effect GPUBufferMapState
50
+ usage a = runEffectFn1 usageImpl a
54
51
52
+ foreign import mapStateImpl :: EffectFn1 GPUBuffer GPUBufferMapState
55
53
mapState :: GPUBuffer -> Effect GPUBufferMapState
56
- mapState = mapStateImpl
57
-
58
- foreign import mapAsyncImpl :: GPUBuffer -> GPUMapMode -> Effect (Promise Unit )
54
+ mapState a = runEffectFn1 mapStateImpl a
59
55
56
+ foreign import mapAsyncImpl :: EffectFn2 GPUBuffer GPUMapMode (Promise Unit )
60
57
mapAsync :: GPUBuffer -> GPUMapMode -> Effect (Promise Unit )
61
- mapAsync = mapAsyncImpl
62
-
63
- foreign import mapAsyncWithOffsetImpl
64
- :: GPUBuffer -> GPUMapMode -> GPUSize64 -> Effect (Promise Unit )
58
+ mapAsync a b = runEffectFn2 mapAsyncImpl a b
65
59
60
+ foreign import mapAsyncWithOffsetImpl :: EffectFn3 GPUBuffer GPUMapMode GPUSize64 (Promise Unit )
66
61
mapAsyncWithOffset
67
62
:: GPUBuffer -> GPUMapMode -> GPUSize64 -> Effect (Promise Unit )
68
- mapAsyncWithOffset = mapAsyncWithOffsetImpl
69
-
70
- foreign import mapAsyncWithSizeImpl
71
- :: GPUBuffer -> GPUMapMode -> GPUSize64 -> Effect (Promise Unit )
63
+ mapAsyncWithOffset a b c = runEffectFn3 mapAsyncWithOffsetImpl a b c
72
64
65
+ foreign import mapAsyncWithSizeImpl :: EffectFn3 GPUBuffer GPUMapMode GPUSize64 (Promise Unit )
73
66
mapAsyncWithSize
74
67
:: GPUBuffer -> GPUMapMode -> GPUSize64 -> Effect (Promise Unit )
75
- mapAsyncWithSize = mapAsyncWithSizeImpl
76
-
77
- foreign import mapAsyncWithOffsetAndSizeImpl
78
- :: GPUBuffer -> GPUMapMode -> GPUSize64 -> GPUSize64 -> Effect (Promise Unit )
68
+ mapAsyncWithSize a b c = runEffectFn3 mapAsyncWithSizeImpl a b c
79
69
70
+ foreign import mapAsyncWithOffsetAndSizeImpl :: EffectFn4 GPUBuffer GPUMapMode GPUSize64 GPUSize64 (Promise Unit )
80
71
mapAsyncWithOffsetAndSize
81
72
:: GPUBuffer -> GPUMapMode -> GPUSize64 -> GPUSize64 -> Effect (Promise Unit )
82
- mapAsyncWithOffsetAndSize = mapAsyncWithOffsetAndSizeImpl
83
-
84
- foreign import getMappedRangeImpl :: GPUBuffer -> Effect ArrayBuffer
73
+ mapAsyncWithOffsetAndSize a b c d = runEffectFn4 mapAsyncWithOffsetAndSizeImpl a b c d
85
74
75
+ foreign import getMappedRangeImpl :: EffectFn1 GPUBuffer ArrayBuffer
86
76
getMappedRange :: GPUBuffer -> Effect ArrayBuffer
87
- getMappedRange = getMappedRangeImpl
88
-
89
- foreign import getMappedRangeWithOffsetImpl
90
- :: GPUBuffer -> GPUSize64 -> Effect ArrayBuffer
77
+ getMappedRange a = runEffectFn1 getMappedRangeImpl a
91
78
79
+ foreign import getMappedRangeWithOffsetImpl :: EffectFn2 GPUBuffer GPUSize64 ArrayBuffer
92
80
getMappedRangeWithOffset :: GPUBuffer -> GPUSize64 -> Effect ArrayBuffer
93
- getMappedRangeWithOffset = getMappedRangeWithOffsetImpl
94
-
95
- foreign import getMappedRangeWithSizeImpl
96
- :: GPUBuffer -> GPUSize64 -> Effect ArrayBuffer
81
+ getMappedRangeWithOffset a b = runEffectFn2 getMappedRangeWithOffsetImpl a b
97
82
83
+ foreign import getMappedRangeWithSizeImpl :: EffectFn2 GPUBuffer GPUSize64 ArrayBuffer
98
84
getMappedRangeWithSize :: GPUBuffer -> GPUSize64 -> Effect ArrayBuffer
99
- getMappedRangeWithSize = getMappedRangeWithSizeImpl
100
-
101
- foreign import getMappedRangeWithOffsetAndSizeImpl
102
- :: GPUBuffer -> GPUSize64 -> GPUSize64 -> Effect ArrayBuffer
85
+ getMappedRangeWithSize a b = runEffectFn2 getMappedRangeWithSizeImpl a b
103
86
87
+ foreign import getMappedRangeWithOffsetAndSizeImpl :: EffectFn3 GPUBuffer GPUSize64 GPUSize64 ArrayBuffer
104
88
getMappedRangeWithOffsetAndSize
105
89
:: GPUBuffer -> GPUSize64 -> GPUSize64 -> Effect ArrayBuffer
106
- getMappedRangeWithOffsetAndSize = getMappedRangeWithOffsetAndSizeImpl
107
-
108
- foreign import unmapImpl :: GPUBuffer -> Effect Unit
90
+ getMappedRangeWithOffsetAndSize a b c = runEffectFn3 getMappedRangeWithOffsetAndSizeImpl a b c
109
91
92
+ foreign import unmapImpl :: EffectFn1 GPUBuffer Unit
110
93
unmap :: GPUBuffer -> Effect Unit
111
- unmap = unmapImpl
112
-
113
- foreign import destroyImpl :: GPUBuffer -> Effect Unit
94
+ unmap a = runEffectFn1 unmapImpl a
114
95
96
+ foreign import destroyImpl :: EffectFn1 GPUBuffer Unit
115
97
destroy :: GPUBuffer -> Effect Unit
116
- destroy = destroyImpl
98
+ destroy a = runEffectFn1 destroyImpl a
0 commit comments