summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.cpp24
-rw-r--r--src/video_core/renderer_vulkan/renderer_vulkan.h2
-rw-r--r--src/video_core/renderer_vulkan/vk_device.cpp73
-rw-r--r--src/video_core/renderer_vulkan/vk_device.h12
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp12
-rw-r--r--src/video_core/renderer_vulkan/wrapper.cpp23
-rw-r--r--src/video_core/renderer_vulkan/wrapper.h4
7 files changed, 92 insertions, 58 deletions
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.cpp b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
index 715182b3b..f2610868e 100644
--- a/src/video_core/renderer_vulkan/renderer_vulkan.cpp
+++ b/src/video_core/renderer_vulkan/renderer_vulkan.cpp
@@ -92,9 +92,9 @@ Common::DynamicLibrary OpenVulkanLibrary() {
92 return library; 92 return library;
93} 93}
94 94
95vk::Instance CreateInstance(Common::DynamicLibrary& library, vk::InstanceDispatch& dld, 95std::pair<vk::Instance, u32> CreateInstance(
96 WindowSystemType window_type = WindowSystemType::Headless, 96 Common::DynamicLibrary& library, vk::InstanceDispatch& dld,
97 bool enable_layers = false) { 97 WindowSystemType window_type = WindowSystemType::Headless, bool enable_layers = false) {
98 if (!library.IsOpen()) { 98 if (!library.IsOpen()) {
99 LOG_ERROR(Render_Vulkan, "Vulkan library not available"); 99 LOG_ERROR(Render_Vulkan, "Vulkan library not available");
100 return {}; 100 return {};
@@ -180,7 +180,10 @@ vk::Instance CreateInstance(Common::DynamicLibrary& library, vk::InstanceDispatc
180 } 180 }
181 } 181 }
182 182
183 vk::Instance instance = vk::Instance::Create(layers, extensions, dld); 183 // Limit the maximum version of Vulkan to avoid using untested version.
184 const u32 version = std::min(vk::AvailableVersion(dld), static_cast<u32>(VK_API_VERSION_1_1));
185
186 vk::Instance instance = vk::Instance::Create(version, layers, extensions, dld);
184 if (!instance) { 187 if (!instance) {
185 LOG_ERROR(Render_Vulkan, "Failed to create Vulkan instance"); 188 LOG_ERROR(Render_Vulkan, "Failed to create Vulkan instance");
186 return {}; 189 return {};
@@ -188,7 +191,7 @@ vk::Instance CreateInstance(Common::DynamicLibrary& library, vk::InstanceDispatc
188 if (!vk::Load(*instance, dld)) { 191 if (!vk::Load(*instance, dld)) {
189 LOG_ERROR(Render_Vulkan, "Failed to load Vulkan instance function pointers"); 192 LOG_ERROR(Render_Vulkan, "Failed to load Vulkan instance function pointers");
190 } 193 }
191 return instance; 194 return std::make_pair(std::move(instance), version);
192} 195}
193 196
194std::string GetReadableVersion(u32 version) { 197std::string GetReadableVersion(u32 version) {
@@ -285,8 +288,8 @@ void RendererVulkan::SwapBuffers(const Tegra::FramebufferConfig* framebuffer) {
285 288
286bool RendererVulkan::Init() { 289bool RendererVulkan::Init() {
287 library = OpenVulkanLibrary(); 290 library = OpenVulkanLibrary();
288 instance = CreateInstance(library, dld, render_window.GetWindowInfo().type, 291 std::tie(instance, instance_version) = CreateInstance(
289 Settings::values.renderer_debug); 292 library, dld, render_window.GetWindowInfo().type, Settings::values.renderer_debug);
290 if (!instance || !CreateDebugCallback() || !CreateSurface() || !PickDevices()) { 293 if (!instance || !CreateDebugCallback() || !CreateSurface() || !PickDevices()) {
291 return false; 294 return false;
292 } 295 }
@@ -416,7 +419,8 @@ bool RendererVulkan::PickDevices() {
416 return false; 419 return false;
417 } 420 }
418 421
419 device = std::make_unique<VKDevice>(*instance, physical_device, *surface, dld); 422 device =
423 std::make_unique<VKDevice>(*instance, instance_version, physical_device, *surface, dld);
420 return device->Create(); 424 return device->Create();
421} 425}
422 426
@@ -426,7 +430,7 @@ void RendererVulkan::Report() const {
426 const std::string driver_version = GetDriverVersion(*device); 430 const std::string driver_version = GetDriverVersion(*device);
427 const std::string driver_name = fmt::format("{} {}", vendor_name, driver_version); 431 const std::string driver_name = fmt::format("{} {}", vendor_name, driver_version);
428 432
429 const std::string api_version = GetReadableVersion(device->GetApiVersion()); 433 const std::string api_version = GetReadableVersion(device->ApiVersion());
430 434
431 const std::string extensions = BuildCommaSeparatedExtensions(device->GetAvailableExtensions()); 435 const std::string extensions = BuildCommaSeparatedExtensions(device->GetAvailableExtensions());
432 436
@@ -445,7 +449,7 @@ void RendererVulkan::Report() const {
445std::vector<std::string> RendererVulkan::EnumerateDevices() { 449std::vector<std::string> RendererVulkan::EnumerateDevices() {
446 vk::InstanceDispatch dld; 450 vk::InstanceDispatch dld;
447 Common::DynamicLibrary library = OpenVulkanLibrary(); 451 Common::DynamicLibrary library = OpenVulkanLibrary();
448 vk::Instance instance = CreateInstance(library, dld); 452 vk::Instance instance = CreateInstance(library, dld).first;
449 if (!instance) { 453 if (!instance) {
450 return {}; 454 return {};
451 } 455 }
diff --git a/src/video_core/renderer_vulkan/renderer_vulkan.h b/src/video_core/renderer_vulkan/renderer_vulkan.h
index 49a4141ec..1044ca124 100644
--- a/src/video_core/renderer_vulkan/renderer_vulkan.h
+++ b/src/video_core/renderer_vulkan/renderer_vulkan.h
@@ -73,6 +73,8 @@ private:
73 vk::InstanceDispatch dld; 73 vk::InstanceDispatch dld;
74 74
75 vk::Instance instance; 75 vk::Instance instance;
76 u32 instance_version{};
77
76 vk::SurfaceKHR surface; 78 vk::SurfaceKHR surface;
77 79
78 VKScreenInfo screen_info; 80 VKScreenInfo screen_info;
diff --git a/src/video_core/renderer_vulkan/vk_device.cpp b/src/video_core/renderer_vulkan/vk_device.cpp
index 1f057b43b..e1217ca83 100644
--- a/src/video_core/renderer_vulkan/vk_device.cpp
+++ b/src/video_core/renderer_vulkan/vk_device.cpp
@@ -38,6 +38,9 @@ constexpr std::array Depth16UnormS8_UINT{
38 38
39constexpr std::array REQUIRED_EXTENSIONS{ 39constexpr std::array REQUIRED_EXTENSIONS{
40 VK_KHR_SWAPCHAIN_EXTENSION_NAME, 40 VK_KHR_SWAPCHAIN_EXTENSION_NAME,
41 VK_KHR_MAINTENANCE1_EXTENSION_NAME,
42 VK_KHR_STORAGE_BUFFER_STORAGE_CLASS_EXTENSION_NAME,
43 VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME,
41 VK_KHR_16BIT_STORAGE_EXTENSION_NAME, 44 VK_KHR_16BIT_STORAGE_EXTENSION_NAME,
42 VK_KHR_8BIT_STORAGE_EXTENSION_NAME, 45 VK_KHR_8BIT_STORAGE_EXTENSION_NAME,
43 VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, 46 VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME,
@@ -187,10 +190,10 @@ std::unordered_map<VkFormat, VkFormatProperties> GetFormatProperties(
187 190
188} // Anonymous namespace 191} // Anonymous namespace
189 192
190VKDevice::VKDevice(VkInstance instance, vk::PhysicalDevice physical, VkSurfaceKHR surface, 193VKDevice::VKDevice(VkInstance instance_, u32 instance_version_, vk::PhysicalDevice physical_,
191 const vk::InstanceDispatch& dld) 194 VkSurfaceKHR surface, const vk::InstanceDispatch& dld_)
192 : dld{dld}, physical{physical}, properties{physical.GetProperties()}, 195 : dld{dld_}, physical{physical_}, properties{physical.GetProperties()},
193 format_properties{GetFormatProperties(physical, dld)} { 196 instance_version{instance_version_}, format_properties{GetFormatProperties(physical, dld)} {
194 SetupFamilies(surface); 197 SetupFamilies(surface);
195 SetupFeatures(); 198 SetupFeatures();
196} 199}
@@ -597,20 +600,6 @@ bool VKDevice::IsSuitable(vk::PhysicalDevice physical, VkSurfaceKHR surface) {
597 600
598std::vector<const char*> VKDevice::LoadExtensions() { 601std::vector<const char*> VKDevice::LoadExtensions() {
599 std::vector<const char*> extensions; 602 std::vector<const char*> extensions;
600 const auto Test = [&](const VkExtensionProperties& extension,
601 std::optional<std::reference_wrapper<bool>> status, const char* name,
602 bool push) {
603 if (extension.extensionName != std::string_view(name)) {
604 return;
605 }
606 if (push) {
607 extensions.push_back(name);
608 }
609 if (status) {
610 status->get() = true;
611 }
612 };
613
614 extensions.reserve(7 + REQUIRED_EXTENSIONS.size()); 603 extensions.reserve(7 + REQUIRED_EXTENSIONS.size());
615 extensions.insert(extensions.begin(), REQUIRED_EXTENSIONS.begin(), REQUIRED_EXTENSIONS.end()); 604 extensions.insert(extensions.begin(), REQUIRED_EXTENSIONS.begin(), REQUIRED_EXTENSIONS.end());
616 605
@@ -619,28 +608,36 @@ std::vector<const char*> VKDevice::LoadExtensions() {
619 bool has_ext_transform_feedback{}; 608 bool has_ext_transform_feedback{};
620 bool has_ext_custom_border_color{}; 609 bool has_ext_custom_border_color{};
621 bool has_ext_extended_dynamic_state{}; 610 bool has_ext_extended_dynamic_state{};
622 for (const auto& extension : physical.EnumerateDeviceExtensionProperties()) { 611 for (const VkExtensionProperties& extension : physical.EnumerateDeviceExtensionProperties()) {
623 Test(extension, nv_viewport_swizzle, VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME, true); 612 const auto test = [&](std::optional<std::reference_wrapper<bool>> status, const char* name,
624 Test(extension, khr_uniform_buffer_standard_layout, 613 bool push) {
614 if (extension.extensionName != std::string_view(name)) {
615 return;
616 }
617 if (push) {
618 extensions.push_back(name);
619 }
620 if (status) {
621 status->get() = true;
622 }
623 };
624 test(nv_viewport_swizzle, VK_NV_VIEWPORT_SWIZZLE_EXTENSION_NAME, true);
625 test(khr_uniform_buffer_standard_layout,
625 VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME, true); 626 VK_KHR_UNIFORM_BUFFER_STANDARD_LAYOUT_EXTENSION_NAME, true);
626 Test(extension, has_khr_shader_float16_int8, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, 627 test(has_khr_shader_float16_int8, VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME, false);
627 false); 628 test(ext_depth_range_unrestricted, VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME, true);
628 Test(extension, ext_depth_range_unrestricted, 629 test(ext_index_type_uint8, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME, true);
629 VK_EXT_DEPTH_RANGE_UNRESTRICTED_EXTENSION_NAME, true); 630 test(ext_shader_viewport_index_layer, VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME,
630 Test(extension, ext_index_type_uint8, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME, true); 631 true);
631 Test(extension, ext_shader_viewport_index_layer, 632 test(has_ext_transform_feedback, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, false);
632 VK_EXT_SHADER_VIEWPORT_INDEX_LAYER_EXTENSION_NAME, true); 633 test(has_ext_custom_border_color, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, false);
633 Test(extension, has_ext_subgroup_size_control, VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, 634 test(has_ext_extended_dynamic_state, VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, false);
634 false); 635 if (instance_version >= VK_API_VERSION_1_1) {
635 Test(extension, has_ext_transform_feedback, VK_EXT_TRANSFORM_FEEDBACK_EXTENSION_NAME, 636 test(has_ext_subgroup_size_control, VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME, false);
636 false); 637 }
637 Test(extension, has_ext_custom_border_color, VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME,
638 false);
639 Test(extension, has_ext_extended_dynamic_state,
640 VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, false);
641 if (Settings::values.renderer_debug) { 638 if (Settings::values.renderer_debug) {
642 Test(extension, nv_device_diagnostics_config, 639 test(nv_device_diagnostics_config, VK_NV_DEVICE_DIAGNOSTICS_CONFIG_EXTENSION_NAME,
643 VK_NV_DEVICE_DIAGNOSTICS_CONFIG_EXTENSION_NAME, true); 640 true);
644 } 641 }
645 } 642 }
646 643
diff --git a/src/video_core/renderer_vulkan/vk_device.h b/src/video_core/renderer_vulkan/vk_device.h
index 26a233db1..4286673d9 100644
--- a/src/video_core/renderer_vulkan/vk_device.h
+++ b/src/video_core/renderer_vulkan/vk_device.h
@@ -24,8 +24,8 @@ const u32 GuestWarpSize = 32;
24/// Handles data specific to a physical device. 24/// Handles data specific to a physical device.
25class VKDevice final { 25class VKDevice final {
26public: 26public:
27 explicit VKDevice(VkInstance instance, vk::PhysicalDevice physical, VkSurfaceKHR surface, 27 explicit VKDevice(VkInstance instance, u32 instance_version, vk::PhysicalDevice physical,
28 const vk::InstanceDispatch& dld); 28 VkSurfaceKHR surface, const vk::InstanceDispatch& dld);
29 ~VKDevice(); 29 ~VKDevice();
30 30
31 /// Initializes the device. Returns true on success. 31 /// Initializes the device. Returns true on success.
@@ -82,8 +82,13 @@ public:
82 return present_family; 82 return present_family;
83 } 83 }
84 84
85 /// Returns the current instance Vulkan API version in Vulkan-formatted version numbers.
86 u32 InstanceApiVersion() const {
87 return instance_version;
88 }
89
85 /// Returns the current Vulkan API version provided in Vulkan-formatted version numbers. 90 /// Returns the current Vulkan API version provided in Vulkan-formatted version numbers.
86 u32 GetApiVersion() const { 91 u32 ApiVersion() const {
87 return properties.apiVersion; 92 return properties.apiVersion;
88 } 93 }
89 94
@@ -239,6 +244,7 @@ private:
239 vk::Device logical; ///< Logical device. 244 vk::Device logical; ///< Logical device.
240 vk::Queue graphics_queue; ///< Main graphics queue. 245 vk::Queue graphics_queue; ///< Main graphics queue.
241 vk::Queue present_queue; ///< Main present queue. 246 vk::Queue present_queue; ///< Main present queue.
247 u32 instance_version{}; ///< Vulkan onstance version.
242 u32 graphics_family{}; ///< Main graphics queue family index. 248 u32 graphics_family{}; ///< Main graphics queue family index.
243 u32 present_family{}; ///< Main present queue family index. 249 u32 present_family{}; ///< Main present queue family index.
244 VkDriverIdKHR driver_id{}; ///< Driver ID. 250 VkDriverIdKHR driver_id{}; ///< Driver ID.
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
index cd7d7a4e4..a20452b87 100644
--- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
+++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
@@ -272,12 +272,19 @@ bool IsPrecise(Operation operand) {
272 return false; 272 return false;
273} 273}
274 274
275u32 ShaderVersion(const VKDevice& device) {
276 if (device.InstanceApiVersion() < VK_API_VERSION_1_1) {
277 return 0x00010000;
278 }
279 return 0x00010300;
280}
281
275class SPIRVDecompiler final : public Sirit::Module { 282class SPIRVDecompiler final : public Sirit::Module {
276public: 283public:
277 explicit SPIRVDecompiler(const VKDevice& device, const ShaderIR& ir, ShaderType stage, 284 explicit SPIRVDecompiler(const VKDevice& device, const ShaderIR& ir, ShaderType stage,
278 const Registry& registry, const Specialization& specialization) 285 const Registry& registry, const Specialization& specialization)
279 : Module(0x00010300), device{device}, ir{ir}, stage{stage}, header{ir.GetHeader()}, 286 : Module(ShaderVersion(device)), device{device}, ir{ir}, stage{stage},
280 registry{registry}, specialization{specialization} { 287 header{ir.GetHeader()}, registry{registry}, specialization{specialization} {
281 if (stage != ShaderType::Compute) { 288 if (stage != ShaderType::Compute) {
282 transform_feedback = BuildTransformFeedback(registry.GetGraphicsInfo()); 289 transform_feedback = BuildTransformFeedback(registry.GetGraphicsInfo());
283 } 290 }
@@ -293,6 +300,7 @@ public:
293 AddCapability(spv::Capability::DrawParameters); 300 AddCapability(spv::Capability::DrawParameters);
294 AddCapability(spv::Capability::SubgroupBallotKHR); 301 AddCapability(spv::Capability::SubgroupBallotKHR);
295 AddCapability(spv::Capability::SubgroupVoteKHR); 302 AddCapability(spv::Capability::SubgroupVoteKHR);
303 AddExtension("SPV_KHR_16bit_storage");
296 AddExtension("SPV_KHR_shader_ballot"); 304 AddExtension("SPV_KHR_shader_ballot");
297 AddExtension("SPV_KHR_subgroup_vote"); 305 AddExtension("SPV_KHR_subgroup_vote");
298 AddExtension("SPV_KHR_storage_buffer_storage_class"); 306 AddExtension("SPV_KHR_storage_buffer_storage_class");
diff --git a/src/video_core/renderer_vulkan/wrapper.cpp b/src/video_core/renderer_vulkan/wrapper.cpp
index 2598440fb..c034558a3 100644
--- a/src/video_core/renderer_vulkan/wrapper.cpp
+++ b/src/video_core/renderer_vulkan/wrapper.cpp
@@ -11,6 +11,7 @@
11#include <vector> 11#include <vector>
12 12
13#include "common/common_types.h" 13#include "common/common_types.h"
14#include "common/logging/log.h"
14 15
15#include "video_core/renderer_vulkan/wrapper.h" 16#include "video_core/renderer_vulkan/wrapper.h"
16 17
@@ -415,18 +416,17 @@ VkResult Free(VkDevice device, VkCommandPool handle, Span<VkCommandBuffer> buffe
415 return VK_SUCCESS; 416 return VK_SUCCESS;
416} 417}
417 418
418Instance Instance::Create(Span<const char*> layers, Span<const char*> extensions, 419Instance Instance::Create(u32 version, Span<const char*> layers, Span<const char*> extensions,
419 InstanceDispatch& dld) noexcept { 420 InstanceDispatch& dld) noexcept {
420 static constexpr VkApplicationInfo application_info{ 421 const VkApplicationInfo application_info{
421 .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO, 422 .sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
422 .pNext = nullptr, 423 .pNext = nullptr,
423 .pApplicationName = "yuzu Emulator", 424 .pApplicationName = "yuzu Emulator",
424 .applicationVersion = VK_MAKE_VERSION(0, 1, 0), 425 .applicationVersion = VK_MAKE_VERSION(0, 1, 0),
425 .pEngineName = "yuzu Emulator", 426 .pEngineName = "yuzu Emulator",
426 .engineVersion = VK_MAKE_VERSION(0, 1, 0), 427 .engineVersion = VK_MAKE_VERSION(0, 1, 0),
427 .apiVersion = VK_API_VERSION_1_1, 428 .apiVersion = version,
428 }; 429 };
429
430 const VkInstanceCreateInfo ci{ 430 const VkInstanceCreateInfo ci{
431 .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO, 431 .sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
432 .pNext = nullptr, 432 .pNext = nullptr,
@@ -818,6 +818,21 @@ VkPhysicalDeviceMemoryProperties PhysicalDevice::GetMemoryProperties() const noe
818 return properties; 818 return properties;
819} 819}
820 820
821u32 AvailableVersion(const InstanceDispatch& dld) noexcept {
822 PFN_vkEnumerateInstanceVersion vkEnumerateInstanceVersion;
823 if (!Proc(vkEnumerateInstanceVersion, dld, "vkEnumerateInstanceVersion")) {
824 // If the procedure is not found, Vulkan 1.0 is assumed
825 return VK_API_VERSION_1_0;
826 }
827 u32 version;
828 if (const VkResult result = vkEnumerateInstanceVersion(&version); result != VK_SUCCESS) {
829 LOG_ERROR(Render_Vulkan, "vkEnumerateInstanceVersion returned {}, assuming Vulkan 1.1",
830 ToString(result));
831 return VK_API_VERSION_1_1;
832 }
833 return version;
834}
835
821std::optional<std::vector<VkExtensionProperties>> EnumerateInstanceExtensionProperties( 836std::optional<std::vector<VkExtensionProperties>> EnumerateInstanceExtensionProperties(
822 const InstanceDispatch& dld) { 837 const InstanceDispatch& dld) {
823 u32 num; 838 u32 num;
diff --git a/src/video_core/renderer_vulkan/wrapper.h b/src/video_core/renderer_vulkan/wrapper.h
index 234e01693..f64919623 100644
--- a/src/video_core/renderer_vulkan/wrapper.h
+++ b/src/video_core/renderer_vulkan/wrapper.h
@@ -564,7 +564,7 @@ class Instance : public Handle<VkInstance, NoOwner, InstanceDispatch> {
564 564
565public: 565public:
566 /// Creates a Vulkan instance. Use "operator bool" for error handling. 566 /// Creates a Vulkan instance. Use "operator bool" for error handling.
567 static Instance Create(Span<const char*> layers, Span<const char*> extensions, 567 static Instance Create(u32 version, Span<const char*> layers, Span<const char*> extensions,
568 InstanceDispatch& dld) noexcept; 568 InstanceDispatch& dld) noexcept;
569 569
570 /// Enumerates physical devices. 570 /// Enumerates physical devices.
@@ -1090,6 +1090,8 @@ private:
1090 const DeviceDispatch* dld; 1090 const DeviceDispatch* dld;
1091}; 1091};
1092 1092
1093u32 AvailableVersion(const InstanceDispatch& dld) noexcept;
1094
1093std::optional<std::vector<VkExtensionProperties>> EnumerateInstanceExtensionProperties( 1095std::optional<std::vector<VkExtensionProperties>> EnumerateInstanceExtensionProperties(
1094 const InstanceDispatch& dld); 1096 const InstanceDispatch& dld);
1095 1097