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

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

44 lines
941 B
C++
Raw Normal View History

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