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

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

44 lines
944 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"
2023-01-28 02:12:28 +00:00
#include "VideoBackends/Vulkan/StagingBuffer.h"
2016-08-13 12:57:50 +00:00
#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;
VmaAllocation m_gpu_allocation = 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