Commit 2c7b4210 authored by Bas Nieuwenhuizen's avatar Bas Nieuwenhuizen
Browse files

radv: Add support for driconf.

This includes 0 options.

The cache parsing is located at a position where we can easily add
config filtering by VkApplicationInfo.
parent 697e2e1f
...@@ -130,14 +130,14 @@ endif ...@@ -130,14 +130,14 @@ endif
libvulkan_radeon = shared_library( libvulkan_radeon = shared_library(
'vulkan_radeon', 'vulkan_radeon',
[libradv_files, radv_entrypoints, radv_extensions_c, amd_vk_format_table_c, sha1_h], [libradv_files, radv_entrypoints, radv_extensions_c, amd_vk_format_table_c, sha1_h, xmlpool_options_h],
include_directories : [ include_directories : [
inc_common, inc_amd, inc_amd_common, inc_compiler, inc_vulkan_util, inc_common, inc_amd, inc_amd_common, inc_compiler, inc_util, inc_vulkan_util,
inc_vulkan_wsi, inc_vulkan_wsi,
], ],
link_with : [ link_with : [
libamd_common, libamdgpu_addrlib, libvulkan_util, libvulkan_wsi, libamd_common, libamdgpu_addrlib, libvulkan_util, libvulkan_wsi,
libmesa_util, libmesa_util, libxmlconfig
], ],
dependencies : [ dependencies : [
dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m, dep_llvm, dep_libdrm_amdgpu, dep_thread, dep_elf, dep_dl, dep_m,
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include "util/debug.h" #include "util/debug.h"
#include "util/mesa-sha1.h" #include "util/mesa-sha1.h"
#include "compiler/glsl_types.h" #include "compiler/glsl_types.h"
#include "util/xmlpool.h"
static int static int
radv_device_get_cache_uuid(enum radeon_family family, void *uuid) radv_device_get_cache_uuid(enum radeon_family family, void *uuid)
...@@ -520,6 +521,17 @@ static int radv_get_instance_extension_index(const char *name) ...@@ -520,6 +521,17 @@ static int radv_get_instance_extension_index(const char *name)
return -1; return -1;
} }
static const char radv_dri_options_xml[] =
DRI_CONF_BEGIN
DRI_CONF_END;
static void radv_init_dri_options(struct radv_instance *instance)
{
driParseOptionInfo(&instance->available_dri_options, radv_dri_options_xml);
driParseConfigFiles(&instance->dri_options,
&instance->available_dri_options,
0, "radv", NULL);
}
VkResult radv_CreateInstance( VkResult radv_CreateInstance(
const VkInstanceCreateInfo* pCreateInfo, const VkInstanceCreateInfo* pCreateInfo,
...@@ -587,6 +599,7 @@ VkResult radv_CreateInstance( ...@@ -587,6 +599,7 @@ VkResult radv_CreateInstance(
VG(VALGRIND_CREATE_MEMPOOL(instance, 0, false)); VG(VALGRIND_CREATE_MEMPOOL(instance, 0, false));
radv_init_dri_options(instance);
radv_handle_per_app_options(instance, pCreateInfo->pApplicationInfo); radv_handle_per_app_options(instance, pCreateInfo->pApplicationInfo);
*pInstance = radv_instance_to_handle(instance); *pInstance = radv_instance_to_handle(instance);
...@@ -612,6 +625,9 @@ void radv_DestroyInstance( ...@@ -612,6 +625,9 @@ void radv_DestroyInstance(
glsl_type_singleton_decref(); glsl_type_singleton_decref();
_mesa_locale_fini(); _mesa_locale_fini();
driDestroyOptionCache(&instance->dri_options);
driDestroyOptionInfo(&instance->available_dri_options);
vk_debug_report_instance_destroy(&instance->debug_report_callbacks); vk_debug_report_instance_destroy(&instance->debug_report_callbacks);
vk_free(&instance->alloc, instance); vk_free(&instance->alloc, instance);
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#include "compiler/shader_enums.h" #include "compiler/shader_enums.h"
#include "util/macros.h" #include "util/macros.h"
#include "util/list.h" #include "util/list.h"
#include "util/xmlconfig.h"
#include "main/macros.h" #include "main/macros.h"
#include "vk_alloc.h" #include "vk_alloc.h"
#include "vk_debug_report.h" #include "vk_debug_report.h"
...@@ -337,6 +338,9 @@ struct radv_instance { ...@@ -337,6 +338,9 @@ struct radv_instance {
struct vk_debug_report_instance debug_report_callbacks; struct vk_debug_report_instance debug_report_callbacks;
struct radv_instance_extension_table enabled_extensions; struct radv_instance_extension_table enabled_extensions;
struct driOptionCache dri_options;
struct driOptionCache available_dri_options;
}; };
VkResult radv_init_wsi(struct radv_physical_device *physical_device); VkResult radv_init_wsi(struct radv_physical_device *physical_device);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment