CmGLSLProgramPipelineManager.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "CmGLPrerequisites.h"
  3. namespace CamelotFramework
  4. {
  5. struct GLSLProgramPipeline
  6. {
  7. GLuint glHandle;
  8. };
  9. class GLSLProgramPipelineManager
  10. {
  11. public:
  12. const GLSLProgramPipeline* getPipeline(GLSLGpuProgram* vertexProgram, GLSLGpuProgram* fragmentProgram,
  13. GLSLGpuProgram* geometryProgram, GLSLGpuProgram* hullProgram, GLSLGpuProgram* domainProgram);
  14. private:
  15. struct ProgramPipelineKey
  16. {
  17. UINT32 vertexProgKey;
  18. UINT32 fragmentProgKey;
  19. UINT32 geometryProgKey;
  20. UINT32 hullProgKey;
  21. UINT32 domainProgKey;
  22. };
  23. class ProgramPipelineKeyHashFunction
  24. {
  25. public:
  26. ::std::size_t operator()(const ProgramPipelineKey &key) const;
  27. };
  28. class ProgramPipelineKeyEqual
  29. {
  30. public:
  31. bool operator()(const ProgramPipelineKey &a, const ProgramPipelineKey &b) const;
  32. };
  33. typedef unordered_map<ProgramPipelineKey, GLSLProgramPipeline, ProgramPipelineKeyHashFunction, ProgramPipelineKeyEqual>::type ProgramPipelineMap;
  34. ProgramPipelineMap mPipelines;
  35. };
  36. }