fix some linux issues

- Fix build
- Fix VMA incompatibility with swapchain_NATIVE
This commit is contained in:
kd-11 2018-06-06 18:37:27 +03:00 committed by kd-11
parent 1b9c9267f0
commit e9c3ab7ae6
2 changed files with 14 additions and 18 deletions

View file

@ -557,7 +557,6 @@ VKGSRender::VKGSRender() : GSRender()
m_mem_allocator = std::make_shared<vk::mem_allocator_vma>(*m_device, m_device->gpu()); m_mem_allocator = std::make_shared<vk::mem_allocator_vma>(*m_device, m_device->gpu());
} }
vk::set_current_mem_allocator(m_mem_allocator); vk::set_current_mem_allocator(m_mem_allocator);
m_client_width = m_frame->client_width(); m_client_width = m_frame->client_width();
@ -781,11 +780,9 @@ VKGSRender::~VKGSRender()
m_secondary_command_buffer.destroy(); m_secondary_command_buffer.destroy();
m_secondary_command_buffer_pool.destroy(); m_secondary_command_buffer_pool.destroy();
// Memory allocator (device memory)
m_mem_allocator->destroy();
//Device handles/contexts //Device handles/contexts
m_swapchain->destroy(); m_swapchain->destroy();
m_mem_allocator->destroy();
m_thread_context.close(); m_thread_context.close();
#if !defined(_WIN32) && defined(HAVE_VULKAN) #if !defined(_WIN32) && defined(HAVE_VULKAN)

View file

@ -58,6 +58,14 @@ namespace vk
//VkAllocationCallbacks default_callbacks(); //VkAllocationCallbacks default_callbacks();
enum driver_vendor
{
unknown,
AMD,
NVIDIA,
RADV
};
class context; class context;
class render_device; class render_device;
class swap_chain_image; class swap_chain_image;
@ -66,7 +74,8 @@ namespace vk
struct image; struct image;
struct vk_data_heap; struct vk_data_heap;
class mem_allocator_base; class mem_allocator_base;
enum driver_vendor; struct memory_type_mapping;
struct gpu_formats_support;
vk::context *get_current_thread_ctx(); vk::context *get_current_thread_ctx();
void set_current_thread_ctx(const vk::context &ctx); void set_current_thread_ctx(const vk::context &ctx);
@ -93,6 +102,9 @@ namespace vk
VkImageView null_image_view(vk::command_buffer&); VkImageView null_image_view(vk::command_buffer&);
image* get_typeless_helper(VkFormat format); image* get_typeless_helper(VkFormat format);
memory_type_mapping get_memory_mapping(const physical_device& dev);
gpu_formats_support get_optimal_tiling_supported_formats(const physical_device& dev);
//Sync helpers around vkQueueSubmit //Sync helpers around vkQueueSubmit
void acquire_global_submit_lock(); void acquire_global_submit_lock();
void release_global_submit_lock(); void release_global_submit_lock();
@ -143,14 +155,6 @@ namespace vk
void die_with_error(const char* faulting_addr, VkResult error_code); void die_with_error(const char* faulting_addr, VkResult error_code);
enum driver_vendor
{
unknown,
AMD,
NVIDIA,
RADV
};
struct memory_type_mapping struct memory_type_mapping
{ {
uint32_t host_visible_coherent; uint32_t host_visible_coherent;
@ -163,9 +167,6 @@ namespace vk
bool d32_sfloat_s8; bool d32_sfloat_s8;
}; };
memory_type_mapping get_memory_mapping(const physical_device& dev);
gpu_formats_support get_optimal_tiling_supported_formats(const physical_device& dev);
class physical_device class physical_device
{ {
VkPhysicalDevice dev = nullptr; VkPhysicalDevice dev = nullptr;
@ -1310,7 +1311,6 @@ public:
{ {
window_handle = handle; window_handle = handle;
hDstDC = GetDC(handle); hDstDC = GetDC(handle);
init();
} }
void destroy(bool full=true) override void destroy(bool full=true) override
@ -1403,7 +1403,6 @@ public:
} }
gc = DefaultGC(display, DefaultScreen(display)); gc = DefaultGC(display, DefaultScreen(display));
init();
} }
void destroy(bool full=true) override void destroy(bool full=true) override