mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 19:00:13 +01:00
radv: move performance related drirc to radv_drirc::performance
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37145>
This commit is contained in:
parent
d575b91b3a
commit
f13b181791
3 changed files with 23 additions and 14 deletions
|
|
@ -203,6 +203,17 @@ static const driOptionDescription radv_dri_options[] = {
|
|||
};
|
||||
// clang-format on
|
||||
|
||||
static void
|
||||
radv_init_dri_performance_options(struct radv_instance *instance)
|
||||
{
|
||||
struct radv_drirc *drirc = &instance->drirc;
|
||||
|
||||
drirc->performance.disable_ngg_gs = driQueryOptionb(&drirc->options, "radv_disable_ngg_gs");
|
||||
drirc->performance.enable_unified_heap_on_apu = driQueryOptionb(&drirc->options, "radv_enable_unified_heap_on_apu");
|
||||
drirc->performance.report_llvm9_version_string =
|
||||
driQueryOptionb(&drirc->options, "radv_report_llvm9_version_string");
|
||||
}
|
||||
|
||||
static void
|
||||
radv_init_dri_features_options(struct radv_instance *instance)
|
||||
{
|
||||
|
|
@ -225,6 +236,7 @@ radv_init_dri_options(struct radv_instance *instance)
|
|||
instance->vk.app_info.app_name, instance->vk.app_info.app_version,
|
||||
instance->vk.app_info.engine_name, instance->vk.app_info.engine_version);
|
||||
|
||||
radv_init_dri_performance_options(instance);
|
||||
radv_init_dri_features_options(instance);
|
||||
|
||||
drirc->enable_mrt_output_nan_fixup = driQueryOptionb(&drirc->options, "radv_enable_mrt_output_nan_fixup");
|
||||
|
|
@ -242,8 +254,6 @@ radv_init_dri_options(struct radv_instance *instance)
|
|||
if (driQueryOptionb(&drirc->options, "radv_disable_dcc"))
|
||||
instance->debug_flags |= RADV_DEBUG_NO_DCC;
|
||||
|
||||
drirc->disable_ngg_gs = driQueryOptionb(&drirc->options, "radv_disable_ngg_gs");
|
||||
|
||||
drirc->clear_lds = driQueryOptionb(&drirc->options, "radv_clear_lds");
|
||||
|
||||
drirc->zero_vram = driQueryOptionb(&drirc->options, "radv_zero_vram");
|
||||
|
|
@ -264,8 +274,6 @@ radv_init_dri_options(struct radv_instance *instance)
|
|||
|
||||
drirc->flush_before_query_copy = driQueryOptionb(&drirc->options, "radv_flush_before_query_copy");
|
||||
|
||||
drirc->enable_unified_heap_on_apu = driQueryOptionb(&drirc->options, "radv_enable_unified_heap_on_apu");
|
||||
|
||||
drirc->tex_non_uniform = driQueryOptionb(&drirc->options, "radv_tex_non_uniform");
|
||||
|
||||
drirc->ssbo_non_uniform = driQueryOptionb(&drirc->options, "radv_ssbo_non_uniform");
|
||||
|
|
@ -287,8 +295,6 @@ radv_init_dri_options(struct radv_instance *instance)
|
|||
drirc->override_uniform_offset_alignment =
|
||||
driQueryOptioni(&drirc->options, "radv_override_uniform_offset_alignment");
|
||||
|
||||
drirc->report_llvm9_version_string = driQueryOptionb(&drirc->options, "radv_report_llvm9_version_string");
|
||||
|
||||
drirc->disable_dcc_mips = driQueryOptionb(&drirc->options, "radv_disable_dcc_mips");
|
||||
drirc->disable_dcc_stores = driQueryOptionb(&drirc->options, "radv_disable_dcc_stores");
|
||||
|
||||
|
|
@ -454,7 +460,7 @@ radv_CreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationC
|
|||
if (instance->debug_flags & RADV_DEBUG_NO_NGG_GS) {
|
||||
fprintf(stderr, "radv: RADV_DEBUG=nongg_gs is deprecated and will it be removed in future Mesa releases. "
|
||||
"Please use radv_disable_ngg_gs=true instead.\n");
|
||||
instance->drirc.disable_ngg_gs = true;
|
||||
instance->drirc.performance.disable_ngg_gs = true;
|
||||
}
|
||||
|
||||
*pInstance = radv_instance_to_handle(instance);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ struct radv_drirc {
|
|||
struct driOptionCache options;
|
||||
struct driOptionCache available_options;
|
||||
|
||||
struct {
|
||||
bool disable_ngg_gs;
|
||||
bool enable_unified_heap_on_apu;
|
||||
bool report_llvm9_version_string;
|
||||
} performance;
|
||||
|
||||
struct {
|
||||
bool cooperative_matrix2_nv;
|
||||
bool emulate_rt;
|
||||
|
|
@ -55,12 +61,10 @@ struct radv_drirc {
|
|||
bool zero_vram;
|
||||
bool disable_sinking_load_input_fs;
|
||||
bool flush_before_query_copy;
|
||||
bool enable_unified_heap_on_apu;
|
||||
bool tex_non_uniform;
|
||||
bool ssbo_non_uniform;
|
||||
bool flush_before_timestamp_write;
|
||||
bool clear_lds;
|
||||
bool report_llvm9_version_string;
|
||||
bool disable_dcc_mips;
|
||||
bool disable_dcc_stores;
|
||||
bool lower_terminate_to_discard;
|
||||
|
|
@ -68,7 +72,6 @@ struct radv_drirc {
|
|||
bool no_dynamic_bounds;
|
||||
bool invariant_geom;
|
||||
bool split_fma;
|
||||
bool disable_ngg_gs;
|
||||
char *app_layer;
|
||||
uint8_t override_graphics_shader_version;
|
||||
uint8_t override_compute_shader_version;
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ radv_physical_device_init_cache_key(struct radv_physical_device *pdev)
|
|||
key->ge_wave32 = pdev->ge_wave_size == 32;
|
||||
key->invariant_geom = instance->drirc.invariant_geom;
|
||||
key->no_fmask = !!(instance->debug_flags & RADV_DEBUG_NO_FMASK);
|
||||
key->no_ngg_gs = instance->drirc.disable_ngg_gs;
|
||||
key->no_ngg_gs = instance->drirc.performance.disable_ngg_gs;
|
||||
key->no_rt = !!(instance->debug_flags & RADV_DEBUG_NO_RT);
|
||||
key->ps_wave32 = pdev->ps_wave_size == 32;
|
||||
key->rt_wave64 = pdev->rt_wave_size == 64;
|
||||
|
|
@ -363,7 +363,7 @@ radv_physical_device_init_mem_types(struct radv_physical_device *pdev)
|
|||
if (!pdev->info.has_dedicated_vram) {
|
||||
const uint64_t total_size = gtt_size + visible_vram_size;
|
||||
|
||||
if (instance->drirc.enable_unified_heap_on_apu) {
|
||||
if (instance->drirc.performance.enable_unified_heap_on_apu) {
|
||||
/* Some applications seem better when the driver exposes only one heap of VRAM on APUs. */
|
||||
visible_vram_size = total_size;
|
||||
gtt_size = 0;
|
||||
|
|
@ -1437,7 +1437,7 @@ radv_get_compiler_string(struct radv_physical_device *pdev)
|
|||
* version is too old or if the LLVM version string is
|
||||
* missing. This gives 2-5% performance with SotTR and ACO.
|
||||
*/
|
||||
if (instance->drirc.report_llvm9_version_string) {
|
||||
if (instance->drirc.performance.report_llvm9_version_string) {
|
||||
return " (LLVM 9.0.1)";
|
||||
}
|
||||
|
||||
|
|
@ -2750,7 +2750,7 @@ radv_get_memory_budget_properties(VkPhysicalDevice physicalDevice,
|
|||
* in presence of shared buffers).
|
||||
*/
|
||||
if (!pdev->info.has_dedicated_vram) {
|
||||
if (instance->drirc.enable_unified_heap_on_apu) {
|
||||
if (instance->drirc.performance.enable_unified_heap_on_apu) {
|
||||
/* When the heaps are unified, only the visible VRAM heap is exposed on APUs. */
|
||||
assert(pdev->heaps == RADV_HEAP_VRAM_VIS);
|
||||
assert(pdev->memory_properties.memoryHeaps[0].flags == VK_MEMORY_HEAP_DEVICE_LOCAL_BIT);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue