1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGCOMPUTESHADERALGORITHM_H_
40 #define _OSGCOMPUTESHADERALGORITHM_H_
44 #include "OSGComputeShaderAlgorithmBase.h"
52 //! \ingroup GrpSystemNodeCoresMisc
54 class OSG_CONTRIBCOMPUTEBASE_DLLMAPPING ComputeShaderAlgorithm
:
55 public ComputeShaderAlgorithmBase
57 /*========================== PUBLIC =================================*/
61 /*---------------------------------------------------------------------*/
65 virtual void changed(ConstFieldMaskArg whichField
,
70 /*---------------------------------------------------------------------*/
74 virtual Action::ResultE
renderEnter(Action
*pAction
);
75 virtual Action::ResultE
renderLeave(Action
*pAction
);
77 virtual void execute (HardwareContext
*pContext
,
81 /*---------------------------------------------------------------------*/
86 /*---------------------------------------------------------------------*/
90 virtual void dump( UInt32 uiIndent
= 0,
91 const BitVector bvFlags
= 0) const;
94 /*========================= PROTECTED ===============================*/
98 static UInt32 _arbComputeShader
;
99 static UInt32 _arbComputeVariableGroupSize
;
100 static UInt32 _arbShaderImageLoadStore
;
102 static UInt32 FuncIdDispatchCompute
;
103 static UInt32 FuncIdDispatchComputeGroupSize
;
104 static UInt32 FuncIdMemoryBarrier
;
106 typedef ComputeShaderAlgorithmBase Inherited
;
108 /*---------------------------------------------------------------------*/
109 /*! \name Constructors */
112 ComputeShaderAlgorithm(void);
113 ComputeShaderAlgorithm(const ComputeShaderAlgorithm
&source
);
116 /*---------------------------------------------------------------------*/
117 /*! \name Destructors */
120 virtual ~ComputeShaderAlgorithm(void);
123 /*---------------------------------------------------------------------*/
128 /*---------------------------------------------------------------------*/
132 static void initMethod(InitPhase ePhase
);
135 /*========================== PRIVATE ================================*/
139 friend class FieldContainer
;
140 friend class ComputeShaderAlgorithmBase
;
142 /*---------------------------------------------------------------------*/
143 /*! \name thread local */
147 /*---------------------------------------------------------------------*/
148 /*! \name load thread */
152 /*---------------------------------------------------------------------*/
154 /*!\brief prohibit default function (move to 'public' if needed) */
155 void operator =(const ComputeShaderAlgorithm
&source
);
158 typedef ComputeShaderAlgorithm
*ComputeShaderAlgorithmP
;
162 #include "OSGComputeShaderAlgorithmBase.inl"
163 #include "OSGComputeShaderAlgorithm.inl"
165 #endif /* _OSGCOMPUTESHADERALGORITHM_H_ */