1 /* 2 * Copyright © 2016 Red Hat. 3 * Copyright © 2016 Bas Nieuwenhuizen 4 * 5 * based in part on anv driver which is: 6 * Copyright © 2015 Intel Corporation 7 * 8 * SPDX-License-Identifier: MIT 9 */ 10 11 #ifndef RADV_INSTANCE_H 12 #define RADV_INSTANCE_H 13 14 #include "util/simple_mtx.h" 15 #include "util/xmlconfig.h" 16 #include "radv_radeon_winsys.h" 17 #include "vk_instance.h" 18 19 #ifdef ANDROID_STRICT 20 #define RADV_API_VERSION VK_MAKE_VERSION(1, 1, VK_HEADER_VERSION) 21 #else 22 #define RADV_API_VERSION VK_MAKE_VERSION(1, 3, VK_HEADER_VERSION) 23 #endif 24 25 enum radv_trace_mode { 26 /** Radeon GPU Profiler */ 27 RADV_TRACE_MODE_RGP = 1 << VK_TRACE_MODE_COUNT, 28 29 /** Radeon Raytracing Analyzer */ 30 RADV_TRACE_MODE_RRA = 1 << (VK_TRACE_MODE_COUNT + 1), 31 32 /** Gather context rolls of submitted command buffers */ 33 RADV_TRACE_MODE_CTX_ROLLS = 1 << (VK_TRACE_MODE_COUNT + 2), 34 }; 35 36 struct radv_instance { 37 struct vk_instance vk; 38 39 VkAllocationCallbacks alloc; 40 41 simple_mtx_t shader_dump_mtx; 42 43 uint64_t debug_flags; 44 uint64_t perftest_flags; 45 enum radeon_ctx_pstate profile_pstate; 46 47 struct { 48 struct driOptionCache options; 49 struct driOptionCache available_options; 50 51 bool enable_mrt_output_nan_fixup; 52 bool disable_tc_compat_htile_in_general; 53 bool disable_shrink_image_store; 54 bool disable_aniso_single_level; 55 bool disable_trunc_coord; 56 bool disable_depth_storage; 57 bool zero_vram; 58 bool disable_sinking_load_input_fs; 59 bool flush_before_query_copy; 60 bool enable_unified_heap_on_apu; 61 bool tex_non_uniform; 62 bool ssbo_non_uniform; 63 bool flush_before_timestamp_write; 64 bool force_rt_wave64; 65 bool dual_color_blend_by_location; 66 bool legacy_sparse_binding; 67 bool force_pstate_peak_gfx11_dgpu; 68 bool clear_lds; 69 bool enable_dgc; 70 bool enable_khr_present_wait; 71 bool report_llvm9_version_string; 72 bool vk_require_etc2; 73 bool vk_require_astc; 74 char *app_layer; 75 uint8_t override_graphics_shader_version; 76 uint8_t override_compute_shader_version; 77 uint8_t override_ray_tracing_shader_version; 78 int override_vram_size; 79 int override_uniform_offset_alignment; 80 } drirc; 81 }; 82 83 VK_DEFINE_HANDLE_CASTS(radv_instance, vk.base, VkInstance, VK_OBJECT_TYPE_INSTANCE) 84 85 const char *radv_get_debug_option_name(int id); 86 87 const char *radv_get_perftest_option_name(int id); 88 89 #endif /* RADV_INSTANCE_H */ 90