Skip to content

Commit d71df4f

Browse files
author
Mike Solomon
committed
Refactors module names
1 parent d95fbcf commit d71df4f

54 files changed

Lines changed: 243 additions & 139 deletions

Some content is hidden

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

sandbox/Sandbox.purs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ import Effect.Class (liftEffect)
2121
import Unsafe.Coerce (unsafeCoerce)
2222
import Web.DOM.Element (setAttribute)
2323
import Web.DOM.NonElementParentNode (getElementById)
24-
import Web.GPU.GPUDevice (createBuffer, createCommandEncoder, createPipelineLayout, createRenderPipeline, createShaderModule, createTexture)
25-
import Web.GPU.GPUDevice as GPUDevice
2624
import Web.GPU.GPU (requestAdapter)
2725
import Web.GPU.GPUAdapter (requestDevice)
28-
import Web.GPU.GPUBuffer (getMappedRange, unmap)
26+
import Web.GPU.GPUBuffer (GPUBuffer, getMappedRange, unmap)
2927
import Web.GPU.GPUBufferUsage (GPUBufferUsageFlags)
3028
import Web.GPU.GPUBufferUsage as GPUBufferUsage
3129
import Web.GPU.GPUCanvasAlphaMode (opaque)
@@ -37,6 +35,8 @@ import Web.GPU.GPUCommandEncoder (beginRenderPass, finish)
3735
import Web.GPU.GPUCompareFunction as GPUCompareFunction
3836
import Web.GPU.GPUCullMode (none)
3937
import Web.GPU.GPUDepthStencilState (GPUDepthStencilState)
38+
import Web.GPU.GPUDevice (createBuffer, createCommandEncoder, createPipelineLayout, createRenderPipeline, createShaderModule, createTexture)
39+
import Web.GPU.GPUDevice as GPUDevice
4040
import Web.GPU.GPUExtent3D (gpuExtent3DWHD)
4141
import Web.GPU.GPUFragmentState (GPUFragmentState)
4242
import Web.GPU.GPUFrontFace (cw)
@@ -64,7 +64,6 @@ import Web.GPU.GPUVertexStepMode as StepMode
6464
import Web.GPU.HTMLCanvasElement (getContext)
6565
import Web.GPU.Internal.Bitwise ((.|.))
6666
import Web.GPU.Internal.RequiredAndOptional (x)
67-
import Web.GPU.Internal.Types (GPUBuffer)
6867
import Web.GPU.Navigator (gpu)
6968
import Web.HTML (window)
7069
import Web.HTML.HTMLCanvasElement (fromElement, height, width)

src/Web/GPU/BufferSource.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ module Web.GPU.BufferSource where
1313

1414
import Data.ArrayBuffer.Types (ArrayBuffer, DataView, Float32Array, Float64Array, Int16Array, Int32Array, Int8Array, Uint16Array, Uint32Array, Uint8Array, Uint8ClampedArray)
1515
import Unsafe.Coerce (unsafeCoerce)
16-
import Web.GPU.Internal.Types (BufferSource)
1716

17+
data BufferSource
1818
fromArrayBuffer :: ArrayBuffer -> BufferSource
1919
fromArrayBuffer = unsafeCoerce
2020

