Vulkan profiles with volk
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
.cache
|
||||||
|
compile_commands.json
|
||||||
|
main
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
bear -- clang++ -g -c -DVK_NO_PROTOTYPES -I$VULKAN_SDK/include vulkan/vulkan_profiles.cpp
|
||||||
|
bear -a -- clang -g -c -DVK_NO_PROTOTYPES -Ivulkan -I$VULKAN_SDK/include main.c $VULKAN_SDK/include/volk/volk.c
|
||||||
|
bear -a -- clang++ -g -DVK_NO_PROTOTYPES -o main *.o
|
||||||
|
rm *.o
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// vim:fileencoding=utf-8:foldmethod=marker
|
||||||
|
|
||||||
|
#include "vulkan/vulkan_profiles.h"
|
||||||
|
#include <vulkan/vk_enum_string_helper.h>
|
||||||
|
#include <volk/volk.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
VkResult result = VK_SUCCESS;
|
||||||
|
|
||||||
|
result = volkInitialize();
|
||||||
|
if (result != VK_SUCCESS) {
|
||||||
|
fprintf(stderr, "ERROR: %s", string_VkResult(result));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
VkBool32 supported = VK_FALSE;
|
||||||
|
|
||||||
|
VpProfileProperties profile = {
|
||||||
|
.profileName = VP_KHR_ROADMAP_2022_NAME,
|
||||||
|
.specVersion = VP_KHR_ROADMAP_2022_SPEC_VERSION,
|
||||||
|
};
|
||||||
|
result = vpGetInstanceProfileSupport(NULL, &profile, &supported);
|
||||||
|
if (result != VK_SUCCESS) {
|
||||||
|
fprintf(stderr, "ERROR: %s\n", string_VkResult(result));
|
||||||
|
return 3;
|
||||||
|
} else if (!supported) {
|
||||||
|
fprintf(stderr, "Profile not supported at instance level\n");
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
VkApplicationInfo app_info = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
|
||||||
|
.apiVersion = VP_KHR_ROADMAP_2022_MIN_API_VERSION,
|
||||||
|
};
|
||||||
|
VkInstanceCreateInfo instance_info = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
|
||||||
|
.pApplicationInfo = &app_info,
|
||||||
|
};
|
||||||
|
VpInstanceCreateInfo vp_instance_info = {
|
||||||
|
.pCreateInfo = &instance_info,
|
||||||
|
.enabledFullProfileCount = 1,
|
||||||
|
.pEnabledFullProfiles = &profile,
|
||||||
|
};
|
||||||
|
|
||||||
|
VkInstance instance = VK_NULL_HANDLE;
|
||||||
|
result = vpCreateInstance(&vp_instance_info, NULL, &instance);
|
||||||
|
if (result != VK_SUCCESS) {
|
||||||
|
fprintf(stderr, "ERROR: %s\n", string_VkResult(result));
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
volkLoadInstance(instance);
|
||||||
|
|
||||||
|
VkPhysicalDevice physical_device = VK_NULL_HANDLE;
|
||||||
|
unsigned int count = 0;
|
||||||
|
result = vkEnumeratePhysicalDevices(instance, &count, NULL);
|
||||||
|
if (result != VK_SUCCESS) {
|
||||||
|
fprintf(stderr, "ERROR: %s\n", string_VkResult(result));
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
VkPhysicalDevice physical_devices[32] = {0};
|
||||||
|
result = vkEnumeratePhysicalDevices(instance, &count, physical_devices);
|
||||||
|
if (result != VK_SUCCESS) {
|
||||||
|
fprintf(stderr, "ERROR: %s\n", string_VkResult(result));
|
||||||
|
return 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
int index = -1;
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
VkPhysicalDeviceProperties2 base_properties = { .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 };
|
||||||
|
vkGetPhysicalDeviceProperties2(physical_devices[i], &base_properties);
|
||||||
|
switch (base_properties.properties.deviceType) {
|
||||||
|
case VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU: {
|
||||||
|
if (base_properties.properties.apiVersion >= VP_KHR_ROADMAP_2022_MIN_API_VERSION) {
|
||||||
|
index = i;
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
case VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU: {
|
||||||
|
if (base_properties.properties.apiVersion >= VP_KHR_ROADMAP_2022_MIN_API_VERSION) {
|
||||||
|
index = i;
|
||||||
|
}
|
||||||
|
} break;
|
||||||
|
default: continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (index == -1) {
|
||||||
|
fprintf(stderr, "Failed to find physical device\n");
|
||||||
|
return 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
physical_device = physical_devices[index];
|
||||||
|
|
||||||
|
result = vpGetPhysicalDeviceProfileSupport(instance, physical_device, &profile, &supported);
|
||||||
|
if (result != VK_SUCCESS) {
|
||||||
|
fprintf(stderr, "ERROR: %s\n", string_VkResult(result));
|
||||||
|
return 8;
|
||||||
|
} else if (!supported) {
|
||||||
|
fprintf(stderr, "Profile not supported at physical device level\n");
|
||||||
|
return 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int queue_family_count;
|
||||||
|
vkGetPhysicalDeviceQueueFamilyProperties(physical_device, &queue_family_count, NULL);
|
||||||
|
if (queue_family_count == 0) {
|
||||||
|
fprintf(stderr, "Couldn't find queue families");
|
||||||
|
return 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
VkQueueFamilyProperties queue_families_properties[64] = {0};
|
||||||
|
vkGetPhysicalDeviceQueueFamilyProperties(physical_device, &queue_family_count, queue_families_properties);
|
||||||
|
|
||||||
|
int queue_family_index = -1;
|
||||||
|
for (unsigned int i = 0; i < queue_family_count; ++i) {
|
||||||
|
if ((queue_families_properties[i].queueFlags & (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT)) != 0) {
|
||||||
|
queue_family_index = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (queue_family_index == -1) {
|
||||||
|
fprintf(stderr, "Couldn't find suitable queue family");
|
||||||
|
return 11;
|
||||||
|
}
|
||||||
|
|
||||||
|
float queue_priority = 1.0f;
|
||||||
|
VkDeviceQueueCreateInfo device_queue_create_info = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO,
|
||||||
|
.queueCount = 1,
|
||||||
|
.queueFamilyIndex = queue_family_index,
|
||||||
|
.pQueuePriorities = &queue_priority,
|
||||||
|
};
|
||||||
|
|
||||||
|
VkDeviceCreateInfo device_create_info = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
|
||||||
|
.queueCreateInfoCount = 1,
|
||||||
|
.pQueueCreateInfos = &device_queue_create_info,
|
||||||
|
};
|
||||||
|
|
||||||
|
VpDeviceCreateInfo vp_device_create_info = {
|
||||||
|
.pCreateInfo = &device_create_info,
|
||||||
|
.enabledFullProfileCount = 1,
|
||||||
|
.pEnabledFullProfiles = &profile,
|
||||||
|
};
|
||||||
|
|
||||||
|
VkDevice device = VK_NULL_HANDLE;
|
||||||
|
result = vpCreateDevice(physical_device, &vp_device_create_info, NULL, &device);
|
||||||
|
if (result != VK_SUCCESS) {
|
||||||
|
fprintf(stderr, "ERROR: %s\n", string_VkResult(result));
|
||||||
|
return 12;
|
||||||
|
}
|
||||||
|
|
||||||
|
volkLoadDevice(device);
|
||||||
|
|
||||||
|
// NOTE (Abdelrahman): Fake render loop
|
||||||
|
while (1) {}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,498 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2021-2026 Valve Corporation
|
||||||
|
* Copyright (C) 2021-2026 LunarG, Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*
|
||||||
|
* This file is ***GENERATED***. Do Not Edit.
|
||||||
|
* See scripts/gen_profiles_solution.py for modifications.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef VULKAN_PROFILES_H_
|
||||||
|
#define VULKAN_PROFILES_H_ 1
|
||||||
|
|
||||||
|
#define VPAPI_ATTR
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <volk/volk.h>
|
||||||
|
|
||||||
|
#if defined(VK_VERSION_1_3) && \
|
||||||
|
defined(VK_KHR_global_priority)
|
||||||
|
#define VP_KHR_roadmap_2022 1
|
||||||
|
#define VP_KHR_ROADMAP_2022_NAME "VP_KHR_roadmap_2022"
|
||||||
|
#define VP_KHR_ROADMAP_2022_SPEC_VERSION 1
|
||||||
|
#define VP_KHR_ROADMAP_2022_MIN_API_VERSION VK_MAKE_VERSION(1, 3, 204)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(VK_VERSION_1_3) && \
|
||||||
|
defined(VP_KHR_roadmap_2022) && \
|
||||||
|
defined(VK_KHR_dynamic_rendering) && \
|
||||||
|
defined(VK_KHR_dynamic_rendering_local_read) && \
|
||||||
|
defined(VK_KHR_index_type_uint8) && \
|
||||||
|
defined(VK_KHR_line_rasterization) && \
|
||||||
|
defined(VK_KHR_load_store_op_none) && \
|
||||||
|
defined(VK_KHR_maintenance5) && \
|
||||||
|
defined(VK_KHR_map_memory2) && \
|
||||||
|
defined(VK_KHR_push_descriptor) && \
|
||||||
|
defined(VK_KHR_shader_expect_assume) && \
|
||||||
|
defined(VK_KHR_shader_float_controls2) && \
|
||||||
|
defined(VK_KHR_shader_maximal_reconvergence) && \
|
||||||
|
defined(VK_KHR_shader_quad_control) && \
|
||||||
|
defined(VK_KHR_shader_subgroup_rotate) && \
|
||||||
|
defined(VK_KHR_shader_subgroup_uniform_control_flow) && \
|
||||||
|
defined(VK_KHR_vertex_attribute_divisor)
|
||||||
|
#define VP_KHR_roadmap_2024 1
|
||||||
|
#define VP_KHR_ROADMAP_2024_NAME "VP_KHR_roadmap_2024"
|
||||||
|
#define VP_KHR_ROADMAP_2024_SPEC_VERSION 1
|
||||||
|
#define VP_KHR_ROADMAP_2024_MIN_API_VERSION VK_MAKE_VERSION(1, 3, 276)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(VK_VERSION_1_4) && \
|
||||||
|
defined(VP_KHR_roadmap_2022) && \
|
||||||
|
defined(VK_KHR_compute_shader_derivatives) && \
|
||||||
|
defined(VK_KHR_cooperative_matrix) && \
|
||||||
|
defined(VK_KHR_copy_memory_indirect) && \
|
||||||
|
defined(VK_KHR_depth_clamp_zero_one) && \
|
||||||
|
defined(VK_KHR_dynamic_rendering) && \
|
||||||
|
defined(VK_KHR_dynamic_rendering_local_read) && \
|
||||||
|
defined(VK_KHR_fragment_shading_rate) && \
|
||||||
|
defined(VK_KHR_get_surface_capabilities2) && \
|
||||||
|
defined(VK_KHR_index_type_uint8) && \
|
||||||
|
defined(VK_KHR_line_rasterization) && \
|
||||||
|
defined(VK_KHR_load_store_op_none) && \
|
||||||
|
defined(VK_KHR_maintenance5) && \
|
||||||
|
defined(VK_KHR_maintenance7) && \
|
||||||
|
defined(VK_KHR_maintenance8) && \
|
||||||
|
defined(VK_KHR_maintenance9) && \
|
||||||
|
defined(VK_KHR_map_memory2) && \
|
||||||
|
defined(VK_KHR_pipeline_binary) && \
|
||||||
|
defined(VK_KHR_present_id2) && \
|
||||||
|
defined(VK_KHR_present_mode_fifo_latest_ready) && \
|
||||||
|
defined(VK_KHR_present_wait2) && \
|
||||||
|
defined(VK_KHR_push_descriptor) && \
|
||||||
|
defined(VK_KHR_robustness2) && \
|
||||||
|
defined(VK_KHR_shader_clock) && \
|
||||||
|
defined(VK_KHR_shader_expect_assume) && \
|
||||||
|
defined(VK_KHR_shader_float_controls2) && \
|
||||||
|
defined(VK_KHR_shader_maximal_reconvergence) && \
|
||||||
|
defined(VK_KHR_shader_quad_control) && \
|
||||||
|
defined(VK_KHR_shader_subgroup_rotate) && \
|
||||||
|
defined(VK_KHR_shader_subgroup_uniform_control_flow) && \
|
||||||
|
defined(VK_KHR_shader_untyped_pointers) && \
|
||||||
|
defined(VK_KHR_surface) && \
|
||||||
|
defined(VK_KHR_surface_maintenance1) && \
|
||||||
|
defined(VK_KHR_swapchain) && \
|
||||||
|
defined(VK_KHR_swapchain_maintenance1) && \
|
||||||
|
defined(VK_KHR_vertex_attribute_divisor) && \
|
||||||
|
defined(VK_KHR_workgroup_memory_explicit_layout)
|
||||||
|
#define VP_KHR_roadmap_2026 1
|
||||||
|
#define VP_KHR_ROADMAP_2026_NAME "VP_KHR_roadmap_2026"
|
||||||
|
#define VP_KHR_ROADMAP_2026_SPEC_VERSION 1
|
||||||
|
#define VP_KHR_ROADMAP_2026_MIN_API_VERSION VK_MAKE_VERSION(1, 4, 328)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define VP_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 2, 0, VK_HEADER_VERSION)
|
||||||
|
|
||||||
|
#define VP_MAX_PROFILE_NAME_SIZE 256U
|
||||||
|
|
||||||
|
typedef struct VpProfileProperties {
|
||||||
|
char profileName[VP_MAX_PROFILE_NAME_SIZE];
|
||||||
|
uint32_t specVersion;
|
||||||
|
} VpProfileProperties;
|
||||||
|
|
||||||
|
typedef struct VpBlockProperties {
|
||||||
|
VpProfileProperties profiles;
|
||||||
|
uint32_t apiVersion;
|
||||||
|
char blockName[VP_MAX_PROFILE_NAME_SIZE];
|
||||||
|
} VpBlockProperties;
|
||||||
|
|
||||||
|
typedef struct VpVideoProfileProperties {
|
||||||
|
char name[VP_MAX_PROFILE_NAME_SIZE];
|
||||||
|
} VpVideoProfileProperties;
|
||||||
|
|
||||||
|
typedef enum VpInstanceCreateFlagBits {
|
||||||
|
VP_INSTANCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
|
||||||
|
} VpInstanceCreateFlagBits;
|
||||||
|
typedef VkFlags VpInstanceCreateFlags;
|
||||||
|
|
||||||
|
typedef struct VpInstanceCreateInfo {
|
||||||
|
const VkInstanceCreateInfo* pCreateInfo;
|
||||||
|
VpInstanceCreateFlags flags;
|
||||||
|
uint32_t enabledFullProfileCount;
|
||||||
|
const VpProfileProperties* pEnabledFullProfiles;
|
||||||
|
uint32_t enabledProfileBlockCount;
|
||||||
|
const VpBlockProperties* pEnabledProfileBlocks;
|
||||||
|
} VpInstanceCreateInfo;
|
||||||
|
|
||||||
|
typedef enum VpDeviceCreateFlagBits {
|
||||||
|
VP_DEVICE_CREATE_DISABLE_ROBUST_BUFFER_ACCESS_BIT = 0x0000001,
|
||||||
|
VP_DEVICE_CREATE_DISABLE_ROBUST_IMAGE_ACCESS_BIT = 0x0000002,
|
||||||
|
VP_DEVICE_CREATE_DISABLE_ROBUST_ACCESS =
|
||||||
|
VP_DEVICE_CREATE_DISABLE_ROBUST_BUFFER_ACCESS_BIT | VP_DEVICE_CREATE_DISABLE_ROBUST_IMAGE_ACCESS_BIT,
|
||||||
|
|
||||||
|
VP_DEVICE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
|
||||||
|
} VpDeviceCreateFlagBits;
|
||||||
|
typedef VkFlags VpDeviceCreateFlags;
|
||||||
|
|
||||||
|
typedef struct VpDeviceCreateInfo {
|
||||||
|
const VkDeviceCreateInfo* pCreateInfo;
|
||||||
|
VpDeviceCreateFlags flags;
|
||||||
|
uint32_t enabledFullProfileCount;
|
||||||
|
const VpProfileProperties* pEnabledFullProfiles;
|
||||||
|
uint32_t enabledProfileBlockCount;
|
||||||
|
const VpBlockProperties* pEnabledProfileBlocks;
|
||||||
|
} VpDeviceCreateInfo;
|
||||||
|
|
||||||
|
VK_DEFINE_HANDLE(VpCapabilities)
|
||||||
|
|
||||||
|
typedef enum VpCapabilitiesCreateFlagBits {
|
||||||
|
VP_PROFILE_CREATE_STATIC_BIT = (1 << 0),
|
||||||
|
//VP_PROFILE_CREATE_DYNAMIC_BIT = (1 << 1),
|
||||||
|
VP_PROFILE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
|
||||||
|
} VpCapabilitiesCreateFlagBits;
|
||||||
|
|
||||||
|
typedef VkFlags VpCapabilitiesCreateFlags;
|
||||||
|
|
||||||
|
// Pointers to some Vulkan functions - a subset used by the library.
|
||||||
|
// Used in VpCapabilitiesCreateInfo::pVulkanFunctions.
|
||||||
|
|
||||||
|
typedef struct VpVulkanFunctions {
|
||||||
|
/// Required when using VP_DYNAMIC_VULKAN_FUNCTIONS.
|
||||||
|
PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
|
||||||
|
/// Required when using VP_DYNAMIC_VULKAN_FUNCTIONS.
|
||||||
|
PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
|
||||||
|
PFN_vkEnumerateInstanceVersion EnumerateInstanceVersion;
|
||||||
|
PFN_vkEnumerateInstanceExtensionProperties EnumerateInstanceExtensionProperties;
|
||||||
|
PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
|
||||||
|
PFN_vkGetPhysicalDeviceFeatures2 GetPhysicalDeviceFeatures2;
|
||||||
|
PFN_vkGetPhysicalDeviceProperties2 GetPhysicalDeviceProperties2;
|
||||||
|
PFN_vkGetPhysicalDeviceFormatProperties2 GetPhysicalDeviceFormatProperties2;
|
||||||
|
PFN_vkGetPhysicalDeviceQueueFamilyProperties2 GetPhysicalDeviceQueueFamilyProperties2;
|
||||||
|
PFN_vkCreateInstance CreateInstance;
|
||||||
|
PFN_vkCreateDevice CreateDevice;
|
||||||
|
} VpVulkanFunctions;
|
||||||
|
|
||||||
|
/// Description of a Allocator to be created.
|
||||||
|
typedef struct VpCapabilitiesCreateInfo
|
||||||
|
{
|
||||||
|
/// Flags for created allocator. Use #VpInstanceCreateFlagBits enum.
|
||||||
|
VpCapabilitiesCreateFlags flags;
|
||||||
|
uint32_t apiVersion;
|
||||||
|
const VpVulkanFunctions* pVulkanFunctions;
|
||||||
|
} VpCapabilitiesCreateInfo;
|
||||||
|
|
||||||
|
VPAPI_ATTR VkResult vpCreateCapabilities(
|
||||||
|
const VpCapabilitiesCreateInfo* pCreateInfo,
|
||||||
|
const VkAllocationCallbacks* pAllocator,
|
||||||
|
VpCapabilities* pCapabilities);
|
||||||
|
|
||||||
|
/// Destroys allocator object.
|
||||||
|
VPAPI_ATTR void vpDestroyCapabilities(
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
const VkAllocationCallbacks* pAllocator);
|
||||||
|
|
||||||
|
// Query the list of available profiles in the library
|
||||||
|
VPAPI_ATTR VkResult vpGetProfiles(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
uint32_t* pPropertyCount,
|
||||||
|
VpProfileProperties* pProperties);
|
||||||
|
|
||||||
|
// List the required profiles of a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileRequiredProfiles(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
uint32_t* pPropertyCount,
|
||||||
|
VpProfileProperties* pProperties);
|
||||||
|
|
||||||
|
// Query the profile required Vulkan API version
|
||||||
|
VPAPI_ATTR uint32_t vpGetProfileAPIVersion(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile);
|
||||||
|
|
||||||
|
// List the recommended fallback profiles of a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileFallbacks(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
uint32_t* pPropertyCount,
|
||||||
|
VpProfileProperties* pProperties);
|
||||||
|
|
||||||
|
// Query whether the profile has multiple variants. Profiles with multiple variants can only use vpGetInstanceProfileSupport and vpGetPhysicalDeviceProfileSupport capabilities of the library. Other function will return a VK_ERROR_UNKNOWN error
|
||||||
|
VPAPI_ATTR VkResult vpHasMultipleVariantsProfile(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
VkBool32* pHasMultipleVariants);
|
||||||
|
|
||||||
|
// Check whether a profile is supported at the instance level
|
||||||
|
VPAPI_ATTR VkResult vpGetInstanceProfileSupport(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const char* pLayerName,
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
VkBool32* pSupported);
|
||||||
|
|
||||||
|
// Check whether a variant of a profile is supported at the instance level and report this list of blocks used to validate the profiles
|
||||||
|
VPAPI_ATTR VkResult vpGetInstanceProfileVariantsSupport(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const char* pLayerName,
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
VkBool32* pSupported,
|
||||||
|
uint32_t* pPropertyCount,
|
||||||
|
VpBlockProperties* pProperties);
|
||||||
|
|
||||||
|
// Create a VkInstance with the profile instance extensions enabled
|
||||||
|
VPAPI_ATTR VkResult vpCreateInstance(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpInstanceCreateInfo* pCreateInfo,
|
||||||
|
const VkAllocationCallbacks* pAllocator,
|
||||||
|
VkInstance* pInstance);
|
||||||
|
|
||||||
|
// Check whether a profile is supported by the physical device
|
||||||
|
VPAPI_ATTR VkResult vpGetPhysicalDeviceProfileSupport(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
VkInstance instance,
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
VkBool32* pSupported);
|
||||||
|
|
||||||
|
// Check whether a variant of a profile is supported by the physical device and report this list of blocks used to validate the profiles
|
||||||
|
VPAPI_ATTR VkResult vpGetPhysicalDeviceProfileVariantsSupport(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
VkInstance instance,
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
VkBool32* pSupported,
|
||||||
|
uint32_t* pPropertyCount,
|
||||||
|
VpBlockProperties* pProperties);
|
||||||
|
|
||||||
|
// Create a VkDevice with the profile features and device extensions enabled
|
||||||
|
VPAPI_ATTR VkResult vpCreateDevice(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
VkPhysicalDevice physicalDevice,
|
||||||
|
const VpDeviceCreateInfo* pCreateInfo,
|
||||||
|
const VkAllocationCallbacks* pAllocator,
|
||||||
|
VkDevice* pDevice);
|
||||||
|
|
||||||
|
// Query the list of instance extensions of a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileInstanceExtensionProperties(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t* pPropertyCount,
|
||||||
|
VkExtensionProperties* pProperties);
|
||||||
|
|
||||||
|
// Query the list of device extensions of a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileDeviceExtensionProperties(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t* pPropertyCount,
|
||||||
|
VkExtensionProperties* pProperties);
|
||||||
|
|
||||||
|
// Fill the feature structures with the requirements of a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileFeatures(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
void* pNext);
|
||||||
|
|
||||||
|
// Query the list of feature structure types specified by the profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileFeatureStructureTypes(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t* pStructureTypeCount,
|
||||||
|
VkStructureType* pStructureTypes);
|
||||||
|
|
||||||
|
// Fill the property structures with the requirements of a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileProperties(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
void* pNext);
|
||||||
|
|
||||||
|
// Query the list of property structure types specified by the profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfilePropertyStructureTypes(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t* pStructureTypeCount,
|
||||||
|
VkStructureType* pStructureTypes);
|
||||||
|
|
||||||
|
// Fill the queue family property structures with the requirements of a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileQueueFamilyProperties(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t* pPropertyCount,
|
||||||
|
VkQueueFamilyProperties2KHR* pProperties);
|
||||||
|
|
||||||
|
// Query the list of queue family property structure types specified by the profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileQueueFamilyStructureTypes(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t* pStructureTypeCount,
|
||||||
|
VkStructureType* pStructureTypes);
|
||||||
|
|
||||||
|
// Query the list of formats with specified requirements by a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileFormats(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t* pFormatCount,
|
||||||
|
VkFormat* pFormats);
|
||||||
|
|
||||||
|
// Query the requirements of a format for a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileFormatProperties(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
VkFormat format,
|
||||||
|
void* pNext);
|
||||||
|
|
||||||
|
// Query the list of format structure types specified by the profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileFormatStructureTypes(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t* pStructureTypeCount,
|
||||||
|
VkStructureType* pStructureTypes);
|
||||||
|
|
||||||
|
#ifdef VK_KHR_video_queue
|
||||||
|
// Query the list of video profiles specified by the profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileVideoProfiles(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t* pVideoProfileCount,
|
||||||
|
VpVideoProfileProperties* pVideoProfiles);
|
||||||
|
|
||||||
|
// Query the video profile info structures for a video profile defined by a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileVideoProfileInfo(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t videoProfileIndex,
|
||||||
|
VkVideoProfileInfoKHR* pVideoProfileInfo);
|
||||||
|
|
||||||
|
// Query the list of video profile info structure types specified by the profile for a video profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileVideoProfileInfoStructureTypes(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t videoProfileIndex,
|
||||||
|
uint32_t* pStructureTypeCount,
|
||||||
|
VkStructureType* pStructureTypes);
|
||||||
|
|
||||||
|
// Query the video capabilities requirements for a video profile defined by a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileVideoCapabilities(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t videoProfileIndex,
|
||||||
|
void* pNext);
|
||||||
|
|
||||||
|
// Query the list of video capability structure types specified by the profile for a video profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileVideoCapabilityStructureTypes(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t videoProfileIndex,
|
||||||
|
uint32_t* pStructureTypeCount,
|
||||||
|
VkStructureType* pStructureTypes);
|
||||||
|
|
||||||
|
// Query the video format property requirements for a video profile defined by a profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileVideoFormatProperties(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t videoProfileIndex,
|
||||||
|
uint32_t* pPropertyCount,
|
||||||
|
VkVideoFormatPropertiesKHR* pProperties);
|
||||||
|
|
||||||
|
// Query the list of video format property structure types specified by the profile for a video profile
|
||||||
|
VPAPI_ATTR VkResult vpGetProfileVideoFormatStructureTypes(
|
||||||
|
#ifdef VP_USE_OBJECT
|
||||||
|
VpCapabilities capabilities,
|
||||||
|
#endif//VP_USE_OBJECT
|
||||||
|
const VpProfileProperties* pProfile,
|
||||||
|
const char* pBlockName,
|
||||||
|
uint32_t videoProfileIndex,
|
||||||
|
uint32_t* pStructureTypeCount,
|
||||||
|
VkStructureType* pStructureTypes);
|
||||||
|
#endif // VK_KHR_video_queue
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // VULKAN_PROFILES_H_
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user