CmD3D11GpuProgram.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #pragma once
  2. #include "CmD3D11Prerequisites.h"
  3. #include "CmGpuProgram.h"
  4. namespace CamelotFramework
  5. {
  6. class CM_D3D11_EXPORT D3D11GpuProgram : public GpuProgram
  7. {
  8. public:
  9. virtual ~D3D11GpuProgram();
  10. protected:
  11. D3D11GpuProgram(GpuProgramType type, const String& profile);
  12. /**
  13. * @brief Loads shader from microcode.
  14. */
  15. virtual void loadFromMicrocode(D3D11Device& device, ID3D10Blob* microcode) = 0;
  16. };
  17. class CM_D3D11_EXPORT D3D11GpuVertexProgram : public D3D11GpuProgram
  18. {
  19. public:
  20. ~D3D11GpuVertexProgram();
  21. ID3D11VertexShader* getVertexShader(void) const;
  22. void loadFromMicrocode(D3D11Device& device, ID3D10Blob* microcode);
  23. protected:
  24. friend class D3D11GpuProgramManager;
  25. D3D11GpuVertexProgram(const String& profile);
  26. /**
  27. * @copydoc GpuProgram::destroy_internal().
  28. */
  29. void destroy_internal();
  30. protected:
  31. ID3D11VertexShader* mVertexShader;
  32. };
  33. class CM_D3D11_EXPORT D3D11GpuFragmentProgram : public D3D11GpuProgram
  34. {
  35. public:
  36. ~D3D11GpuFragmentProgram();
  37. ID3D11PixelShader* getPixelShader(void) const;
  38. void loadFromMicrocode(D3D11Device& device, ID3D10Blob* microcode);
  39. protected:
  40. friend class D3D11GpuProgramManager;
  41. D3D11GpuFragmentProgram(const String& profile);
  42. /**
  43. * @copydoc GpuProgram::destroy_internal().
  44. */
  45. void destroy_internal();
  46. protected:
  47. ID3D11PixelShader* mPixelShader;
  48. };
  49. class CM_D3D11_EXPORT D3D11GpuDomainProgram : public D3D11GpuProgram
  50. {
  51. public:
  52. ~D3D11GpuDomainProgram();
  53. ID3D11DomainShader* getDomainShader(void) const;
  54. void loadFromMicrocode(D3D11Device& device, ID3D10Blob* microcode);
  55. protected:
  56. friend class D3D11GpuProgramManager;
  57. D3D11GpuDomainProgram(const String& profile);
  58. /**
  59. * @copydoc GpuProgram::destroy_internal().
  60. */
  61. void destroy_internal();
  62. protected:
  63. ID3D11DomainShader* mDomainShader;
  64. };
  65. class CM_D3D11_EXPORT D3D11GpuHullProgram : public D3D11GpuProgram
  66. {
  67. public:
  68. ~D3D11GpuHullProgram();
  69. ID3D11HullShader* getHullShader() const;
  70. void loadFromMicrocode(D3D11Device& device, ID3D10Blob* microcode);
  71. protected:
  72. friend class D3D11GpuProgramManager;
  73. D3D11GpuHullProgram(const String& profile);
  74. /**
  75. * @copydoc GpuProgram::destroy_internal().
  76. */
  77. void destroy_internal();
  78. protected:
  79. ID3D11HullShader* mHullShader;
  80. };
  81. class CM_D3D11_EXPORT D3D11GpuGeometryProgram : public D3D11GpuProgram
  82. {
  83. public:
  84. ~D3D11GpuGeometryProgram();
  85. ID3D11GeometryShader* getGeometryShader(void) const;
  86. void loadFromMicrocode(D3D11Device& device, ID3D10Blob* microcode);
  87. protected:
  88. friend class D3D11GpuProgramManager;
  89. D3D11GpuGeometryProgram(const String& profile);
  90. /**
  91. * @copydoc GpuProgram::destroy_internal().
  92. */
  93. void destroy_internal();
  94. protected:
  95. ID3D11GeometryShader* mGeometryShader;
  96. };
  97. class CM_D3D11_EXPORT D3D11GpuComputeProgram : public D3D11GpuProgram
  98. {
  99. public:
  100. ~D3D11GpuComputeProgram();
  101. ID3D11ComputeShader* getComputeShader(void) const;
  102. void loadFromMicrocode(D3D11Device& device, ID3D10Blob* microcode);
  103. protected:
  104. friend class D3D11GpuProgramManager;
  105. D3D11GpuComputeProgram(const String& profile);
  106. /**
  107. * @copydoc GpuProgram::destroy_internal().
  108. */
  109. void destroy_internal();
  110. protected:
  111. ID3D11ComputeShader* mComputeShader;
  112. };
  113. }