[Vulkan] Refactoring and fixes for VulkanProvider and related areas
Enable portability subset physical device enumeration. Don't use Vulkan 1.1+ logical devices on Vulkan 1.0 instances due to the VkApplicationInfo::apiVersion specification. Make sure all extension dependencies are enabled when creating a device. Prefer exposing feature support over extension support via the device interface to avoid causing confusion with regard to promoted extensions (especially those that required some features as extensions, but had those features made optional when they were promoted). Allow creating presentation-only devices, not demanding any optional features beyond the basic Vulkan 1.0, for use cases such as internal tools or CPU rendering. Require the independentBlend feature for GPU emulation as working around is complicated, while support is almost ubiquitous. Move the graphics system initialization fatal error message to xenia_main after attempting to initialize all implementations, for automatic fallback to other implementations in the future. Log Vulkan driver info. Improve Vulkan debug message logging, enabled by default. Refactor code, with simplified logic for enabling extensions and layers.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "xenia/ui/immediate_drawer.h"
|
||||
#include "xenia/ui/vulkan/ui_samplers.h"
|
||||
#include "xenia/ui/vulkan/vulkan_upload_buffer_pool.h"
|
||||
|
||||
namespace xe {
|
||||
@@ -26,14 +27,7 @@ namespace vulkan {
|
||||
class VulkanImmediateDrawer : public ImmediateDrawer {
|
||||
public:
|
||||
static std::unique_ptr<VulkanImmediateDrawer> Create(
|
||||
const VulkanProvider& provider) {
|
||||
auto immediate_drawer = std::unique_ptr<VulkanImmediateDrawer>(
|
||||
new VulkanImmediateDrawer(provider));
|
||||
if (!immediate_drawer->Initialize()) {
|
||||
return nullptr;
|
||||
}
|
||||
return std::move(immediate_drawer);
|
||||
}
|
||||
const VulkanDevice* vulkan_device, const UISamplers* ui_samplers);
|
||||
|
||||
~VulkanImmediateDrawer();
|
||||
|
||||
@@ -96,7 +90,8 @@ class VulkanImmediateDrawer : public ImmediateDrawer {
|
||||
TextureDescriptorPool* recycled_next;
|
||||
};
|
||||
|
||||
VulkanImmediateDrawer(const VulkanProvider& provider) : provider_(provider) {}
|
||||
explicit VulkanImmediateDrawer(const VulkanDevice* vulkan_device,
|
||||
const UISamplers* ui_samplers);
|
||||
bool Initialize();
|
||||
|
||||
bool EnsurePipelinesCreatedForCurrentRenderPass();
|
||||
@@ -117,7 +112,8 @@ class VulkanImmediateDrawer : public ImmediateDrawer {
|
||||
void DestroyTextureResource(VulkanImmediateTexture::Resource& resource);
|
||||
void OnImmediateTextureDestroyed(VulkanImmediateTexture& texture);
|
||||
|
||||
const VulkanProvider& provider_;
|
||||
const VulkanDevice* vulkan_device_;
|
||||
const UISamplers* ui_samplers_;
|
||||
|
||||
// Combined image sampler pools for textures.
|
||||
VkDescriptorSetLayout texture_descriptor_set_layout_;
|
||||
|
||||
Reference in New Issue
Block a user