/* launch-options-editor-vkd3d-config.c generated by valac 0.56.19, the Vala compiler
 * generated from launch-options-editor-vkd3d-config.vala, do not modify */

#include "protonplus_core.h"
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VK_D3_DCONFIG_0_PROPERTY,
	PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VK_D3_DCONFIG_NUM_PROPERTIES
};
static GParamSpec* proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_properties[PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_LAUNCH_OPTION_VK_D3_DCONFIG_NUM_PROPERTIES];
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))

static gpointer proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_parent_class = NULL;

static void _g_free0_ (gpointer var);
static GType proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionVKD3DConfig*
proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_construct (GType object_type)
{
	ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionVKD3DConfig * self = NULL;
	gchar** keys = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	gchar* _tmp13_;
	gchar** _tmp14_;
	gint keys_length1;
	gint _keys_size_;
	gchar** display_opts = NULL;
	gchar* _tmp15_;
	gchar* _tmp16_;
	gchar** _tmp17_;
	gint display_opts_length1;
	gint _display_opts_size_;
	gchar** value_opts = NULL;
	gchar* _tmp18_;
	gchar* _tmp19_;
	gchar** _tmp20_;
	gint value_opts_length1;
	gint _value_opts_size_;
	GHashTable* tooltips = NULL;
	GHashFunc _tmp21_;
	GEqualFunc _tmp22_;
	GHashTable* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	gchar* _tmp26_;
	gchar* _tmp27_;
	gchar* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	gchar* _tmp34_;
	gchar* _tmp35_;
	gchar* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	gchar* _tmp46_;
	gchar* _tmp47_;
	gchar* _tmp48_;
	gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	_tmp0_ = g_strdup ("shader_cache");
	_tmp1_ = g_strdup ("force_host_cache");
	_tmp2_ = g_strdup ("no_upload_hvv");
	_tmp3_ = g_strdup ("upload_hvv");
	_tmp4_ = g_strdup ("nodxr");
	_tmp5_ = g_strdup ("dxr11");
	_tmp6_ = g_strdup ("dxr10");
	_tmp7_ = g_strdup ("bvh_force_cpu");
	_tmp8_ = g_strdup ("force_combined_providers");
	_tmp9_ = g_strdup ("gpuva");
	_tmp10_ = g_strdup ("no_alloc_view_descriptor_caches");
	_tmp11_ = g_strdup ("stable_power_state");
	_tmp12_ = g_strdup ("force_compute_root_parameters");
	_tmp13_ = g_strdup ("unaligned_stencil_clear");
	_tmp14_ = g_new0 (gchar*, 14 + 1);
	_tmp14_[0] = _tmp0_;
	_tmp14_[1] = _tmp1_;
	_tmp14_[2] = _tmp2_;
	_tmp14_[3] = _tmp3_;
	_tmp14_[4] = _tmp4_;
	_tmp14_[5] = _tmp5_;
	_tmp14_[6] = _tmp6_;
	_tmp14_[7] = _tmp7_;
	_tmp14_[8] = _tmp8_;
	_tmp14_[9] = _tmp9_;
	_tmp14_[10] = _tmp10_;
	_tmp14_[11] = _tmp11_;
	_tmp14_[12] = _tmp12_;
	_tmp14_[13] = _tmp13_;
	keys = _tmp14_;
	keys_length1 = 14;
	_keys_size_ = keys_length1;
	_tmp15_ = g_strdup (_ ("Disabled"));
	_tmp16_ = g_strdup (_ ("Enabled"));
	_tmp17_ = g_new0 (gchar*, 2 + 1);
	_tmp17_[0] = _tmp15_;
	_tmp17_[1] = _tmp16_;
	display_opts = _tmp17_;
	display_opts_length1 = 2;
	_display_opts_size_ = display_opts_length1;
	_tmp18_ = g_strdup ("");
	_tmp19_ = g_strdup ("1");
	_tmp20_ = g_new0 (gchar*, 2 + 1);
	_tmp20_[0] = _tmp18_;
	_tmp20_[1] = _tmp19_;
	value_opts = _tmp20_;
	value_opts_length1 = 2;
	_value_opts_size_ = value_opts_length1;
	_tmp21_ = g_str_hash;
	_tmp22_ = g_str_equal;
	_tmp23_ = g_hash_table_new_full (_tmp21_, _tmp22_, _g_free0_, _g_free0_);
	tooltips = _tmp23_;
	_tmp24_ = g_strdup ("shader_cache");
	_tmp25_ = g_strdup (_ ("Enables VKD3D's internal shader cache on disk. Drastically reduces mic" \
"ro-stuttering and speeds up consecutive loading times."));
	g_hash_table_insert (tooltips, _tmp24_, _tmp25_);
	_tmp26_ = g_strdup ("force_host_cache");
	_tmp27_ = g_strdup (_ ("Forces VKD3D to use system RAM instead of VRAM for caching shader comp" \
"ilation data, ensuring smoother data stream between CPU and GPU."));
	g_hash_table_insert (tooltips, _tmp26_, _tmp27_);
	_tmp28_ = g_strdup ("upload_hvv");
	_tmp29_ = g_strdup (_ ("Uses host-visible VRAM for staging buffers. Drastically reduces stutte" \
"ring if Resizable BAR / SAM is enabled."));
	g_hash_table_insert (tooltips, _tmp28_, _tmp29_);
	_tmp30_ = g_strdup ("no_upload_hvv");
	_tmp31_ = g_strdup (_ ("Disables host-visible VRAM staging buffers. Use as a compatibility fal" \
"lback if experiencing memory-related crashes."));
	g_hash_table_insert (tooltips, _tmp30_, _tmp31_);
	_tmp32_ = g_strdup ("nodxr");
	_tmp33_ = g_strdup (_ ("Disables D3D12 Ray Tracing (DXR) capabilities entirely. Significantly " \
"improves performance and stability on GPUs without strong hardware RT " \
"support."));
	g_hash_table_insert (tooltips, _tmp32_, _tmp33_);
	_tmp34_ = g_strdup ("dxr11");
	_tmp35_ = g_strdup (_ ("Exposes D3D12 Ray Tracing (DXR 1.1 and 1.0) capabilities to the game v" \
"ia Vulkan extensions."));
	g_hash_table_insert (tooltips, _tmp34_, _tmp35_);
	_tmp36_ = g_strdup ("dxr10");
	_tmp37_ = g_strdup (_ ("Restricts Ray Tracing capabilities to DXR 1.0 only. Useful for older R" \
"T games that crash with DXR 1.1."));
	g_hash_table_insert (tooltips, _tmp36_, _tmp37_);
	_tmp38_ = g_strdup ("bvh_force_cpu");
	_tmp39_ = g_strdup (_ ("Forces Ray Tracing BVH acceleration structures to be built on the CPU " \
"instead of the GPU. Severe performance impact!"));
	g_hash_table_insert (tooltips, _tmp38_, _tmp39_);
	_tmp40_ = g_strdup ("force_combined_providers");
	_tmp41_ = g_strdup (_ ("Aggressively unifies memory allocators for textures and buffers to sav" \
"e a small amount of VRAM."));
	g_hash_table_insert (tooltips, _tmp40_, _tmp41_);
	_tmp42_ = g_strdup ("gpuva");
	_tmp43_ = g_strdup (_ ("Enables advanced GPU Virtual Addressing to improve Direct3D 12 memory " \
"mapping in massive open-world games."));
	g_hash_table_insert (tooltips, _tmp42_, _tmp43_);
	_tmp44_ = g_strdup ("no_alloc_view_descriptor_caches");
	_tmp45_ = g_strdup (_ ("Disables descriptor caches. Workaround for specific games suffering fr" \
"om memory leaks."));
	g_hash_table_insert (tooltips, _tmp44_, _tmp45_);
	_tmp46_ = g_strdup ("stable_power_state");
	_tmp47_ = g_strdup (_ ("Forces the GPU to maintain stable clock rates. Intended for accurate b" \
"enchmarking only."));
	g_hash_table_insert (tooltips, _tmp46_, _tmp47_);
	_tmp48_ = g_strdup ("force_compute_root_parameters");
	_tmp49_ = g_strdup (_ ("Alters how root parameters are passed to compute shaders. Can fix spec" \
"ific rendering glitches."));
	g_hash_table_insert (tooltips, _tmp48_, _tmp49_);
	_tmp50_ = g_strdup ("unaligned_stencil_clear");
	_tmp51_ = g_strdup (_ ("Allows unaligned stencil buffer clears. Workaround for certain older D" \
"irect3D 12 renderers."));
	g_hash_table_insert (tooltips, _tmp50_, _tmp51_);
	self = (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionVKD3DConfig*) proton_plus_widgets_games_launch_options_editor_launch_option_custom_pairs_construct (object_type, _ ("VKD3D Proton Configurations"), _ ("Configure Direct3D 12 to Vulkan translation behavior"), _ ("Enable VKD3D Option"), _ ("Test specific Direct3D 12 compatibility workarounds and optimizations"), keys, (gint) keys_length1, display_opts, (gint) display_opts_length1, value_opts, (gint) value_opts_length1, tooltips, ",", "VKD3D_CONFIG");
	_g_hash_table_unref0 (tooltips);
	value_opts = (_vala_array_free (value_opts, value_opts_length1, (GDestroyNotify) g_free), NULL);
	display_opts = (_vala_array_free (display_opts, display_opts_length1, (GDestroyNotify) g_free), NULL);
	keys = (_vala_array_free (keys, keys_length1, (GDestroyNotify) g_free), NULL);
	return self;
}

ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionVKD3DConfig*
proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_new (void)
{
	return proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_construct (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_VK_D3_DCONFIG);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_class_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionVKD3DConfigClass * klass,
                                                                                        gpointer klass_data)
{
	proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_parent_class = g_type_class_peek_parent (klass);
}

static void
proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_instance_init (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionVKD3DConfig * self,
                                                                                           gpointer klass)
{
}

static GType
proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionVKD3DConfigClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionVKD3DConfig), 0, (GInstanceInitFunc) proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_instance_init, NULL };
	GType proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id;
	proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id = g_type_register_static (PROTON_PLUS_WIDGETS_GAMES_LAUNCH_OPTIONS_EDITOR_TYPE_LAUNCH_OPTION_CUSTOM_PAIRS, "ProtonPlusWidgetsGamesLaunchOptionsEditorLaunchOptionVKD3DConfig", &g_define_type_info, 0);
	return proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id;
}

GType
proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_get_type (void)
{
	static volatile gsize proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id__once = 0;
	if (g_once_init_enter (&proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id__once)) {
		GType proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id;
		proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id = proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_get_type_once ();
		g_once_init_leave (&proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id__once, proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id);
	}
	return proton_plus_widgets_games_launch_options_editor_launch_option_vk_d3_dconfig_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

