keid-render-basic-0.2.0.0: src/Render/Lit/Specialization.hs
module Render.Lit.Specialization
( Specialization(..)
, defaultSpec
) where
import RIO
import Vulkan.Utils.Pipeline.Specialization qualified as PS
import Global.Resource.Texture.Base qualified as Base
import Render.Samplers qualified as Samplers
defaultSpec :: Specialization
defaultSpec = Specialization
{ sBRDF_LUT = Base.indices.ibl_brdf_lut
, sBRDF_LUT_SAMPLER = Samplers.indices.linear
, sMAX_REFLECTION_LOD = 9.0
, sIRRADIANCE_LOD = 10.0
, sIRRADIANCE_OFFSET = 0
, sIRRADIANCE_SAMPLER = Samplers.indices.linearMipRepeat
, sMAX_LIGHTS = 255
, sPCF_STEP = 1.5 / 4096
, sMAX_MATERIALS = 2048
}
data Specialization = Specialization
{ sBRDF_LUT :: Int32
, sBRDF_LUT_SAMPLER :: Int32
, sMAX_REFLECTION_LOD :: Float
, sIRRADIANCE_LOD :: Float
, sIRRADIANCE_OFFSET :: Int32
, sIRRADIANCE_SAMPLER :: Int32
, sMAX_LIGHTS :: Word32
, sPCF_STEP :: Float
, sMAX_MATERIALS :: Word32
}
deriving (Eq, Ord, Show, Generic)
instance PS.Specialization Specialization where
{-# INLINE specializationData #-}
specializationData Specialization{..} =
[ PS.packConstData sBRDF_LUT
, PS.packConstData sBRDF_LUT_SAMPLER
, PS.packConstData sMAX_REFLECTION_LOD
, PS.packConstData sIRRADIANCE_LOD
, PS.packConstData sIRRADIANCE_OFFSET
, PS.packConstData sIRRADIANCE_SAMPLER
, PS.packConstData sMAX_LIGHTS
, PS.packConstData sPCF_STEP
, PS.packConstData sMAX_MATERIALS
]