-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aac3bf0
commit 2fbc529
Showing
15 changed files
with
1,397 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ build | |
build.* | ||
vkd3d-proton-*.tar.zst | ||
vkd3d-proton-*/ | ||
|
||
/profiles/vulkan | ||
/profiles/profile-test |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p profiles/vulkan/debug | ||
|
||
if [ -z ${VULKAN_PROFILE_PREFIX} ]; then | ||
VULKAN_PROFILE_PREFIX="$HOME/.local" | ||
echo "Using VULKAN_PROFILE_PREFIX=$VULKAN_PROFILE_PREFIX." | ||
fi | ||
|
||
# Install Vulkan-Profiles to ~/.local prefix. | ||
|
||
python3 "${VULKAN_PROFILE_PREFIX}/share/vulkan/registry/gen_profiles_solution.py" \ | ||
--registry subprojects/Vulkan-Headers/registry/vk.xml \ | ||
--input . \ | ||
--output-library-inc profiles/vulkan \ | ||
--output-library-src profiles/vulkan \ | ||
--output-doc profiles/PROFILES.md \ | ||
--validate --debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright 2023 Hans-Kristian Arntzen for Valve Corporation | ||
* | ||
* This library is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA | ||
*/ | ||
|
||
#include "vulkan/vulkan_profiles.h" | ||
#include <stdio.h> | ||
#include <stddef.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
/* Crude ad-hoc check. */ | ||
|
||
int main(void) | ||
{ | ||
VkInstanceCreateInfo instance_create_info; | ||
VpInstanceCreateInfo vp_instance_info; | ||
VkPhysicalDeviceProperties gpu_props; | ||
VkApplicationInfo app_info; | ||
VpProfileProperties *props; | ||
VkPhysicalDevice *gpus; | ||
uint32_t profile_count; | ||
VkInstance instance; | ||
uint32_t gpu_count; | ||
VkBool32 supported; | ||
uint32_t i, j; | ||
|
||
vpGetProfiles(&profile_count, NULL); | ||
props = (VpProfileProperties*)calloc(profile_count, sizeof(*props)); | ||
vpGetProfiles(&profile_count, props); | ||
|
||
for (i = 0; i < profile_count; i++) | ||
{ | ||
printf("Testing profile %s.\n", props[i].profileName); | ||
|
||
memset(&instance_create_info, 0, sizeof(instance_create_info)); | ||
memset(&vp_instance_info, 0, sizeof(vp_instance_info)); | ||
memset(&app_info, 0, sizeof(app_info)); | ||
instance_create_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO; | ||
app_info.apiVersion = VK_API_VERSION_1_3; | ||
app_info.pEngineName = "vkd3d"; | ||
instance_create_info.pApplicationInfo = &app_info; | ||
vp_instance_info.pCreateInfo = &instance_create_info; | ||
|
||
if (vpGetInstanceProfileSupport(NULL, &props[i], &supported) != VK_SUCCESS || !supported) | ||
{ | ||
fprintf(stderr, "Profile %s is not supported at instance level.\n", | ||
props[i].profileName); | ||
} | ||
|
||
if (vpCreateInstance(&vp_instance_info, NULL, &instance) != VK_SUCCESS) | ||
{ | ||
fprintf(stderr, "Failed to create instance ...\n"); | ||
continue; | ||
} | ||
|
||
vkEnumeratePhysicalDevices(instance, &gpu_count, NULL); | ||
gpus = (VkPhysicalDevice*)calloc(gpu_count, sizeof(*gpus)); | ||
vkEnumeratePhysicalDevices(instance, &gpu_count, gpus); | ||
|
||
for (j = 0; j < gpu_count; j++) | ||
{ | ||
vkGetPhysicalDeviceProperties(gpus[j], &gpu_props); | ||
if (vpGetPhysicalDeviceProfileSupport(instance, gpus[j], &props[i], &supported) != VK_SUCCESS) | ||
supported = VK_FALSE; | ||
|
||
printf("[RESULT] GPU: %s, Profile: %s, supported: %s\n", | ||
gpu_props.deviceName, props[i].profileName, supported ? "yes" : "no"); | ||
} | ||
|
||
free(gpus); | ||
vkDestroyInstance(instance, NULL); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:VK_LAYER_KHRONOS_profiles | ||
export VK_KHRONOS_PROFILES_DEFAULT_FEATURE_VALUES=DEFAULT_FEATURE_VALUES_FALSE | ||
export VK_KHRONOS_PROFILES_PROFILE_FILE=$(pwd)/VP_D3D12_VKD3D_PROTON_profile.json | ||
export VK_KHRONOS_PROFILES_PROFILE_NAME=${PROFILE_NAME} | ||
export VK_KHRONOS_PROFILES_SIMULATE_CAPABILITIES=SIMULATE_API_VERSION_BIT,SIMULATE_FEATURES_BIT,SIMULATE_PROPERTIES_BIT,SIMULATE_EXTENSIONS_BIT | ||
export VK_LAYER_PATH=/usr/share/vulkan/explicit_layer.d:~/.local/share/vulkan/explicit_layer.d | ||
export VK_KHRONOS_PROFILES_EMULATE_PORTABILITY=false | ||
export LD_LIBRARY_PATH="$HOME/.local/lib:$LD_LIBRARY_PATH" | ||
export VK_KHRONOS_PROFILES_DEBUG_ACTIONS=DEBUG_ACTION_FILE_BIT | ||
export VK_KHRONOS_PROFILES_DEBUG_FILENAME=/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PROFILE_NAME=VP_D3D12_FL_11_0_baseline | ||
source profiles/setup_profile_environment_common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PROFILE_NAME=VP_D3D12_FL_11_1_baseline | ||
source profiles/setup_profile_environment_common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PROFILE_NAME=VP_D3D12_FL_12_0_baseline | ||
source profiles/setup_profile_environment_common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PROFILE_NAME=VP_D3D12_FL_12_0_optimal | ||
source profiles/setup_profile_environment_common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PROFILE_NAME=VP_D3D12_FL_12_1_baseline | ||
source profiles/setup_profile_environment_common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PROFILE_NAME=VP_D3D12_FL_12_2_baseline | ||
source profiles/setup_profile_environment_common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PROFILE_NAME=VP_D3D12_FL_12_2_optimal | ||
source profiles/setup_profile_environment_common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PROFILE_NAME=VP_D3D12_maximum_nv | ||
source profiles/setup_profile_environment_common.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PROFILE_NAME=VP_D3D12_maximum_radv | ||
source profiles/setup_profile_environment_common.sh |