Skip to content

Commit ed59897

Browse files
author
Mike Solomon
committed
Adds pipeline base
1 parent f80854f commit ed59897

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

src/Web/GPU/GPUPipelineBase.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const unsafeGetBindGroupLayoutImpl = (pipeline) => (index) => () => pipeline.getBindGroupLayout(index);

src/Web/GPU/GPUPipelineBase.purs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module Web.GPU.GPUPipelineBase where
2+
3+
import Effect (Effect)
4+
import Web.GPU.Internal.Types (GPUBindGroupLayout, GPUComputePipeline, GPURenderPipeline)
5+
import Web.GPU.Internal.Unsigned (UnsignedLong)
6+
7+
foreign import unsafeGetBindGroupLayoutImpl :: forall a. a -> UnsignedLong -> Effect GPUBindGroupLayout
8+
9+
class GPUPipelineBase a where
10+
getBindGroupLayout :: a -> UnsignedLong -> Effect GPUBindGroupLayout
11+
12+
instance GPUPipelineBase GPUComputePipeline where
13+
getBindGroupLayout = unsafeGetBindGroupLayoutImpl
14+
instance GPUPipelineBase GPURenderPipeline where
15+
getBindGroupLayout = unsafeGetBindGroupLayoutImpl

0 commit comments

Comments
 (0)