Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/vulkan-sdk-1.3.280' into ubunt…
Browse files Browse the repository at this point in the history
…u/jammy-unstable
  • Loading branch information
johnzupin committed Mar 12, 2024
2 parents dca7823 + 61a9c50 commit 1a7a532
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 13 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/init@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -68,7 +68,7 @@ jobs:
# If this step fails, then you should remove it and run the build manually
- name: Autobuild
if: matrix.language == 'python'
uses: github/codeql-action/autobuild@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/autobuild@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6

- uses: actions/setup-python@v5
if: matrix.language == 'cpp'
Expand Down Expand Up @@ -96,6 +96,6 @@ jobs:
run: cmake --build build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@379614612a29c9e28f31f39a59013eb8012a51f0 # v3.24.3
uses: github/codeql-action/analyze@8a470fddafa5cbb6266ee11b37ef4d8aae19c571 # v3.24.6
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# ~~~
cmake_minimum_required(VERSION 3.17.2)

project(VULKAN_LOADER VERSION 1.3.278 LANGUAGES C)
project(VULKAN_LOADER VERSION 1.3.280 LANGUAGES C)

# This variable enables downstream users to customize the target API
# variant (e.g. Vulkan SC)
Expand Down
2 changes: 1 addition & 1 deletion docs/LoaderDriverInterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ AppX/MSIX packages.
If a package is found, the loader will scan the root directory of this installed
package for JSON manifest files. At this time, the only package that is known is
Microsoft's
[OpenCL™ and OpenGL® Compatibility Pack](https://apps.microsoft.com/store/detail/9NQPSL29BFFF?hl=en-us&gl=US).
[OpenCL™, OpenGL®, and Vulkan® Compatibility Pack](https://apps.microsoft.com/store/detail/9NQPSL29BFFF?hl=en-us&gl=US).

The Vulkan loader will open each enabled manifest file found to obtain the name
or pathname of a driver's shared library (".DLL") file.
Expand Down
7 changes: 7 additions & 0 deletions docs/LoaderLayerInterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ distributed as part of a driver installation.
An application installer should not modify the device-specific registries,
while a device driver should not modify the system registries.

Additionally, the Vulkan loader will scan the system for well-known Windows
AppX/MSIX packages.
If a package is found, the loader will scan the root directory of this installed
package for JSON manifest files. At this time, the only package that is known is
Microsoft's
[OpenCL™, OpenGL®, and Vulkan® Compatibility Pack](https://apps.microsoft.com/store/detail/9NQPSL29BFFF?hl=en-us&gl=US).

The Vulkan loader will open each manifest file to obtain information about the
layer, including the name or pathname of a shared library (".dll") file.

Expand Down
2 changes: 2 additions & 0 deletions loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ else()
FRAMEWORK TRUE
FRAMEWORK_VERSION A
VERSION "${VULKAN_LOADER_VERSION}"
MACOSX_FRAMEWORK_BUNDLE_VERSION "${VULKAN_LOADER_VERSION}"
MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${VULKAN_LOADER_VERSION}"
SOVERSION "1.0.0"
MACOSX_FRAMEWORK_IDENTIFIER com.lunarg.vulkanFramework
PUBLIC_HEADER "${FRAMEWORK_HEADERS}"
Expand Down
3 changes: 3 additions & 0 deletions loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -3038,6 +3038,9 @@ VkResult read_data_files_in_search_paths(const struct loader_instance *inst, enu
case LOADER_DATA_FILE_MANIFEST_IMPLICIT_LAYER:
#if COMMON_UNIX_PLATFORMS
relative_location = VK_ILAYERS_INFO_RELATIVE_DIR;
#endif
#if defined(_WIN32)
package_path = windows_get_app_package_manifest_path(inst);
#endif
break;
case LOADER_DATA_FILE_MANIFEST_EXPLICIT_LAYER:
Expand Down
4 changes: 2 additions & 2 deletions loader/loader.rc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "winres.h"

// All set through CMake
#define VER_FILE_VERSION 1, 3, 278, 0
#define VER_FILE_DESCRIPTION_STR "1.3.278.Dev Build"
#define VER_FILE_VERSION 1, 3, 280, 0
#define VER_FILE_DESCRIPTION_STR "1.3.280.Dev Build"
#define VER_FILE_VERSION_STR "Vulkan Loader - Dev Build"
#define VER_COPYRIGHT_STR "Copyright (C) 2015-2024"

Expand Down
6 changes: 2 additions & 4 deletions loader/loader_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,10 +1110,8 @@ char *windows_get_app_package_manifest_path(const struct loader_instance *inst)
}

UINT32 numPackages = 0, bufferLength = 0;
/* This literal string identifies the Microsoft-published OpenCL and OpenGL Compatibility Pack
* (so named at the time this is being added), which contains OpenGLOn12 and OpenCLOn12 mapping
* layers, and will contain VulkanOn12 (aka Dozen) going forward.
*/
// This literal string identifies the Microsoft-published OpenCL, OpenGL, and Vulkan Compatibility Pack, which contains
// OpenGLOn12, OpenCLOn12, and VulkanOn12 (aka Dozen) mappinglayers
PCWSTR familyName = L"Microsoft.D3DMappingLayers_8wekyb3d8bbwe";
if (ERROR_INSUFFICIENT_BUFFER != fpGetPackagesByPackageFamily(familyName, &numPackages, NULL, &bufferLength, NULL) ||
numPackages == 0 || bufferLength == 0) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"sub_dir": "Vulkan-Headers",
"build_dir": "Vulkan-Headers/build",
"install_dir": "Vulkan-Headers/build/install",
"commit": "v1.3.278"
"commit": "v1.3.280"
},
{
"name": "googletest",
Expand Down
8 changes: 8 additions & 0 deletions tests/framework/test_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,9 @@ void FrameworkEnvironment::add_layer_impl(TestLayerDetails layer_details, Manife
case (ManifestDiscoveryType::unsecured_generic):
fs_ptr = &(get_folder(ManifestLocation::unsecured_location));
break;
case (ManifestDiscoveryType::windows_app_package):
fs_ptr = &(get_folder(ManifestLocation::windows_app_package));
break;
case (ManifestDiscoveryType::none):
case (ManifestDiscoveryType::null_dir):
fs_ptr = &(get_folder(ManifestLocation::null));
Expand Down Expand Up @@ -650,6 +653,11 @@ void FrameworkEnvironment::add_layer_impl(TestLayerDetails layer_details, Manife
if (layer_details.discovery_type == ManifestDiscoveryType::unsecured_generic) {
platform_shim->add_unsecured_manifest(category, layer_manifest_loc);
}
#if defined(_WIN32)
if (layer_details.discovery_type == ManifestDiscoveryType::windows_app_package) {
platform_shim->set_app_package_path(layer_manifest_loc);
}
#endif
for (size_t i = new_layers_start; i < layers.size(); i++) {
layers.at(i).manifest_path = layer_manifest_loc;
layers.at(i).shimmed_manifest_path = layer_manifest_loc;
Expand Down
26 changes: 25 additions & 1 deletion tests/loader_regression_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3806,14 +3806,38 @@ TEST(PortabilityICDConfiguration, PortabilityAndRegularICDPreInstanceFunctions)
}

#if defined(_WIN32)
TEST(AppPackageDriverDiscovery, AppPackageTest) {
TEST(AppPackageDiscovery, AppPackageDrivers) {
FrameworkEnvironment env;
env.add_icd(TestICDDetails{TEST_ICD_PATH_VERSION_2}.set_discovery_type(ManifestDiscoveryType::windows_app_package))
.add_physical_device({});

InstWrapper inst{env.vulkan_functions};
inst.CheckCreate();
}
TEST(AppPackageDiscovery, AppPackageLayers) {
FrameworkEnvironment env{};
env.add_icd(TestICDDetails(ManifestICD{}.set_lib_path(TEST_ICD_PATH_VERSION_2)));

const char* layer_name = "test_package_layer";
env.add_implicit_layer(TestLayerDetails(ManifestLayer{}.add_layer(ManifestLayer::LayerDescription{}
.set_name(layer_name)
.set_lib_path(TEST_LAYER_PATH_EXPORT_VERSION_2)
.set_disable_environment("DISABLE_ME")),
"test_package_layer.json")
.set_discovery_type(ManifestDiscoveryType::windows_app_package));

InstWrapper inst{env.vulkan_functions};
inst.CheckCreate();

{
VkLayerProperties layer_props{};
uint32_t layer_count = 0;
ASSERT_EQ(VK_SUCCESS, env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, NULL));
ASSERT_EQ(layer_count, 1);
ASSERT_EQ(VK_SUCCESS, env.vulkan_functions.vkEnumerateInstanceLayerProperties(&layer_count, &layer_props));
ASSERT_TRUE(string_eq(layer_name, layer_props.layerName));
}
}

// Make sure that stale layer manifests (path to nonexistant file) which have the same name as real manifests don't cause the real
// manifests to be skipped. Stale registry entries happen when a registry is written on layer/driver installation but not cleaned up
Expand Down

0 comments on commit 1a7a532

Please sign in to comment.