2022-06-01 09:58:13 +00:00
|
|
|
// Copyright 2022 Dolphin Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#include "VideoCommon/BoundingBox.h"
|
|
|
|
|
|
|
|
#include <Metal/Metal.h>
|
|
|
|
|
|
|
|
#include "VideoBackends/Metal/MRCHelpers.h"
|
|
|
|
|
|
|
|
namespace Metal
|
|
|
|
{
|
|
|
|
class BoundingBox final : public ::BoundingBox
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~BoundingBox() override;
|
|
|
|
|
|
|
|
bool Initialize() override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
std::vector<BBoxType> Read(u32 index, u32 length) override;
|
2023-12-09 19:54:17 +00:00
|
|
|
void Write(u32 index, std::span<const BBoxType> values) override;
|
2022-06-01 09:58:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
BBoxType* m_cpu_buffer_ptr;
|
|
|
|
MRCOwned<id<MTLFence>> m_download_fence;
|
|
|
|
MRCOwned<id<MTLFence>> m_upload_fence;
|
|
|
|
MRCOwned<id<MTLBuffer>> m_cpu_buffer;
|
|
|
|
MRCOwned<id<MTLBuffer>> m_gpu_buffer;
|
|
|
|
};
|
|
|
|
} // namespace Metal
|