diff --git a/layersvt/CMakeLists.txt b/layersvt/CMakeLists.txt index a352f2cd28..7832c1d188 100644 --- a/layersvt/CMakeLists.txt +++ b/layersvt/CMakeLists.txt @@ -16,14 +16,20 @@ elseif(APPLE) endif() elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|DragonFly|GNU") option(BUILD_WSI_XCB_SUPPORT "Build XCB WSI support" ON) + option(BUILD_WSI_WAYLAND_SUPPORT "Build WAYLAND WSI support" ON) find_package(PkgConfig REQUIRED) - # TODO: The monitor layer is the only layer that requires XCB support if (BUILD_WSI_XCB_SUPPORT) pkg_check_modules(XCB REQUIRED QUIET IMPORTED_TARGET xcb) add_compile_definitions(VK_USE_PLATFORM_XCB_KHR) endif() + + if (BUILD_WSI_WAYLAND_SUPPORT) + pkg_check_modules(WAYLAND_CLIENT REQUIRED IMPORTED_TARGET wayland-client) + add_compile_definitions(VK_USE_PLATFORM_WAYLAND_KHR) + endif() + else() message(FATAL_ERROR "Unsupported Platform!") endif() @@ -70,10 +76,13 @@ if(BUILD_APIDUMP) ) if(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD|DragonFly|GNU") - target_compile_definitions(VkLayer_api_dump PRIVATE VK_USE_PLATFORM_XLIB_KHR) + if (BUILD_WSI_XCB_SUPPORT) + target_compile_definitions(VkLayer_api_dump PRIVATE VK_USE_PLATFORM_XLIB_KHR) + endif() - # Add Wayland API dump support - # target_compile_definitions(VkLayer_api_dump PRIVATE VK_USE_PLATFORM_XLIB_KHR) + if (BUILD_WSI_WAYLAND_SUPPORT) + target_compile_definitions(VkLayer_api_dump PRIVATE VK_USE_PLATFORM_WAYLAND_KHR) + endif() endif() target_compile_definitions(VkLayer_api_dump PRIVATE VK_ENABLE_BETA_EXTENSIONS) diff --git a/layersvt/generated/api_dump_html.h b/layersvt/generated/api_dump_html.h index f2933c1a6b..b14087f965 100644 --- a/layersvt/generated/api_dump_html.h +++ b/layersvt/generated/api_dump_html.h @@ -340,12 +340,11 @@ void dump_html_wl_display(const wl_display* object, const ApiDumpSettings& setti } #endif // VK_USE_PLATFORM_WAYLAND_KHR #if defined(VK_USE_PLATFORM_WAYLAND_KHR) -void dump_html_wl_surface(const wl_surface object, const ApiDumpSettings& settings, int indents) +void dump_html_wl_surface(const wl_surface* object, const ApiDumpSettings& settings, int indents) { - if (settings.showAddress()) - settings.stream() << "
" << object << "
"; - else - settings.stream() << "
address
"; + settings.stream() << "
"; + OutputAddress(settings, object); + settings.stream() << "
"; } #endif // VK_USE_PLATFORM_WAYLAND_KHR #if defined(VK_USE_PLATFORM_XCB_KHR) @@ -19183,7 +19182,7 @@ void dump_html_VkWaylandSurfaceCreateInfoKHR(const VkWaylandSurfaceCreateInfoKHR } dump_html_value(object.flags, settings, "VkWaylandSurfaceCreateFlagsKHR", "flags", indents + 1, dump_html_VkWaylandSurfaceCreateFlagsKHR); dump_html_value(object.display, settings, "struct wl_display*", "display", indents + 1, dump_html_wl_display); - dump_html_pointer(object.surface, settings, "struct wl_surface*", "surface", indents + 1, dump_html_wl_surface); + dump_html_value(object.surface, settings, "struct wl_surface*", "surface", indents + 1, dump_html_wl_surface); } #endif // VK_USE_PLATFORM_WAYLAND_KHR #if defined(VK_USE_PLATFORM_ANDROID_KHR) diff --git a/layersvt/generated/api_dump_json.h b/layersvt/generated/api_dump_json.h index c2b33fc6d4..d36f3ebfba 100644 --- a/layersvt/generated/api_dump_json.h +++ b/layersvt/generated/api_dump_json.h @@ -323,12 +323,10 @@ void dump_json_wl_display(const wl_display* object, const ApiDumpSettings& setti } #endif // VK_USE_PLATFORM_WAYLAND_KHR #if defined(VK_USE_PLATFORM_WAYLAND_KHR) -void dump_json_wl_surface(const wl_surface object, const ApiDumpSettings& settings, int indents) +void dump_json_wl_surface(const wl_surface* object, const ApiDumpSettings& settings, int indents) { - if (settings.showAddress()) - settings.stream() << "\"" << object << "\""; - else - settings.stream() << "\"address\""; + OutputAddressJSON(settings, object); + settings.stream() << "\n"; } #endif // VK_USE_PLATFORM_WAYLAND_KHR #if defined(VK_USE_PLATFORM_XCB_KHR) @@ -18786,7 +18784,7 @@ void dump_json_VkWaylandSurfaceCreateInfoKHR(const VkWaylandSurfaceCreateInfoKHR settings.stream() << ",\n"; dump_json_value(object.display, NULL, settings, "struct wl_display*", "display", false, false, indents + 1, dump_json_wl_display); settings.stream() << ",\n"; - dump_json_pointer(object.surface, settings, "struct wl_surface*", "surface", false, false, indents + 1, dump_json_wl_surface); + dump_json_value(object.surface, NULL, settings, "struct wl_surface*", "surface", false, false, indents + 1, dump_json_wl_surface); settings.stream() << "\n" << settings.indentation(indents) << "]"; } #endif // VK_USE_PLATFORM_WAYLAND_KHR diff --git a/layersvt/generated/api_dump_text.h b/layersvt/generated/api_dump_text.h index 7cfe1b6520..ee125b3f86 100644 --- a/layersvt/generated/api_dump_text.h +++ b/layersvt/generated/api_dump_text.h @@ -340,12 +340,13 @@ void dump_text_wl_display(const wl_display* object, const ApiDumpSettings& setti } #endif // VK_USE_PLATFORM_WAYLAND_KHR #if defined(VK_USE_PLATFORM_WAYLAND_KHR) -void dump_text_wl_surface(const wl_surface object, const ApiDumpSettings& settings, int indents) +void dump_text_wl_surface(const wl_surface* object, const ApiDumpSettings& settings, int indents) { - if (settings.showAddress()) - settings.stream() << object; - else - settings.stream() << "address"; + if (object == NULL) { + settings.stream() << "NULL"; + return; + } + OutputAddress(settings, object); } #endif // VK_USE_PLATFORM_WAYLAND_KHR #if defined(VK_USE_PLATFORM_XCB_KHR) @@ -17814,7 +17815,7 @@ void dump_text_VkWaylandSurfaceCreateInfoKHR(const VkWaylandSurfaceCreateInfoKHR dump_text_pNext_struct_name(object.pNext, settings, indents + 1, "const void*"); dump_text_value(object.flags, settings, "VkWaylandSurfaceCreateFlagsKHR", "flags", indents + 1, dump_text_VkWaylandSurfaceCreateFlagsKHR); // AET dump_text_value(object.display, settings, "struct wl_display*", "display", indents + 1, dump_text_wl_display); // AET - dump_text_pointer(object.surface, settings, "struct wl_surface*", "surface", indents + 1, dump_text_wl_surface); + dump_text_value(object.surface, settings, "struct wl_surface*", "surface", indents + 1, dump_text_wl_surface); // AET if(object.pNext != nullptr){ dump_text_pNext_trampoline(object.pNext, settings, indents < 2 ? indents + 1 : indents); } diff --git a/layersvt/json/VkLayer_api_dump.json.in b/layersvt/json/VkLayer_api_dump.json.in index 7ca6a927b2..808bb3653f 100644 --- a/layersvt/json/VkLayer_api_dump.json.in +++ b/layersvt/json/VkLayer_api_dump.json.in @@ -312,4 +312,4 @@ ] } } -} +} \ No newline at end of file diff --git a/scripts/api_dump_generator.py b/scripts/api_dump_generator.py index 003d8048fe..1cd21a828a 100644 --- a/scripts/api_dump_generator.py +++ b/scripts/api_dump_generator.py @@ -1555,7 +1555,7 @@ @end function """ -POINTER_TYPES = ['void', 'xcb_connection_t', 'Display', 'SECURITY_ATTRIBUTES', 'ANativeWindow', 'AHardwareBuffer', 'wl_display', '_screen_context', '_screen_window', '_screen_buffer'] +POINTER_TYPES = ['void', 'xcb_connection_t', 'Display', 'SECURITY_ATTRIBUTES', 'ANativeWindow', 'AHardwareBuffer', 'wl_display', 'wl_surface', '_screen_context', '_screen_window', '_screen_buffer'] TRACKED_STATE = { 'vkAllocateCommandBuffers':