BsGLSLGpuProgram.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include "BsGLPrerequisites.h"
  3. #include "BsGpuProgram.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief GPU program compiled from GLSL and usable by OpenGL.
  8. */
  9. class BS_RSGL_EXPORT GLSLGpuProgramCore : public GpuProgramCore
  10. {
  11. public:
  12. ~GLSLGpuProgramCore();
  13. /**
  14. * @copydoc GpuProgramCore::isSupported
  15. */
  16. bool isSupported() const override;
  17. /**
  18. * @brief Gets internal OpenGL handle to the program.
  19. */
  20. GLuint getGLHandle() const { return mGLHandle; }
  21. /**
  22. * @brief Gets an unique index for this GPU program. Each created GPU program is
  23. * assigned a unique index on creation.
  24. */
  25. UINT32 getProgramID() const { return mProgramID; }
  26. private:
  27. friend class GLSLProgramFactory;
  28. GLSLGpuProgramCore(const String& source, const String& entryPoint, GpuProgramType gptype,
  29. GpuProgramProfile profile, bool isAdjacencyInfoRequired);
  30. /**
  31. * @copydoc GpuProgramCore::initialize
  32. */
  33. void initialize() override;
  34. private:
  35. UINT32 mProgramID;
  36. GLuint mGLHandle;
  37. static UINT32 mVertexShaderCount;
  38. static UINT32 mFragmentShaderCount;
  39. static UINT32 mGeometryShaderCount;
  40. static UINT32 mHullShaderCount;
  41. static UINT32 mDomainShaderCount;
  42. };
  43. }