layer: Add minimum setting reflection

This commit is contained in:
Christophe 2023-08-15 18:32:53 +02:00 committed by Christophe
parent 79d5fb108b
commit ed2d4d1250
8 changed files with 102 additions and 51 deletions

View file

@ -17,12 +17,15 @@ extern "C" {
VK_DEFINE_HANDLE(VlLayerSettingSet)
typedef void *(*VL_LAYER_SETTING_LOG_CALLBACK)(const char *pSettingName, const char *pMessage);
typedef void (VKAPI_PTR *VlLayerSettingLogCallback)(const char *pSettingName, const char *pMessage);
void vlRegistryLayerSettingsProperties(const char *pLayerName,
uint32_t propertyCount, VkLayerSettingPropertiesEXT *pProperties);
// Create a layer setting set. If 'pCallback' is set to NULL, the messages are outputed to stderr.
VkResult vlCreateLayerSettingSet(const char *pLayerName, const VkLayerSettingsCreateInfoEXT *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VL_LAYER_SETTING_LOG_CALLBACK pCallback, VlLayerSettingSet *pLayerSettingSet);
const VkAllocationCallbacks *pAllocator, VlLayerSettingLogCallback pCallback,
VlLayerSettingSet *pLayerSettingSet);
void vlDestroyLayerSettingSet(VlLayerSettingSet layerSettingSet, const VkAllocationCallbacks *pAllocator);

View file

@ -15,53 +15,14 @@ extern "C" {
#include <vulkan/vk_layer.h>
// VK_EXT_layer_settings
//
// Name String
// VK_EXT_layer_settings
//
// Extension Type
// Instance extension
//
// Revision
// 1
//
// Extension and Version Dependencies
// Requires Vulkan 1.0
//
// Contact
// Christophe Riccio christophe-lunarg
//
// Contributors
// Christophe Riccio
// Mark Lobodzinski
//
// Description
// This extension provides a mechanism for configuring programmatically through
// the Vulkan API the behavior of layers.
//
// This extension provides the [VkLayerSettingsCreateInfoEXT] struct that can be
// included in the [pNext] chain of the [VkInstanceCreateInfo]
// structure passed as the [pCreateInfo] parameter of [vkCreateInstance].
//
// The structure contains an array of [VkLayerSettingEXT] structure
// values that configure specific features of layers.
//
// Note
// The [VK_EXT_layer_settings] extension subsumes all the functionality provided in the [VK_EXT_validation_flags] extension
// and the [VK_EXT_validation_features] extension.
#define VK_EXT_layer_settings 1
#define VK_EXT_LAYER_SETTINGS_SPEC_VERSION 1
#define VK_EXT_LAYER_SETTINGS_EXTENSION_NAME "VK_EXT_layer_settings"
// This extension is exclusively used by VVL, and is NOT intended as a deliverable.
// The value of the VK_STRUCTURE_TYPE is arbitrary. The only requirement,
// is that it must not conflict with existing sTypes.
//
// NOTE: VK_STRUCTURE_TYPE_MAX_ENUM - 1 is used by the intel driver.
// NOTE: VK_STRUCTURE_TYPE_MAX_ENUM - 42 is used by the validation layers
#define VK_STRUCTURE_TYPE_LAYER_SETTINGS_EXT ((VkStructureType)(VK_STRUCTURE_TYPE_MAX_ENUM - 43))
#define VK_STRUCTURE_TYPE_LAYER_SETTING_PROPERTIES_EXT ((VkStructureType)(VK_STRUCTURE_TYPE_MAX_ENUM - 44))
typedef enum VkLayerSettingTypeEXT {
VK_LAYER_SETTING_TYPE_BOOL32_EXT = 0,
@ -96,6 +57,16 @@ typedef struct VkLayerSettingsCreateInfoEXT {
const VkLayerSettingEXT *pSettings;
} VkLayerSettingsCreateInfoEXT;
typedef struct VkLayerSettingPropertiesEXT {
VkStructureType sType;
const void *pNext;
char key[VK_MAX_DESCRIPTION_SIZE];
VkLayerSettingTypeEXT type;
} VkLayerSettingPropertiesEXT;
VkResult vkEnumerateInstanceLayerSettingsEXT(const char *pLayerName,
uint32_t *pPropertyCount, VkLayerSettingPropertiesEXT *pProperties);
#ifdef __cplusplus
}
#endif