PipelineState.cpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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/PipelineState.h>
  9. namespace UnitTest
  10. {
  11. using namespace AZ;
  12. namespace
  13. {
  14. uint64_t Fibonacci(uint64_t n)
  15. {
  16. if (n <= 1)
  17. {
  18. return n;
  19. }
  20. return Fibonacci(n - 1) + Fibonacci(n - 2);
  21. }
  22. }
  23. void PipelineLibrary::ShutdownInternal()
  24. {
  25. }
  26. RHI::ResultCode PipelineLibrary::MergeIntoInternal([[maybe_unused]] AZStd::span<const RHI::DevicePipelineLibrary* const> libraries)
  27. {
  28. return RHI::ResultCode::Success;
  29. }
  30. RHI::ResultCode PipelineState::InitInternal(RHI::Device&, [[maybe_unused]] const RHI::PipelineStateDescriptorForDraw& descriptor, [[maybe_unused]] RHI::DevicePipelineLibrary* pipelineLibrary)
  31. {
  32. // Performs 'work' to simulate compiling a pso.
  33. uint64_t value = Fibonacci(22);
  34. return value > 0 ? RHI::ResultCode::Success : RHI::ResultCode::Fail;
  35. }
  36. RHI::ResultCode PipelineState::InitInternal(RHI::Device&, [[maybe_unused]] const RHI::PipelineStateDescriptorForDispatch& descriptor, [[maybe_unused]] RHI::DevicePipelineLibrary* pipelineLibrary)
  37. {
  38. // Performs 'work' to simulate compiling a pso.
  39. uint64_t value = Fibonacci(22);
  40. return value > 0 ? RHI::ResultCode::Success : RHI::ResultCode::Fail;
  41. }
  42. RHI::ResultCode PipelineState::InitInternal(RHI::Device&, [[maybe_unused]] const RHI::PipelineStateDescriptorForRayTracing& descriptor, [[maybe_unused]] RHI::DevicePipelineLibrary* pipelineLibrary)
  43. {
  44. // Performs 'work' to simulate compiling a pso.
  45. uint64_t value = Fibonacci(22);
  46. return value > 0 ? RHI::ResultCode::Success : RHI::ResultCode::Fail;
  47. }
  48. }