BsGpuProgramImportOptions.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #include "BsImportOptions.h"
  4. #include "BsGpuProgram.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Contains import options you may use to control how is a GPU program (i.e. shader)
  9. * file imported.
  10. */
  11. class BS_CORE_EXPORT GpuProgramImportOptions : public ImportOptions
  12. {
  13. public:
  14. GpuProgramImportOptions();
  15. /**
  16. * @brief Sets the name of the GPU program entry point method (e.g. "main").
  17. */
  18. void setEntryPoint(const String& entryPoint) { mEntryPoint = entryPoint; }
  19. /**
  20. * @brief Sets the language the GPU program is written in (e.g. HLSL9, GLSL, HLSL11).
  21. */
  22. void setLanguage(const String& language) { mLanguage = language; }
  23. /**
  24. * @brief Sets GPU program profile. Determines minimal feature-set the GPU program
  25. * requires in order to function.
  26. */
  27. void setProfile(GpuProgramProfile profile) { mProfile = profile; }
  28. /**
  29. * @brief Sets GPU program type (e.g. vertex, pixel, etc.).
  30. */
  31. void setType(GpuProgramType type) { mType = type; }
  32. /**
  33. * @brief Sets optional GPU program include files which may be used
  34. * for sharing code across multiple programs.
  35. */
  36. void setIncludes(const Vector<HGpuProgInclude>& includes) { mIncludes = includes; }
  37. /**
  38. * @brief Gets the name of the GPU program entry point method (e.g. "main").
  39. */
  40. const String& getEntryPoint() const { return mEntryPoint; }
  41. /**
  42. * @brief Gets the language the GPU program is written in (e.g. HLSL9, GLSL, HLSL11).
  43. */
  44. const String& getLanguage() const { return mLanguage; }
  45. /**
  46. * @brief Gets GPU program profile. Determines minimal feature-set the GPU program
  47. * requires in order to function.
  48. */
  49. GpuProgramProfile getProfile() const { return mProfile; }
  50. /**
  51. * @brief Gets GPU program type (e.g. vertex, pixel, etc.).
  52. */
  53. GpuProgramType getType() const { return mType; }
  54. /**
  55. * @brief Gets optional GPU program include files which may be used
  56. * for sharing code across multiple programs.
  57. */
  58. const Vector<HGpuProgInclude>& getIncludes() const { return mIncludes; }
  59. /************************************************************************/
  60. /* SERIALIZATION */
  61. /************************************************************************/
  62. public:
  63. friend class GpuProgramImportOptionsRTTI;
  64. static RTTITypeBase* getRTTIStatic();
  65. virtual RTTITypeBase* getRTTI() const;
  66. private:
  67. String mEntryPoint;
  68. String mLanguage;
  69. GpuProgramProfile mProfile;
  70. GpuProgramType mType;
  71. Vector<HGpuProgInclude> mIncludes;
  72. };
  73. }