packages feed

lambdacube-engine-0.1.1: Graphics/LambdaCube/GpuProgramUsage.hs

module Graphics.LambdaCube.GpuProgramUsage where

import Graphics.LambdaCube.GpuProgram
--import Graphics.LambdaCube.GpuProgramParams

{-| This class makes the usage of a vertex and fragment programs (low-level or high-level), 
    with a given set of parameters, explicit.
@remarks
    Using a vertex or fragment program can get fairly complex; besides the fairly rudimentary
    process of binding a program to the GPU for rendering, managing usage has few
    complications, such as:
    <ul>
    <li>Programs can be high level (e.g. Cg, RenderMonkey) or low level (assembler). Using
    either should be relatively seamless, although high-level programs give you the advantage
    of being able to use named parameters, instead of just indexed registers</li>
    <li>Programs and parameters can be shared between multiple usages, in order to save
    memory</li>
    <li>When you define a user of a program, such as a material, you often want to be able to
    set up the definition but not load / compile / assemble the program at that stage, because
    it is not needed just yet. The program should be loaded when it is first needed, or
    earlier if specifically requested. The program may not be defined at this time, you
    may want to have scripts that can set up the definitions independent of the order in which
    those scripts are loaded.</li>
    </ul>
    This class packages up those details so you don't have to worry about them. For example,
    this class lets you define a high-level program and set up the parameters for it, without
    having loaded the program (which you normally could not do). When the program is loaded and
    compiled, this class will then validate the parameters you supplied earlier and turn them
    into runtime parameters.
@par
    Just incase it wasn't clear from the above, this class provides linkage to both 
    GpuProgram and HighLevelGpuProgram, despite its name.
-}
data GpuProgramUsage
    = GpuProgramUsage
    { --gpuType           :: GpuProgramType
--    , gpuParent         :: Pass
    
      gpuProgramName    :: String
--    , gpuProgram        :: Maybe p          -- ^ The program link
--    , gpuProgram        :: Either String (GpuProgramDescriptor p)          -- ^ The program link
--    , gpuParameters     :: GpuProgramParameters -- ^ program parameters

--    , gpuRecreateParams :: Bool                 -- ^ Whether to recreate parameters next load
    }
    deriving Eq