dolphin/Source/Core/VideoBackends/Vulkan/VKBoundingBox.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
893 B
C
Raw Normal View History

2016-08-13 12:57:50 +00:00
// Copyright 2016 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
2016-08-13 12:57:50 +00:00
#pragma once
#include <array>
2016-08-13 12:57:50 +00:00
#include <memory>
#include <string>
#include "Common/CommonTypes.h"
#include "VideoBackends/Vulkan/VulkanLoader.h"
#include "VideoCommon/BoundingBox.h"
2016-08-13 12:57:50 +00:00
namespace Vulkan
{
class StagingBuffer;
class VKBoundingBox final : public BoundingBox
2016-08-13 12:57:50 +00:00
{
public:
~VKBoundingBox() override;
2016-08-13 12:57:50 +00:00
bool Initialize() override;
2016-08-13 12:57:50 +00:00
protected:
std::vector<BBoxType> Read(u32 index, u32 length) override;
void Write(u32 index, const std::vector<BBoxType>& values) override;
2016-08-13 12:57:50 +00:00
private:
bool CreateGPUBuffer();
bool CreateReadbackBuffer();
VkBuffer m_gpu_buffer = VK_NULL_HANDLE;
VkDeviceMemory m_gpu_memory = VK_NULL_HANDLE;
2016-08-13 12:57:50 +00:00
static constexpr size_t BUFFER_SIZE = sizeof(BBoxType) * NUM_BBOX_VALUES;
2016-08-13 12:57:50 +00:00
std::unique_ptr<StagingBuffer> m_readback_buffer;
};
} // namespace Vulkan