BsGLSLGpuProgram.h 1.5 KB

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