early-access version 3289
This commit is contained in:
@@ -1472,7 +1472,7 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) {
|
||||
is_patch_list_restart_supported =
|
||||
primitive_topology_list_restart.primitiveTopologyPatchListRestart;
|
||||
}
|
||||
if (requires_surface && has_khr_image_format_list && has_khr_swapchain_mutable_format) {
|
||||
if (has_khr_image_format_list && has_khr_swapchain_mutable_format) {
|
||||
extensions.push_back(VK_KHR_IMAGE_FORMAT_LIST_EXTENSION_NAME);
|
||||
extensions.push_back(VK_KHR_SWAPCHAIN_MUTABLE_FORMAT_EXTENSION_NAME);
|
||||
khr_swapchain_mutable_format = true;
|
||||
@@ -1487,6 +1487,9 @@ std::vector<const char*> Device::LoadExtensions(bool requires_surface) {
|
||||
|
||||
max_push_descriptors = push_descriptor.maxPushDescriptors;
|
||||
}
|
||||
|
||||
has_null_descriptor = true;
|
||||
|
||||
return extensions;
|
||||
}
|
||||
|
||||
|
@@ -397,6 +397,10 @@ public:
|
||||
return must_emulate_bgr565;
|
||||
}
|
||||
|
||||
bool HasNullDescriptor() const {
|
||||
return has_null_descriptor;
|
||||
}
|
||||
|
||||
u32 GetMaxVertexInputAttributes() const {
|
||||
return max_vertex_input_attributes;
|
||||
}
|
||||
@@ -511,6 +515,7 @@ private:
|
||||
bool supports_d24_depth{}; ///< Supports D24 depth buffers.
|
||||
bool cant_blit_msaa{}; ///< Does not support MSAA<->MSAA blitting.
|
||||
bool must_emulate_bgr565{}; ///< Emulates BGR565 by swizzling RGB565 format.
|
||||
bool has_null_descriptor{}; ///< Has support for null descriptors.
|
||||
u32 max_vertex_input_attributes{}; ///< Max vertex input attributes in pipeline
|
||||
u32 max_vertex_input_bindings{}; ///< Max vertex input buffers in pipeline
|
||||
|
||||
|
@@ -32,7 +32,7 @@
|
||||
namespace Vulkan {
|
||||
namespace {
|
||||
[[nodiscard]] std::vector<const char*> RequiredExtensions(
|
||||
Core::Frontend::WindowSystemType window_type, bool enable_debug_utils) {
|
||||
Core::Frontend::WindowSystemType window_type, bool enable_validation) {
|
||||
std::vector<const char*> extensions;
|
||||
extensions.reserve(6);
|
||||
switch (window_type) {
|
||||
@@ -65,7 +65,7 @@ namespace {
|
||||
if (window_type != Core::Frontend::WindowSystemType::Headless) {
|
||||
extensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME);
|
||||
}
|
||||
if (enable_debug_utils) {
|
||||
if (enable_validation) {
|
||||
extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
|
||||
}
|
||||
extensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
|
||||
@@ -95,9 +95,9 @@ namespace {
|
||||
return true;
|
||||
}
|
||||
|
||||
[[nodiscard]] std::vector<const char*> Layers(bool enable_layers) {
|
||||
[[nodiscard]] std::vector<const char*> Layers(bool enable_validation) {
|
||||
std::vector<const char*> layers;
|
||||
if (enable_layers) {
|
||||
if (enable_validation) {
|
||||
layers.push_back("VK_LAYER_KHRONOS_validation");
|
||||
}
|
||||
return layers;
|
||||
@@ -125,7 +125,7 @@ void RemoveUnavailableLayers(const vk::InstanceDispatch& dld, std::vector<const
|
||||
|
||||
vk::Instance CreateInstance(const Common::DynamicLibrary& library, vk::InstanceDispatch& dld,
|
||||
u32 required_version, Core::Frontend::WindowSystemType window_type,
|
||||
bool enable_debug_utils, bool enable_layers) {
|
||||
bool enable_validation) {
|
||||
if (!library.IsOpen()) {
|
||||
LOG_ERROR(Render_Vulkan, "Vulkan library not available");
|
||||
throw vk::Exception(VK_ERROR_INITIALIZATION_FAILED);
|
||||
@@ -138,11 +138,11 @@ vk::Instance CreateInstance(const Common::DynamicLibrary& library, vk::InstanceD
|
||||
LOG_ERROR(Render_Vulkan, "Failed to load Vulkan function pointers");
|
||||
throw vk::Exception(VK_ERROR_INITIALIZATION_FAILED);
|
||||
}
|
||||
const std::vector<const char*> extensions = RequiredExtensions(window_type, enable_debug_utils);
|
||||
const std::vector<const char*> extensions = RequiredExtensions(window_type, enable_validation);
|
||||
if (!AreExtensionsSupported(dld, extensions)) {
|
||||
throw vk::Exception(VK_ERROR_EXTENSION_NOT_PRESENT);
|
||||
}
|
||||
std::vector<const char*> layers = Layers(enable_layers);
|
||||
std::vector<const char*> layers = Layers(enable_validation);
|
||||
RemoveUnavailableLayers(dld, layers);
|
||||
|
||||
const u32 available_version = vk::AvailableVersion(dld);
|
||||
|
@@ -17,8 +17,7 @@ namespace Vulkan {
|
||||
* @param dld Dispatch table to load function pointers into
|
||||
* @param required_version Required Vulkan version (for example, VK_API_VERSION_1_1)
|
||||
* @param window_type Window system type's enabled extension
|
||||
* @param enable_debug_utils Whether to enable VK_EXT_debug_utils_extension_name or not
|
||||
* @param enable_layers Whether to enable Vulkan validation layers or not
|
||||
* @param enable_validation Whether to enable Vulkan validation layers or not
|
||||
*
|
||||
* @return A new Vulkan instance
|
||||
* @throw vk::Exception on failure
|
||||
@@ -26,6 +25,6 @@ namespace Vulkan {
|
||||
[[nodiscard]] vk::Instance CreateInstance(
|
||||
const Common::DynamicLibrary& library, vk::InstanceDispatch& dld, u32 required_version,
|
||||
Core::Frontend::WindowSystemType window_type = Core::Frontend::WindowSystemType::Headless,
|
||||
bool enable_debug_utils = false, bool enable_layers = false);
|
||||
bool enable_validation = false);
|
||||
|
||||
} // namespace Vulkan
|
||||
|
Reference in New Issue
Block a user