MTLBoundingBox.h 702 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2022 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "VideoCommon/BoundingBox.h"
  4. #include <Metal/Metal.h>
  5. #include "VideoBackends/Metal/MRCHelpers.h"
  6. namespace Metal
  7. {
  8. class BoundingBox final : public ::BoundingBox
  9. {
  10. public:
  11. ~BoundingBox() override;
  12. bool Initialize() override;
  13. protected:
  14. std::vector<BBoxType> Read(u32 index, u32 length) override;
  15. void Write(u32 index, std::span<const BBoxType> values) override;
  16. private:
  17. BBoxType* m_cpu_buffer_ptr;
  18. MRCOwned<id<MTLFence>> m_download_fence;
  19. MRCOwned<id<MTLFence>> m_upload_fence;
  20. MRCOwned<id<MTLBuffer>> m_cpu_buffer;
  21. MRCOwned<id<MTLBuffer>> m_gpu_buffer;
  22. };
  23. } // namespace Metal