packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUComputePipelineDescriptor.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgpu (webref). Do not edit.
module JSDOM.Generated.GPUComputePipelineDescriptor
       (newGPUComputePipelineDescriptor, setCompute, getCompute, GPUComputePipelineDescriptor(..), gTypeGPUComputePipelineDescriptor)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums

-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpucomputepipelinedescriptor GPUComputePipelineDescriptor specification>
newGPUComputePipelineDescriptor :: (MonadDOM m, IsGPUPipelineLayoutOrGPUAutoLayoutMode layout, IsGPUProgrammableStage compute) => layout -> compute -> m GPUComputePipelineDescriptor
newGPUComputePipelineDescriptor layout compute = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "layout" (toJSVal layout)) P.>> (o ^. jss "compute" (toJSVal compute)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepipelinedescriptor-compute GPUComputePipelineDescriptor.compute specification>
setCompute :: (MonadDOM m, IsGPUProgrammableStage val) => GPUComputePipelineDescriptor -> val -> m ()
setCompute self val = liftDOM (void (self ^. jss "compute" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucomputepipelinedescriptor-compute GPUComputePipelineDescriptor.compute specification>
getCompute :: (MonadDOM m) => GPUComputePipelineDescriptor -> m GPUProgrammableStage
getCompute self = liftDOM (((self ^. js "compute") >>= fromJSValUnchecked))