Factory.cpp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <Tests/Factory.h>
  9. #include <Atom/RHI/DeviceDispatchRaysIndirectBuffer.h>
  10. #include <Atom/RHI/DeviceFence.h>
  11. #include <Atom/RHI/DeviceRayTracingAccelerationStructure.h>
  12. #include <Atom/RHI/DeviceRayTracingPipelineState.h>
  13. #include <Atom/RHI/DeviceRayTracingShaderTable.h>
  14. #include <Atom/RHI/DeviceRayTracingBufferPools.h>
  15. #include <Atom/RHI/DeviceStreamingImagePool.h>
  16. #include <Atom/RHI/DeviceSwapChain.h>
  17. #include <Tests/Device.h>
  18. #include <Tests/ShaderResourceGroup.h>
  19. #include <Tests/PipelineState.h>
  20. #include <Tests/Query.h>
  21. #include <Tests/IndirectBuffer.h>
  22. namespace UnitTest
  23. {
  24. using namespace AZ;
  25. Factory::Factory()
  26. {
  27. RHI::Factory::Register(this);
  28. }
  29. Factory::~Factory()
  30. {
  31. RHI::Factory::Unregister(this);
  32. RHI::ResourceInvalidateBus::AllowFunctionQueuing(false);
  33. RHI::ResourceInvalidateBus::ClearQueuedEvents();
  34. }
  35. Name Factory::GetName()
  36. {
  37. return m_platformName;
  38. }
  39. RHI::APIPriority Factory::GetDefaultPriority()
  40. {
  41. return RHI::APIMiddlePriority;
  42. }
  43. RHI::APIType Factory::GetType()
  44. {
  45. return RHI::APIType(m_platformName.GetStringView());
  46. }
  47. bool Factory::SupportsXR() const
  48. {
  49. return false;
  50. }
  51. RHI::PhysicalDeviceList Factory::EnumeratePhysicalDevices()
  52. {
  53. return PhysicalDevice::Enumerate();
  54. }
  55. RHI::Ptr<RHI::Device> Factory::CreateDevice()
  56. {
  57. return aznew Device;
  58. }
  59. RHI::Ptr<RHI::DeviceSwapChain> Factory::CreateSwapChain()
  60. {
  61. return nullptr;
  62. }
  63. RHI::Ptr<RHI::DeviceFence> Factory::CreateFence()
  64. {
  65. return nullptr;
  66. }
  67. RHI::Ptr<RHI::DeviceBuffer> Factory::CreateBuffer()
  68. {
  69. return aznew Buffer;
  70. }
  71. RHI::Ptr<RHI::DeviceBufferView> Factory::CreateBufferView()
  72. {
  73. return aznew BufferView;
  74. }
  75. RHI::Ptr<RHI::DeviceBufferPool> Factory::CreateBufferPool()
  76. {
  77. return aznew BufferPool;
  78. }
  79. RHI::Ptr<RHI::DeviceImage> Factory::CreateImage()
  80. {
  81. return aznew Image;
  82. }
  83. RHI::Ptr<RHI::DeviceImageView> Factory::CreateImageView()
  84. {
  85. return aznew ImageView;
  86. }
  87. RHI::Ptr<RHI::DeviceImagePool> Factory::CreateImagePool()
  88. {
  89. return aznew ImagePool;
  90. }
  91. RHI::Ptr<RHI::DeviceStreamingImagePool> Factory::CreateStreamingImagePool()
  92. {
  93. return nullptr;
  94. }
  95. RHI::Ptr<RHI::DeviceShaderResourceGroupPool> Factory::CreateShaderResourceGroupPool()
  96. {
  97. return aznew ShaderResourceGroupPool;
  98. }
  99. RHI::Ptr<RHI::DeviceShaderResourceGroup> Factory::CreateShaderResourceGroup()
  100. {
  101. return aznew ShaderResourceGroup;
  102. }
  103. RHI::Ptr<RHI::DevicePipelineLibrary> Factory::CreatePipelineLibrary()
  104. {
  105. return aznew PipelineLibrary;
  106. }
  107. RHI::Ptr<RHI::DevicePipelineState> Factory::CreatePipelineState()
  108. {
  109. return aznew PipelineState;
  110. }
  111. RHI::Ptr<RHI::Scope> Factory::CreateScope()
  112. {
  113. return aznew Scope;
  114. }
  115. RHI::Ptr<RHI::FrameGraphCompiler> Factory::CreateFrameGraphCompiler()
  116. {
  117. return aznew FrameGraphCompiler;
  118. }
  119. RHI::Ptr<RHI::FrameGraphExecuter> Factory::CreateFrameGraphExecuter()
  120. {
  121. return aznew FrameGraphExecuter;
  122. }
  123. RHI::Ptr<RHI::DeviceTransientAttachmentPool> Factory::CreateTransientAttachmentPool()
  124. {
  125. return aznew TransientAttachmentPool;
  126. }
  127. AZ::RHI::Ptr<AZ::RHI::DeviceQueryPool> Factory::CreateQueryPool()
  128. {
  129. return aznew QueryPool;
  130. }
  131. AZ::RHI::Ptr<AZ::RHI::DeviceQuery> Factory::CreateQuery()
  132. {
  133. return aznew Query;
  134. }
  135. AZ::RHI::Ptr<AZ::RHI::DeviceIndirectBufferSignature> Factory::CreateIndirectBufferSignature()
  136. {
  137. return aznew NiceIndirectBufferSignature;
  138. }
  139. AZ::RHI::Ptr<AZ::RHI::DeviceIndirectBufferWriter> Factory::CreateIndirectBufferWriter()
  140. {
  141. return aznew NiceIndirectBufferWriter;
  142. }
  143. AZ::RHI::Ptr<AZ::RHI::DeviceRayTracingBufferPools> Factory::CreateRayTracingBufferPools()
  144. {
  145. AZ_Assert(false, "Not implemented");
  146. return nullptr;
  147. }
  148. AZ::RHI::Ptr<AZ::RHI::DeviceRayTracingBlas> Factory::CreateRayTracingBlas()
  149. {
  150. AZ_Assert(false, "Not implemented");
  151. return nullptr;
  152. }
  153. AZ::RHI::Ptr<AZ::RHI::DeviceRayTracingTlas> Factory::CreateRayTracingTlas()
  154. {
  155. AZ_Assert(false, "Not implemented");
  156. return nullptr;
  157. }
  158. AZ::RHI::Ptr<AZ::RHI::DeviceRayTracingPipelineState> Factory::CreateRayTracingPipelineState()
  159. {
  160. AZ_Assert(false, "Not implemented");
  161. return nullptr;
  162. }
  163. AZ::RHI::Ptr<AZ::RHI::DeviceRayTracingShaderTable> Factory::CreateRayTracingShaderTable()
  164. {
  165. AZ_Assert(false, "Not implemented");
  166. return nullptr;
  167. }
  168. RHI::Ptr<RHI::DeviceDispatchRaysIndirectBuffer> Factory::CreateDispatchRaysIndirectBuffer()
  169. {
  170. AZ_Assert(false, "Not implemented");
  171. return nullptr;
  172. }
  173. }