packages feed

fir-0.1.0.0: test/Tests/Definitions/PushConstant.hs

{-# LANGUAGE BlockArguments   #-}
{-# LANGUAGE DataKinds        #-}
{-# LANGUAGE PolyKinds        #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators    #-}

module Tests.Definitions.PushConstant where

-- fir
import FIR

------------------------------------------------
-- push constants must be structures

type Defs =
  '[ "pc"   ':-> PushConstant '[] Float
   , "out"  ':-> StorageBuffer '[ DescriptorSet 0, Binding 0 ] ( Struct '[ "f" ':-> Float ] )
   , "main" ':-> EntryPoint '[ LocalSize 1 1 1 ] Compute
   ]

program :: Module Defs
program = Module do
  entryPoint @"main" @Compute do
    assign @( Name "out" :.: Name "f" ) =<< get @"pc"