From 1e818dca4beb660f4953744e5add2b0f53398614 Mon Sep 17 00:00:00 2001 From: Triang3l Date: Thu, 19 Nov 2020 11:38:20 +0300 Subject: [PATCH] [Vulkan] Include Vulkan Android header and fix some warnings --- src/xenia/gpu/vulkan/vulkan_command_processor.cc | 8 ++++---- src/xenia/gpu/vulkan/vulkan_shared_memory.cc | 2 ++ src/xenia/ui/vulkan/vulkan_provider.h | 6 +++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/xenia/gpu/vulkan/vulkan_command_processor.cc b/src/xenia/gpu/vulkan/vulkan_command_processor.cc index 9b4d598f1..5ac052812 100644 --- a/src/xenia/gpu/vulkan/vulkan_command_processor.cc +++ b/src/xenia/gpu/vulkan/vulkan_command_processor.cc @@ -493,7 +493,7 @@ VulkanCommandProcessor::GetPipelineLayout(uint32_t texture_count_pixel, "Failed to create a Vulkan descriptor set layout for {} combined " "images and samplers for guest pixel shaders", texture_count_pixel); - return false; + return nullptr; } descriptor_set_layouts_textures_.emplace( texture_descriptor_set_layout_key.key, @@ -536,7 +536,7 @@ VulkanCommandProcessor::GetPipelineLayout(uint32_t texture_count_pixel, "Failed to create a Vulkan descriptor set layout for {} combined " "images and samplers for guest vertex shaders", texture_count_vertex); - return false; + return nullptr; } descriptor_set_layouts_textures_.emplace( texture_descriptor_set_layout_key.key, @@ -588,7 +588,7 @@ VulkanCommandProcessor::GetPipelineLayout(uint32_t texture_count_pixel, "Failed to create a Vulkan pipeline layout for guest drawing with {} " "pixel shader and {} vertex shader textures", texture_count_pixel, texture_count_vertex); - return false; + return nullptr; } PipelineLayout pipeline_layout_entry; pipeline_layout_entry.pipeline_layout = pipeline_layout; @@ -1650,7 +1650,7 @@ uint8_t* VulkanCommandProcessor::WriteUniformBufferBinding( provider.device_properties().limits.minUniformBufferOffsetAlignment), descriptor_buffer_info_out.buffer, descriptor_buffer_info_out.offset); if (!mapping) { - return false; + return nullptr; } descriptor_buffer_info_out.range = VkDeviceSize(size); write_descriptor_set_out.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; diff --git a/src/xenia/gpu/vulkan/vulkan_shared_memory.cc b/src/xenia/gpu/vulkan/vulkan_shared_memory.cc index 5ee2755f2..0e7a6d66f 100644 --- a/src/xenia/gpu/vulkan/vulkan_shared_memory.cc +++ b/src/xenia/gpu/vulkan/vulkan_shared_memory.cc @@ -467,6 +467,8 @@ void VulkanSharedMemory::GetBarrier(Usage usage, stage_mask = VK_PIPELINE_STAGE_TRANSFER_BIT; access_mask = VK_ACCESS_TRANSFER_WRITE_BIT; return; + default: + break; } stage_mask = VK_PIPELINE_STAGE_VERTEX_INPUT_BIT | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | diff --git a/src/xenia/ui/vulkan/vulkan_provider.h b/src/xenia/ui/vulkan/vulkan_provider.h index b8318fd00..63114d1e0 100644 --- a/src/xenia/ui/vulkan/vulkan_provider.h +++ b/src/xenia/ui/vulkan/vulkan_provider.h @@ -19,7 +19,11 @@ #include "xenia/base/platform.h" #include "xenia/ui/graphics_provider.h" -#if XE_PLATFORM_WIN32 +#if XE_PLATFORM_ANDROID +#ifndef VK_USE_PLATFORM_ANDROID_KHR +#define VK_USE_PLATFORM_ANDROID_KHR 1 +#endif +#elif XE_PLATFORM_WIN32 // Must be included before vulkan.h with VK_USE_PLATFORM_WIN32_KHR because it // includes Windows.h too. #include "xenia/base/platform_win.h"