src/Web/GPU/GPU.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33
-- @inline export getPreferredCanvasFormatImpl arity=1
44
-- @inline export getPreferredCanvasFormat arity=1
55
module Web.GPU.GPU
6-
( requestAdapter
6+
( GPU,requestAdapter
77
, getPreferredCanvasFormat
88
) where
99

1010
import Data.Maybe (Maybe(..))
1111
import Effect (Effect)
1212
import Web.GPU.GPURequestAdapterOptions (GPURequestAdapterOptions)
1313
import Web.GPU.GPUTextureFormat (GPUTextureFormat)
14-
import Web.GPU.Internal.Types (GPU, GPUAdapter)
1514
import Web.Promise (Promise)
15+
import Web.GPU.GPUAdapter(GPUAdapter)
1616

17+
data GPU
1718
-- requestAdapter
1819

1920
foreign import requestAdapterImpl

src/Web/GPU/GPUAdapter.purs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,28 @@
99
-- @inline export requestAdapterInfoImpl arity=2
1010
-- @inline export requestAdapterInfo arity=2
1111
module Web.GPU.GPUAdapter
12-
( GPUAdapterInfo
12+
( GPUAdapter(..)
13+
, GPUAdapterInfo
1314
, features
14-
, limits
1515
, isFallbackAdapter
16+
, limits
1617
, requestAdapterInfo
1718
, requestDevice
18-
) where
19+
)
20+
where
1921

2022
import Data.Maybe (Maybe(..))
2123
import Data.Set as Set
2224
import Effect (Effect)
2325
import Web.GPU.GPUDeviceDescriptor (GPUDeviceDescriptor)
2426
import Web.GPU.GPUFeatureName (GPUFeatureName)
27+
import Web.GPU.GPUDevice(GPUDevice)
2528
import Web.GPU.GPUSupportedLimits (GPUSupportedLimits)
26-
import Web.GPU.Internal.Types (GPUAdapter, GPUDevice)
2729
import Web.GPU.UnmaskHint (UnmaskHint)
2830
import Web.Promise (Promise)
2931

32+
data GPUAdapter
33+
3034
-- features
3135
foreign import featuresImpl
3236
:: (GPUFeatureName -> Set.Set GPUFeatureName -> Set.Set GPUFeatureName)

src/Web/GPU/GPUBindGroup.purs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Web.GPU.GPUBindGroup
2+
( GPUBindGroup
3+
)
4+
where
5+
6+
data GPUBindGroup

src/Web/GPU/GPUBindGroupDescriptor.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
module Web.GPU.GPUBindGroupDescriptor where
22

33
import Data.Newtype (class Newtype)
4+
import Web.GPU.GPUBindGroupEntry (GPUBindGroupEntry)
5+
import Web.GPU.GPUBindGroupLayout (GPUBindGroupLayout)
46
import Web.GPU.Internal.RequiredAndOptional (RequiredAndOptional)
5-
import Web.GPU.Internal.Types (GPUBindGroupEntry, GPUBindGroupLayout)
67

78
newtype GPUBindGroupDescriptor = GPUBindGroupDescriptor
89
( RequiredAndOptional

src/Web/GPU/GPUBindGroupEntry.purs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@ module Web.GPU.GPUBindGroupEntry where
22

33
import Data.Newtype (class Newtype)
44
import Unsafe.Coerce (unsafeCoerce)
5+
import Web.GPU.GPUBuffer (GPUBuffer)
6+
import Web.GPU.GPUExternalTexture (GPUExternalTexture)
7+
import Web.GPU.GPUSampler (GPUSampler)
8+
import Web.GPU.GPUTextureView (GPUTextureView)
59
import Web.GPU.Internal.RequiredAndOptional (RequiredAndOptional)
6-
import Web.GPU.Internal.Types (GPUBindGroupEntry, GPUBuffer, GPUExternalTexture, GPUIndex32, GPUSampler, GPUTextureView, GPUSize64)
10+
import Web.GPU.Internal.Types (GPUIndex32, GPUSize64)
711

8-
class GPUBindGroupEntry e where
12+
data GPUBindGroupEntry
13+
14+
class AsGPUBindGroupEntry e where
915
gpuBindGroupEntry :: GPUIndex32 -> e -> GPUBindGroupEntry
1016

11-
instance GPUBindGroupEntry GPUSampler where
17+
instance AsGPUBindGroupEntry GPUSampler where
1218
gpuBindGroupEntry binding resource = unsafeCoerce
1319
{ binding, resource: unsafeCoerce resource }
1420

15-
instance GPUBindGroupEntry GPUTextureView where
21+
instance AsGPUBindGroupEntry GPUTextureView where
1622
gpuBindGroupEntry binding resource = unsafeCoerce
1723
{ binding, resource: unsafeCoerce resource }
1824

@@ -23,10 +29,10 @@ newtype GPUBufferBinding = GPUBufferBinding
2329

2430
derive instance Newtype GPUBufferBinding _
2531

26-
instance GPUBindGroupEntry GPUBufferBinding where
32+
instance AsGPUBindGroupEntry GPUBufferBinding where
2733
gpuBindGroupEntry binding resource = unsafeCoerce
2834
{ binding, resource: unsafeCoerce resource }
2935

30-
instance GPUBindGroupEntry GPUExternalTexture where
36+
instance AsGPUBindGroupEntry GPUExternalTexture where
3137
gpuBindGroupEntry binding resource = unsafeCoerce
3238
{ binding, resource: unsafeCoerce resource }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Web.GPU.GPUBindGroupLayout
2+
( GPUBindGroupLayout
3+
)
4+
where
5+
6+
data GPUBindGroupLayout

src/Web/GPU/GPUBindGroupLayoutDescriptor.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module Web.GPU.GPUBindGroupLayoutDescriptor where
22

33
import Data.Newtype (class Newtype)
4+
import Web.GPU.GPUBindGroupLayoutEntry (GPUBindGroupLayoutEntry)
45
import Web.GPU.Internal.RequiredAndOptional (RequiredAndOptional)
5-
import Web.GPU.Internal.Types (GPUBindGroupLayoutEntry)
66

77
newtype GPUBindGroupLayoutDescriptor = GPUBindGroupLayoutDescriptor
88
( RequiredAndOptional (entries :: Array GPUBindGroupLayoutEntry)

src/Web/GPU/GPUBindGroupLayoutEntry.purs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import Web.GPU.GPUSamplerBindingLayout (GPUSamplerBindingLayout)
1212
import Web.GPU.GPUShaderStage (GPUShaderStageFlags)
1313
import Web.GPU.GPUStorageTextureBindingLayout (GPUStorageTextureBindingLayout)
1414
import Web.GPU.GPUTextureBindingLayout (GPUTextureBindingLayout)
15-
import Web.GPU.Internal.Types (GPUBindGroupLayoutEntry, GPUIndex32)
15+
import Web.GPU.Internal.Types (GPUIndex32)
1616

17+
data GPUBindGroupLayoutEntry
1718
gpuBufferBindingLayout
1819
:: GPUIndex32
1920
-> GPUShaderStageFlags

0 commit comments

Comments
 (0)