BsD3D11GpuProgramRTTI.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. #pragma once
  2. #include "BsD3D11Prerequisites.h"
  3. #include "BsRTTIType.h"
  4. #include "BsGpuProgramManager.h"
  5. #include "BsD3D11GpuProgram.h"
  6. namespace BansheeEngine
  7. {
  8. class BS_D3D11_EXPORT D3D11GpuProgramRTTI : public RTTIType<D3D11GpuProgram, GpuProgram, D3D11GpuProgramRTTI>
  9. {
  10. public:
  11. D3D11GpuProgramRTTI()
  12. { }
  13. virtual const String& getRTTIName()
  14. {
  15. static String name = "D3D11GpuProgram";
  16. return name;
  17. }
  18. virtual UINT32 getRTTIId()
  19. {
  20. return TID_D3D11_GpuProgram;
  21. }
  22. virtual std::shared_ptr<IReflectable> newRTTIObject()
  23. {
  24. BS_EXCEPT(InvalidStateException, "Cannot create an instance of an abstract class.");
  25. }
  26. };
  27. class BS_D3D11_EXPORT D3D11GpuVertexProgramRTTI : public RTTIType<D3D11GpuVertexProgram, D3D11GpuProgram, D3D11GpuVertexProgramRTTI>
  28. {
  29. public:
  30. D3D11GpuVertexProgramRTTI()
  31. { }
  32. virtual const String& getRTTIName()
  33. {
  34. static String name = "D3D11GpuVertexProgram";
  35. return name;
  36. }
  37. virtual UINT32 getRTTIId()
  38. {
  39. return TID_D3D11_GpuVertexProgram;
  40. }
  41. virtual std::shared_ptr<IReflectable> newRTTIObject()
  42. {
  43. return GpuProgramManager::instance().createEmpty("hlsl", GPT_VERTEX_PROGRAM);
  44. }
  45. };
  46. class BS_D3D11_EXPORT D3D11GpuFragmentProgramRTTI : public RTTIType<D3D11GpuFragmentProgram, D3D11GpuProgram, D3D11GpuFragmentProgramRTTI>
  47. {
  48. public:
  49. D3D11GpuFragmentProgramRTTI()
  50. { }
  51. virtual const String& getRTTIName()
  52. {
  53. static String name = "D3D11GpuFragmentProgram";
  54. return name;
  55. }
  56. virtual UINT32 getRTTIId()
  57. {
  58. return TID_D3D11_GpuFragmentProgram;
  59. }
  60. virtual std::shared_ptr<IReflectable> newRTTIObject()
  61. {
  62. return GpuProgramManager::instance().createEmpty("hlsl", GPT_FRAGMENT_PROGRAM);
  63. }
  64. };
  65. class BS_D3D11_EXPORT D3D11GpuGeometryProgramRTTI : public RTTIType<D3D11GpuGeometryProgram, D3D11GpuProgram, D3D11GpuGeometryProgramRTTI>
  66. {
  67. public:
  68. D3D11GpuGeometryProgramRTTI()
  69. { }
  70. virtual const String& getRTTIName()
  71. {
  72. static String name = "D3D11GpuGeometryProgram";
  73. return name;
  74. }
  75. virtual UINT32 getRTTIId()
  76. {
  77. return TID_D3D11_GpuGeometryProgram;
  78. }
  79. virtual std::shared_ptr<IReflectable> newRTTIObject()
  80. {
  81. return GpuProgramManager::instance().createEmpty("hlsl", GPT_GEOMETRY_PROGRAM);
  82. }
  83. };
  84. class BS_D3D11_EXPORT D3D11GpuHullProgramRTTI : public RTTIType<D3D11GpuHullProgram, D3D11GpuProgram, D3D11GpuHullProgramRTTI>
  85. {
  86. public:
  87. D3D11GpuHullProgramRTTI()
  88. { }
  89. virtual const String& getRTTIName()
  90. {
  91. static String name = "D3D11GpuHullProgram";
  92. return name;
  93. }
  94. virtual UINT32 getRTTIId()
  95. {
  96. return TID_D3D11_GpuHullProgram;
  97. }
  98. virtual std::shared_ptr<IReflectable> newRTTIObject()
  99. {
  100. return GpuProgramManager::instance().createEmpty("hlsl", GPT_HULL_PROGRAM);
  101. }
  102. };
  103. class BS_D3D11_EXPORT D3D11GpuDomainProgramRTTI : public RTTIType<D3D11GpuDomainProgram, D3D11GpuProgram, D3D11GpuDomainProgramRTTI>
  104. {
  105. public:
  106. D3D11GpuDomainProgramRTTI()
  107. { }
  108. virtual const String& getRTTIName()
  109. {
  110. static String name = "D3D11GpuDomainProgram";
  111. return name;
  112. }
  113. virtual UINT32 getRTTIId()
  114. {
  115. return TID_D3D11_GpuDomainProgram;
  116. }
  117. virtual std::shared_ptr<IReflectable> newRTTIObject()
  118. {
  119. return GpuProgramManager::instance().createEmpty("hlsl", GPT_DOMAIN_PROGRAM);
  120. }
  121. };
  122. class BS_D3D11_EXPORT D3D11GpuComputeProgramRTTI : public RTTIType<D3D11GpuComputeProgram, D3D11GpuProgram, D3D11GpuComputeProgramRTTI>
  123. {
  124. public:
  125. D3D11GpuComputeProgramRTTI()
  126. { }
  127. virtual const String& getRTTIName()
  128. {
  129. static String name = "D3D11GpuComputeProgram";
  130. return name;
  131. }
  132. virtual UINT32 getRTTIId()
  133. {
  134. return TID_D3D11_GpuComputeProgram;
  135. }
  136. virtual std::shared_ptr<IReflectable> newRTTIObject()
  137. {
  138. return GpuProgramManager::instance().createEmpty("hlsl", GPT_COMPUTE_PROGRAM);
  139. }
  140. };
  141. }