• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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, 4, VK_HEADER_VERSION)
23 #define RADV_API_VERSION_1_3 VK_MAKE_VERSION(1, 3, VK_HEADER_VERSION)
24 #endif
25 
26 enum radv_trace_mode {
27    /** Radeon GPU Profiler */
28    RADV_TRACE_MODE_RGP = 1 << VK_TRACE_MODE_COUNT,
29 
30    /** Radeon Raytracing Analyzer */
31    RADV_TRACE_MODE_RRA = 1 << (VK_TRACE_MODE_COUNT + 1),
32 
33    /** Gather context rolls of submitted command buffers */
34    RADV_TRACE_MODE_CTX_ROLLS = 1 << (VK_TRACE_MODE_COUNT + 2),
35 };
36 
37 struct radv_instance {
38    struct vk_instance vk;
39 
40    VkAllocationCallbacks alloc;
41 
42    simple_mtx_t shader_dump_mtx;
43 
44    uint64_t debug_flags;
45    uint64_t perftest_flags;
46    uint64_t trap_excp_flags;
47    enum radeon_ctx_pstate profile_pstate;
48 
49    struct {
50       struct driOptionCache options;
51       struct driOptionCache available_options;
52 
53       bool enable_mrt_output_nan_fixup;
54       bool disable_tc_compat_htile_in_general;
55       bool disable_shrink_image_store;
56       bool disable_aniso_single_level;
57       bool disable_trunc_coord;
58       bool disable_depth_storage;
59       bool zero_vram;
60       bool disable_sinking_load_input_fs;
61       bool flush_before_query_copy;
62       bool enable_unified_heap_on_apu;
63       bool tex_non_uniform;
64       bool ssbo_non_uniform;
65       bool flush_before_timestamp_write;
66       bool force_rt_wave64;
67       bool legacy_sparse_binding;
68       bool force_pstate_peak_gfx11_dgpu;
69       bool clear_lds;
70       bool enable_khr_present_wait;
71       bool report_llvm9_version_string;
72       bool vk_require_etc2;
73       bool vk_require_astc;
74       bool disable_dcc_mips;
75       bool disable_dcc_stores;
76       bool lower_terminate_to_discard;
77       char *app_layer;
78       uint8_t override_graphics_shader_version;
79       uint8_t override_compute_shader_version;
80       uint8_t override_ray_tracing_shader_version;
81       int override_vram_size;
82       int override_uniform_offset_alignment;
83    } drirc;
84 };
85 
86 VK_DEFINE_HANDLE_CASTS(radv_instance, vk.base, VkInstance, VK_OBJECT_TYPE_INSTANCE)
87 
88 const char *radv_get_debug_option_name(int id);
89 
90 const char *radv_get_perftest_option_name(int id);
91 
92 #endif /* RADV_INSTANCE_H */
93