Added vulkan validation layers config.
This commit is contained in:
parent
8764c86290
commit
cd8a3bb9fa
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -7,7 +7,6 @@ bin/
|
||||||
tools/bin2hex.exe
|
tools/bin2hex.exe
|
||||||
tools/bin2hex.obj
|
tools/bin2hex.obj
|
||||||
visual-studio/.vs/
|
visual-studio/.vs/
|
||||||
visual-studio/vk_layer_settings.txt
|
|
||||||
visual-studio/vk_report
|
visual-studio/vk_report
|
||||||
visual-studio/*.log
|
visual-studio/*.log
|
||||||
visual-studio/*.psess
|
visual-studio/*.psess
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ static uint32_t find_memory_type(VkPhysicalDevice physical_device, uint32_t memo
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ri.Error(ERR_FATAL, "Vulkan error: failed to find matching memory type with requested properties");
|
ri.Error(ERR_FATAL, "Vulkan: failed to find matching memory type with requested properties");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -374,7 +374,7 @@ static void create_instance() {
|
||||||
|
|
||||||
for (auto name : instance_extensions) {
|
for (auto name : instance_extensions) {
|
||||||
if (!is_extension_available(extension_properties, name))
|
if (!is_extension_available(extension_properties, name))
|
||||||
ri.Error(ERR_FATAL, "Vulkan error: required instance extension is not available: %s", name);
|
ri.Error(ERR_FATAL, "Vulkan: required instance extension is not available: %s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
VkInstanceCreateInfo desc;
|
VkInstanceCreateInfo desc;
|
||||||
|
|
@ -397,7 +397,7 @@ static void create_device() {
|
||||||
VK_CHECK(vkEnumeratePhysicalDevices(vk.instance, &count, nullptr));
|
VK_CHECK(vkEnumeratePhysicalDevices(vk.instance, &count, nullptr));
|
||||||
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
ri.Error(ERR_FATAL, "Vulkan error: no physical device found");
|
ri.Error(ERR_FATAL, "Vulkan: no physical device found");
|
||||||
|
|
||||||
std::vector<VkPhysicalDevice> physical_devices(count);
|
std::vector<VkPhysicalDevice> physical_devices(count);
|
||||||
VK_CHECK(vkEnumeratePhysicalDevices(vk.instance, &count, physical_devices.data()));
|
VK_CHECK(vkEnumeratePhysicalDevices(vk.instance, &count, physical_devices.data()));
|
||||||
|
|
@ -444,7 +444,7 @@ static void create_device() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (vk.queue_family_index == -1)
|
if (vk.queue_family_index == -1)
|
||||||
ri.Error(ERR_FATAL, "Vulkan error: failed to find queue family");
|
ri.Error(ERR_FATAL, "Vulkan: failed to find queue family");
|
||||||
}
|
}
|
||||||
|
|
||||||
// create VkDevice
|
// create VkDevice
|
||||||
|
|
@ -457,7 +457,7 @@ static void create_device() {
|
||||||
|
|
||||||
for (auto name : device_extensions) {
|
for (auto name : device_extensions) {
|
||||||
if (!is_extension_available(extension_properties, name))
|
if (!is_extension_available(extension_properties, name))
|
||||||
ri.Error(ERR_FATAL, "Vulkan error: required device extension is not available: %s", name);
|
ri.Error(ERR_FATAL, "Vulkan: required device extension is not available: %s", name);
|
||||||
}
|
}
|
||||||
|
|
||||||
const float priority = 1.0;
|
const float priority = 1.0;
|
||||||
|
|
@ -1001,7 +1001,7 @@ void vk_initialize() {
|
||||||
{
|
{
|
||||||
auto create_shader_module = [](uint8_t* bytes, int count) {
|
auto create_shader_module = [](uint8_t* bytes, int count) {
|
||||||
if (count % 4 != 0) {
|
if (count % 4 != 0) {
|
||||||
ri.Error(ERR_FATAL, "Vulkan error: SPIR-V binary buffer size is not multiple of 4");
|
ri.Error(ERR_FATAL, "Vulkan: SPIR-V binary buffer size is not multiple of 4");
|
||||||
}
|
}
|
||||||
VkShaderModuleCreateInfo desc;
|
VkShaderModuleCreateInfo desc;
|
||||||
desc.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
|
desc.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ const int MAX_IMAGE_CHUNKS = 16;
|
||||||
#define VK_CHECK(function_call) { \
|
#define VK_CHECK(function_call) { \
|
||||||
VkResult result = function_call; \
|
VkResult result = function_call; \
|
||||||
if (result < 0) \
|
if (result < 0) \
|
||||||
ri.Error(ERR_FATAL, "Vulkan error: function %s, error code %d", #function_call, result); \
|
ri.Error(ERR_FATAL, "Vulkan: function %s, error code %d", #function_call, result); \
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class Vk_Shader_Type {
|
enum class Vk_Shader_Type {
|
||||||
|
|
|
||||||
164
visual-studio/vk_layer_settings.txt
Normal file
164
visual-studio/vk_layer_settings.txt
Normal file
|
|
@ -0,0 +1,164 @@
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# This file contains per-layer settings that configure layer behavior at
|
||||||
|
# execution time. Comments in this file are denoted with the "#" char.
|
||||||
|
# Settings lines are of the form:
|
||||||
|
# "<LayerIdentifier>.<SettingName> = <SettingValue>"
|
||||||
|
#
|
||||||
|
# <LayerIdentifier> is typically the official layer name, minus the VK_LAYER
|
||||||
|
# prefix and all lower-camel-case -- i.e., for VK_LAYER_LUNARG_core_validation,
|
||||||
|
# the layer identifier is 'lunarg_core_validation', and for
|
||||||
|
# VK_LAYER_GOOGLE_threading the layeridentifier is 'google_threading'.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
################################################################################
|
||||||
|
# Validation Layer Common Settings:
|
||||||
|
# =================================
|
||||||
|
#
|
||||||
|
# DEBUG_ACTION:
|
||||||
|
# =============
|
||||||
|
# <LayerIdentifier>.debug_action : This is an enum value indicating what
|
||||||
|
# action is to be taken when a layer wants to report information.
|
||||||
|
# Possible settings values are defined in the vk_layer.h header file.
|
||||||
|
# These settings are:
|
||||||
|
# VK_DBG_LAYER_ACTION_IGNORE - Take no action.
|
||||||
|
# VK_DBG_LAYER_ACTION_LOG_MSG - Log a txt message to stdout or to a log filename
|
||||||
|
# specified via the <LayerIdentifier>.log_filename setting (see below).
|
||||||
|
# VK_DBG_LAYER_ACTION_CALLBACK - Call user defined callback function(s) that
|
||||||
|
# have been registered via the VK_EXT_debug_report extension. Since
|
||||||
|
# app must register callback, this is a NOOP for the settings file.
|
||||||
|
# VK_DBG_LAYER_DEBUG_OUTPUT [Windows only] - Log a txt message using the
|
||||||
|
# Windows OutputDebugString function -- messages will show up in the
|
||||||
|
# Visual Studio output window, for instance.
|
||||||
|
# VK_DBG_LAYER_ACTION_BREAK - Trigger a breakpoint.
|
||||||
|
#
|
||||||
|
# REPORT_FLAGS:
|
||||||
|
# =============
|
||||||
|
# <LayerIdentifier>.report_flags : This is a comma-delineated list of options
|
||||||
|
# telling the layer what types of messages it should report back.
|
||||||
|
# Options are:
|
||||||
|
# info - Report informational messages.
|
||||||
|
# warn - Report warnings from using the API in a manner which may lead to
|
||||||
|
# undefined behavior or to warn the user of common trouble spots.
|
||||||
|
# A warning does NOT necessarily signify illegal application behavior.
|
||||||
|
# perf - Report using the API in a way that may cause suboptimal performance.
|
||||||
|
# error - Report errors in API usage.
|
||||||
|
# debug - For layer development. Report messages for debugging layer
|
||||||
|
# behavior.
|
||||||
|
#
|
||||||
|
# LOG_FILENAME:
|
||||||
|
# =============
|
||||||
|
# <LayerIdentifier>.log_filename : output filename. Can be relative to
|
||||||
|
# location of vk_layer_settings.txt file, or an absolute path. If no
|
||||||
|
# filename is specified or if filename has invalid path, then stdout
|
||||||
|
# is used by default.
|
||||||
|
#
|
||||||
|
|
||||||
|
# VK_LAYER_LUNARG_core_validation Settings
|
||||||
|
lunarg_core_validation.debug_action = VK_DBG_LAYER_ACTION_LOG_MSG
|
||||||
|
lunarg_core_validation.report_flags = error,warn,perf
|
||||||
|
lunarg_core_validation.log_filename = vk_report
|
||||||
|
|
||||||
|
# VK_LAYER_LUNARG_object_tracker Settings
|
||||||
|
lunarg_object_tracker.debug_action = VK_DBG_LAYER_ACTION_LOG_MSG
|
||||||
|
lunarg_object_tracker.report_flags = error,warn,perf
|
||||||
|
lunarg_object_tracker.log_filename = vk_report
|
||||||
|
|
||||||
|
# VK_LAYER_LUNARG_parameter_validation Settings
|
||||||
|
lunarg_parameter_validation.debug_action = VK_DBG_LAYER_ACTION_LOG_MSG
|
||||||
|
lunarg_parameter_validation.report_flags = error,warn,perf
|
||||||
|
lunarg_parameter_validation.log_filename = vk_report
|
||||||
|
|
||||||
|
# VK_LAYER_LUNARG_swapchain Settings
|
||||||
|
lunarg_swapchain.debug_action = VK_DBG_LAYER_ACTION_LOG_MSG
|
||||||
|
lunarg_swapchain.report_flags = error,warn,perf
|
||||||
|
lunarg_swapchain.log_filename = vk_report
|
||||||
|
|
||||||
|
# VK_LAYER_GOOGLE_threading Settings
|
||||||
|
google_threading.debug_action = VK_DBG_LAYER_ACTION_LOG_MSG
|
||||||
|
google_threading.report_flags = error,warn,perf
|
||||||
|
google_threading.log_filename = vk_report
|
||||||
|
|
||||||
|
# VK_LAYER_GOOGLE_unique_objects Settings
|
||||||
|
google_unique_objects.debug_action = VK_DBG_LAYER_ACTION_LOG_MSG
|
||||||
|
google_unique_objects.report_flags = error,warn,perf
|
||||||
|
google_unique_objects.log_filename = vk_report
|
||||||
|
################################################################################
|
||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# This file contains per-layer settings that configure layer behavior at
|
||||||
|
# execution time. Comments in this file are denoted with the "#" char.
|
||||||
|
# Settings lines are of the form:
|
||||||
|
# "<LayerIdentifier>.<SettingName> = <SettingValue>"
|
||||||
|
#
|
||||||
|
# <LayerIdentifier> is typically the official layer name, minus the VK_LAYER
|
||||||
|
# prefix and all lower-camel-case -- i.e., for VK_LAYER_LUNARG_api_dump, the
|
||||||
|
# layer identifier is 'lunarg_api_dump'.
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
################################################################################
|
||||||
|
# VK_LAYER_LUNARG_api_dump Settings:
|
||||||
|
# ==================================
|
||||||
|
#
|
||||||
|
# DETAILED:
|
||||||
|
# =========
|
||||||
|
# <LayerIdentifer>.detailed : Setting this to TRUE causes parameter details
|
||||||
|
# to be dumped in addition to API calls.
|
||||||
|
#
|
||||||
|
# NO_ADDR:
|
||||||
|
# ========
|
||||||
|
# <LayerIdentifier>.no_addr : Setting this to TRUE causes "address" to be
|
||||||
|
# dumped in place of hex addresses.
|
||||||
|
#
|
||||||
|
# FILE:
|
||||||
|
# =====
|
||||||
|
# <LayerIdentifer>.file : Setting this to TRUE indicates that output
|
||||||
|
# should be written to file instead of STDOUT.
|
||||||
|
#
|
||||||
|
# LOG_FILENAME:
|
||||||
|
# =============
|
||||||
|
# <LayerIdentifer>.log_filename : Specifies the file to dump to when
|
||||||
|
# "file = TRUE". The default is "vk_apidump.txt".
|
||||||
|
#
|
||||||
|
# FLUSH:
|
||||||
|
# ======
|
||||||
|
# <LayerIdentifier>.flush : Setting this to TRUE causes IO to be flushed
|
||||||
|
# each API call that is written
|
||||||
|
#
|
||||||
|
# INDENT SIZE
|
||||||
|
# ==============
|
||||||
|
# <LayerIdentifier>.indent_size : Specifies the number of spaces that a tab
|
||||||
|
# is equal to
|
||||||
|
#
|
||||||
|
# SHOW TYPES
|
||||||
|
# ==============
|
||||||
|
# <LayerIdentifier>.show_types : Setting this to TRUE causes types to be
|
||||||
|
# dumped in addition to values
|
||||||
|
#
|
||||||
|
# NAME SIZE
|
||||||
|
# ==============
|
||||||
|
# <LayerIdentifier>.name_size : The number of characters the name of a
|
||||||
|
# variable should consume, assuming more are not required
|
||||||
|
#
|
||||||
|
# TYPE SIZE
|
||||||
|
# ==============
|
||||||
|
# <LayerIdentifier>.type_size : The number of characters the type of a
|
||||||
|
# variable should consume, assuming more are not requires
|
||||||
|
#
|
||||||
|
# USE_SPACES
|
||||||
|
# ==============
|
||||||
|
# <LayerIdentifier>.use_spaces : Setting this to TRUE causes all tabs
|
||||||
|
# characters to be replaced with spaces
|
||||||
|
|
||||||
|
# VK_LUNARG_LAYER_api_dump Settings
|
||||||
|
lunarg_api_dump.detailed = TRUE
|
||||||
|
lunarg_api_dump.no_addr = FALSE
|
||||||
|
lunarg_api_dump.file = FALSE
|
||||||
|
lunarg_api_dump.log_filename = vk_apidump.txt
|
||||||
|
lunarg_api_dump.flush = TRUE
|
||||||
|
lunarg_api_dump.indent_size = 4
|
||||||
|
lunarg_api_dump.show_types = TRUE
|
||||||
|
lunarg_api_dump.name_size = 32
|
||||||
|
lunarg_api_dump.type_size = 0
|
||||||
|
lunarg_api_dump.use_spaces = TRUE
|
||||||
|
lunarg_api_dump.show_shader = FALSE
|
||||||
Loading…
Reference in New Issue
Block a user