BsGLSLGpuProgram.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 "RenderAPI/BsGpuProgram.h"
  6. namespace bs { namespace ct
  7. {
  8. /** @addtogroup GL
  9. * @{
  10. */
  11. /** GPU program compiled from GLSL and usable by OpenGL. */
  12. class GLSLGpuProgram : public GpuProgram
  13. {
  14. public:
  15. ~GLSLGpuProgram();
  16. /** @copydoc GpuProgram::isSupported */
  17. bool isSupported() const override;
  18. /** Gets internal OpenGL handle to the program. */
  19. GLuint getGLHandle() const { return mGLHandle; }
  20. /** Gets an unique index for this GPU program. Each created GPU program is assigned a unique index on creation. */
  21. UINT32 getProgramID() const { return mProgramID; }
  22. private:
  23. friend class GLSLProgramFactory;
  24. GLSLGpuProgram(const GPU_PROGRAM_DESC& desc, GpuDeviceFlags deviceMask);
  25. /** @copydoc GpuProgram::initialize */
  26. void initialize() override;
  27. private:
  28. UINT32 mProgramID;
  29. GLuint mGLHandle;
  30. static UINT32 mVertexShaderCount;
  31. static UINT32 mFragmentShaderCount;
  32. static UINT32 mGeometryShaderCount;
  33. static UINT32 mHullShaderCount;
  34. static UINT32 mDomainShaderCount;
  35. static UINT32 mComputeShaderCount;
  36. };
  37. /** @} */
  38. }}