Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/vulkan-sdk-1.3.275' into ubunt…
Browse files Browse the repository at this point in the history
…u/jammy-unstable
  • Loading branch information
johnzupin committed Jan 16, 2024
2 parents 9ea4be3 + c86d42c commit f130dd6
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 314 deletions.
14 changes: 12 additions & 2 deletions cube/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,15 @@ if(WIN32)
add_compile_definitions(_USE_MATH_DEFINES)
endif()


# On Ubuntu 20.04, it was found that the validation layers fail to launch in vkcube & vkcubepp due to
# a missing dependency on libpthread. While newer Ubuntu versions use a glibc version where libpthread
# is integrated into libc, older ubuntu's do not so we need to link threads directly in order for
# validation layers to be loadable.
if (CMAKE_SYSTEM_NAME MATCHES "Linux|BSD")
find_package(Threads REQUIRED)
endif()

# ----------------------------------------------------------------------------
# vkcube

Expand Down Expand Up @@ -234,7 +243,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD")
if (NEED_RT)
target_link_libraries(vkcube PRIVATE rt)
endif()
target_link_libraries(vkcube PRIVATE Vulkan::Headers volk::volk_headers)
target_link_libraries(vkcube PRIVATE Vulkan::Headers volk::volk_headers Threads::Threads)
elseif(WIN32)
add_executable(vkcube WIN32)
target_sources(vkcube PRIVATE
Expand Down Expand Up @@ -285,7 +294,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|BSD")
cube.vert.inc
cube.frag.inc
${OPTIONAL_WAYLAND_DATA_FILES})
target_link_libraries(vkcubepp Vulkan::Headers volk::volk_headers)
target_link_libraries(vkcubepp Vulkan::Headers volk::volk_headers Threads::Threads)
target_compile_definitions(vkcubepp PUBLIC ${CUBE_PLATFORM})
else()
add_executable(vkcubepp
Expand Down Expand Up @@ -339,6 +348,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux|BSD")
target_link_libraries(vkcube-wayland PRIVATE
Vulkan::Headers
volk::volk_headers
Threads::Threads
PkgConfig::WAYLAND_CLIENT
)
target_compile_definitions(vkcube-wayland PRIVATE VK_USE_PLATFORM_WAYLAND_KHR VK_NO_PROTOTYPES)
Expand Down
2 changes: 1 addition & 1 deletion scripts/known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"cmake_options": [
"-DVOLK_INSTALL=ON"
],
"commit": "vulkan-sdk-1.3.268",
"commit": "vulkan-sdk-1.3.275",
"deps": [
{
"var_name": "VULKAN_HEADERS_INSTALL_DIR",
Expand Down
1 change: 1 addition & 0 deletions vulkaninfo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ endif()
target_link_libraries(vulkaninfo PRIVATE
Vulkan::Headers
${CMAKE_DL_LIBS}
volk::volk_headers
)

if(WIN32)
Expand Down
14 changes: 6 additions & 8 deletions vulkaninfo/vulkaninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,15 @@ void DumpSurfaceCapabilities(Printer &p, AppInstance &inst, AppGpu &gpu, AppSurf
surface_caps2.sType = VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR;
surface_caps2.pNext = &SurfacePresentScalingCapabilitiesEXT;

VkResult err =
inst.ext_funcs.vkGetPhysicalDeviceSurfaceCapabilities2KHR(gpu.phys_device, &surface_info, &surface_caps2);
VkResult err = vkGetPhysicalDeviceSurfaceCapabilities2KHR(gpu.phys_device, &surface_info, &surface_caps2);
if (err != VK_SUCCESS) {
continue;
}

std::vector<VkPresentModeKHR> compatible_present_modes{SurfacePresentModeCompatibilityEXT.presentModeCount};
SurfacePresentModeCompatibilityEXT.pPresentModes = compatible_present_modes.data();

err = inst.ext_funcs.vkGetPhysicalDeviceSurfaceCapabilities2KHR(gpu.phys_device, &surface_info, &surface_caps2);
err = vkGetPhysicalDeviceSurfaceCapabilities2KHR(gpu.phys_device, &surface_info, &surface_caps2);

if (err == VK_SUCCESS) {
ObjectWrapper present_mode_obj(p, VkPresentModeKHRString(mode));
Expand Down Expand Up @@ -355,12 +354,12 @@ void GetAndDumpHostImageCopyPropertiesEXT(Printer &p, AppGpu &gpu) {
VkPhysicalDeviceProperties2KHR props2{};
props2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
props2.pNext = static_cast<void *>(&host_image_copy_properties_ext);
gpu.inst.ext_funcs.vkGetPhysicalDeviceProperties2KHR(gpu.phys_device, &props2);
vkGetPhysicalDeviceProperties2KHR(gpu.phys_device, &props2);
std::vector<VkImageLayout> src_layouts(host_image_copy_properties_ext.copySrcLayoutCount);
host_image_copy_properties_ext.pCopySrcLayouts = src_layouts.data();
std::vector<VkImageLayout> dst_layouts(host_image_copy_properties_ext.copyDstLayoutCount);
host_image_copy_properties_ext.pCopyDstLayouts = dst_layouts.data();
gpu.inst.ext_funcs.vkGetPhysicalDeviceProperties2KHR(gpu.phys_device, &props2);
vkGetPhysicalDeviceProperties2KHR(gpu.phys_device, &props2);
DumpVkPhysicalDeviceHostImageCopyPropertiesEXT(p, "VkPhysicalDeviceHostImageCopyPropertiesEXT", host_image_copy_properties_ext);
}

Expand Down Expand Up @@ -722,7 +721,7 @@ void DumpGpuProfileCapabilities(Printer &p, AppGpu &gpu) {
format_props2.formatProperties = formats.props;
std::unique_ptr<format_properties2_chain> chain_for_format_props2;
setup_format_properties2_chain(format_props2, chain_for_format_props2, gpu);
gpu.inst.ext_funcs.vkGetPhysicalDeviceFormatProperties2KHR(gpu.phys_device, fmt, &format_props2);
vkGetPhysicalDeviceFormatProperties2KHR(gpu.phys_device, fmt, &format_props2);
chain_iterator_format_properties2(p, gpu, format_props2.pNext);
}
already_printed_formats.insert(fmt);
Expand Down Expand Up @@ -1191,8 +1190,7 @@ int main(int argc, char **argv) {
try {
// check if the surface is supported by the physical device before adding it to the list
VkBool32 supported = VK_FALSE;
VkResult err = instance.ext_funcs.vkGetPhysicalDeviceSurfaceSupportKHR(gpu->phys_device, 0,
surface_extension.surface, &supported);
VkResult err = vkGetPhysicalDeviceSurfaceSupportKHR(gpu->phys_device, 0, surface_extension.surface, &supported);
if (err != VK_SUCCESS || supported == VK_FALSE) continue;

surfaces.push_back(
Expand Down
Loading

0 comments on commit f130dd6

Please sign in to comment.