#include <msp/core/hash.h>
-#include <msp/graphics/vulkancontext_private.h>
#include "batch.h"
#include "commands_backend.h"
#include "device.h"
VkCommandPoolCreateInfo pool_info = { };
pool_info.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
pool_info.flags = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT;
- pool_info.queueFamilyIndex = device.get_context().get_private().graphics_queue_family;
+ pool_info.queueFamilyIndex = device.get_graphics_queue_family();
vk.CreateCommandPool(pool_info, pool);
}
info.glsl_features = SL::Features::from_api_version(info.api, info.api_version);
}
+uint32_t VulkanDevice::get_graphics_queue_family() const
+{
+ return context.get_private().graphics_queue_family;
+}
+
+VkSurface VulkanDevice::get_surface() const
+{
+ return handle_cast<VkSurface>(context.get_private().surface);
+}
+
+VkPhysicalDevice VulkanDevice::get_physical_device() const
+{
+ return handle_cast<VkPhysicalDevice>(context.get_private().physical_device);
+}
+
} // namespace GL
} // namespace Msp
Graphics::VulkanContext &get_context() { return context; }
public:
+ std::uint32_t get_graphics_queue_family() const;
+ VkPhysicalDevice get_physical_device() const;
+ VkSurface get_surface() const;
+
const VulkanFunctions &get_functions() const { return *functions; }
MemoryAllocator &get_allocator() { return allocator; }
DestroyQueue &get_destroy_queue() { return destroy_queue; }
#include <msp/core/algorithm.h>
#include <msp/core/maputils.h>
-#include <msp/graphics/vulkancontext_private.h>
#include <msp/stringcodec/utf8.h>
#include <msp/strings/format.h>
#include "device.h"
MemoryAllocator::MemoryAllocator(Device &d):
device(d),
- phys_device(handle_cast<VkPhysicalDevice>(device.get_context().get_private().physical_device))
+ phys_device(device.get_physical_device())
{
const VulkanFunctions &vk = device.get_functions();
#include <limits>
#include <vector>
#include <msp/core/algorithm.h>
-#include <msp/graphics/vulkancontext_private.h>
#include "device.h"
#include "error.h"
#include "pixelformat.h"
SwapChain::SwapChain(unsigned w, unsigned h, unsigned n_images_min):
device(Device::get_current()),
- surface(handle_cast<VkSurface>(device.get_context().get_private().surface)),
+ surface(device.get_surface()),
width(w),
height(h)
{