Вынес работу с VpPhysicalDevice в отдельный класс
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "VkObjects/Instance.hpp"
|
||||
#include "VkObjects/PhysicalDevice.hpp"
|
||||
#include "VkObjects/Surface.hpp"
|
||||
|
||||
class Camera;
|
||||
@@ -21,15 +22,6 @@ class GPU_GarbageCollector;
|
||||
|
||||
class UwURenderEngine : public RenderEngineBase
|
||||
{
|
||||
struct QueueFamilyIndices
|
||||
{
|
||||
uint32_t graphics_family = 0;
|
||||
uint32_t present_family = 0;
|
||||
uint32_t transfer_family = 0;
|
||||
bool is_find_graphics_family = false;
|
||||
bool is_find_present_family = false;
|
||||
bool is_find_transfer_family = false;
|
||||
};
|
||||
struct SwapchainSupportDetails
|
||||
{
|
||||
std::vector<VkSurfaceFormatKHR> formats;
|
||||
@@ -74,8 +66,8 @@ class UwURenderEngine : public RenderEngineBase
|
||||
|
||||
VkObjects::Instance instance_;
|
||||
VkObjects::Surface surface_;
|
||||
//VkSurfaceKHR surface_ = VK_NULL_HANDLE;
|
||||
VkPhysicalDevice physical_device_ = VK_NULL_HANDLE;
|
||||
VkObjects::PhysicalDevice physical_device_;
|
||||
//VkPhysicalDevice physical_device_ = VK_NULL_HANDLE;
|
||||
VkDevice device_ = VK_NULL_HANDLE;
|
||||
VkQueue graphics_queue_ = VK_NULL_HANDLE;
|
||||
VkQueue present_queue_ = VK_NULL_HANDLE;
|
||||
@@ -108,15 +100,10 @@ class UwURenderEngine : public RenderEngineBase
|
||||
|
||||
SwapchainSupportDetails query_swapchain_details() const;
|
||||
|
||||
static bool is_device_suitable(VkPhysicalDevice device, VkSurfaceKHR surface);
|
||||
static bool check_device_extensions_support(VkPhysicalDevice device);
|
||||
static QueueFamilyIndices find_queue_family_indices(VkPhysicalDevice physical_device, VkSurfaceKHR surface);
|
||||
static VkSurfaceFormatKHR choose_surface_format(const std::vector<VkSurfaceFormatKHR>& surface_formats);
|
||||
static VkPresentModeKHR choose_present_mode(const std::vector<VkPresentModeKHR>& present_modes, VkPresentModeKHR desired_present_mode);
|
||||
VkShaderModule create_shader_module(const std::string& code) const;
|
||||
static std::vector<uint32_t> get_unique_family_indices(const QueueFamilyIndices& indices);
|
||||
|
||||
void pick_physical_device();
|
||||
void create_logical_device();
|
||||
void create_swapchain();
|
||||
void create_image_views();
|
||||
|
||||
Reference in New Issue
Block a user