simple_task.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00033 #ifndef __simple_task__header__
00034 #define __simple_task__header__
00035
00036
00037 #include "gpucalc/task.h"
00038
00039 namespace gpucalc
00040 {
00041
00042 const char _SimpleTaskClassName [] = "SimpleTask";
00043
00044
00050 class _GpuCalcExport SimpleTask: public Task
00051 {
00052
00053
00054 OBJ_DISABLE_COPY(SimpleTask)
00055
00056
00057
00058 friend class SimpleTaskManager;
00059
00060 public:
00061
00062 ~SimpleTask();
00063
00064
00065 void compile();
00066
00067
00068 void addDataToActiveKernel(const Data & data);
00069
00070
00071 void addCompilerParamsToActiveKernel(const std::string & Parameters);
00072
00073
00074 void removeDataFromActiveKernel(const Data & )
00075 {
00076
00077 }
00078
00079
00080 void addResultToActiveKernel(Data & result);
00081
00082
00083 void removeResultFromActiveKernel(const Data & result);
00084
00085
00086 Data & getResultData() const
00087 {
00088 return * mResultData;
00089 }
00090
00091
00092 void addActiveKernel(Kernel * )
00093 {
00094
00095 }
00096
00097
00098 Kernel * getActiveKernel() const;
00099
00100
00101 void removeKernel(Kernel * kernel);
00102
00103
00104 void compute();
00105
00106
00107 protected:
00108 Kernel * mActiveKernel;
00109
00110
00111 FrameBuffer * mActiveFrameBuffer;
00112
00113
00114 Data * mResultData;
00115
00116
00117 Texture * mRenderTarget;
00118
00119
00120 typedef std::list<const Data *> DataVector;
00121 DataVector mDataVector;
00122
00123
00124 GraphicCore * mDefaultGraphicCore;
00125
00126
00127 ShaderSystem * mDefaultShaderSystem;
00128
00129
00130 std::string mCompilerParams;
00131
00132
00133 void computeOneKernel(Texture * RenderTarget);
00134
00135
00136 SimpleTask(const std::string & TaskName);
00137
00138 };
00139 }
00140
00141 #endif